|
53 | 53 | * rdmavt layer.
|
54 | 54 | */
|
55 | 55 |
|
| 56 | +#include <linux/spinlock.h> |
| 57 | +#include <linux/list.h> |
56 | 58 | #include "ib_verbs.h"
|
57 | 59 |
|
58 | 60 | #define RVT_MULTICAST_LID_BASE 0xC000
|
@@ -359,6 +361,65 @@ struct rvt_srq {
|
359 | 361 |
|
360 | 362 | /* End QP section */
|
361 | 363 |
|
| 364 | +struct rvt_ibport { |
| 365 | + struct rvt_qp __rcu *qp[2]; |
| 366 | + struct ib_mad_agent *send_agent; /* agent for SMI (traps) */ |
| 367 | + struct rb_root mcast_tree; |
| 368 | + spinlock_t lock; /* protect changes in this struct */ |
| 369 | + |
| 370 | + /* non-zero when timer is set */ |
| 371 | + unsigned long mkey_lease_timeout; |
| 372 | + unsigned long trap_timeout; |
| 373 | + __be64 gid_prefix; /* in network order */ |
| 374 | + __be64 mkey; |
| 375 | + u64 tid; |
| 376 | + u32 port_cap_flags; |
| 377 | + u32 pma_sample_start; |
| 378 | + u32 pma_sample_interval; |
| 379 | + __be16 pma_counter_select[5]; |
| 380 | + u16 pma_tag; |
| 381 | + u16 mkey_lease_period; |
| 382 | + u16 sm_lid; |
| 383 | + u8 sm_sl; |
| 384 | + u8 mkeyprot; |
| 385 | + u8 subnet_timeout; |
| 386 | + u8 vl_high_limit; |
| 387 | + |
| 388 | + /* |
| 389 | + * Driver is expected to keep these up to date. These |
| 390 | + * counters are informational only and not required to be |
| 391 | + * completely accurate. |
| 392 | + */ |
| 393 | + u64 n_rc_resends; |
| 394 | + u64 n_seq_naks; |
| 395 | + u64 n_rdma_seq; |
| 396 | + u64 n_rnr_naks; |
| 397 | + u64 n_other_naks; |
| 398 | + u64 n_loop_pkts; |
| 399 | + u64 n_pkt_drops; |
| 400 | + u64 n_vl15_dropped; |
| 401 | + u64 n_rc_timeouts; |
| 402 | + u64 n_dmawait; |
| 403 | + u64 n_unaligned; |
| 404 | + u64 n_rc_dupreq; |
| 405 | + u64 n_rc_seqnak; |
| 406 | + u16 pkey_violations; |
| 407 | + u16 qkey_violations; |
| 408 | + u16 mkey_violations; |
| 409 | + |
| 410 | + /* Hot-path per CPU counters to avoid cacheline trading to update */ |
| 411 | + u64 z_rc_acks; |
| 412 | + u64 z_rc_qacks; |
| 413 | + u64 z_rc_delayed_comp; |
| 414 | + u64 __percpu *rc_acks; |
| 415 | + u64 __percpu *rc_qacks; |
| 416 | + u64 __percpu *rc_delayed_comp; |
| 417 | + |
| 418 | + void *priv; /* driver private data */ |
| 419 | + |
| 420 | + /* TODO: Move sm_ah and smi_ah into here as well*/ |
| 421 | +}; |
| 422 | + |
362 | 423 | /*
|
363 | 424 | * Things that are driver specific, module parameters in hfi1 and qib
|
364 | 425 | */
|
@@ -403,6 +464,7 @@ struct rvt_driver_params {
|
403 | 464 | * For instance special module parameters. Goes here.
|
404 | 465 | */
|
405 | 466 | unsigned int lkey_table_size;
|
| 467 | + int nports; |
406 | 468 | };
|
407 | 469 |
|
408 | 470 | /*
|
@@ -465,6 +527,7 @@ struct rvt_dev_info {
|
465 | 527 | spinlock_t n_ahs_lock; /* Protect ah allocated count */
|
466 | 528 |
|
467 | 529 | int flags;
|
| 530 | + struct rvt_ibport **ports; |
468 | 531 | };
|
469 | 532 |
|
470 | 533 | static inline struct rvt_pd *ibpd_to_rvtpd(struct ib_pd *ibpd)
|
@@ -501,9 +564,10 @@ static inline struct rvt_srq *ibsrq_to_rvtsrq(struct ib_srq *ibsrq)
|
501 | 564 | int rvt_register_device(struct rvt_dev_info *rvd);
|
502 | 565 | void rvt_unregister_device(struct rvt_dev_info *rvd);
|
503 | 566 | int rvt_check_ah(struct ib_device *ibdev, struct ib_ah_attr *ah_attr);
|
| 567 | +void rvt_attach_port(struct rvt_dev_info *rdi, struct rvt_ibport *port, |
| 568 | + int portnum); |
504 | 569 | int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge,
|
505 | 570 | u32 len, u64 vaddr, u32 rkey, int acc);
|
506 | 571 | int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,
|
507 | 572 | struct rvt_sge *isge, struct ib_sge *sge, int acc);
|
508 |
| - |
509 | 573 | #endif /* DEF_RDMA_VT_H */
|
0 commit comments