aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib_verbs.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_verbs.h')
-rw-r--r--drivers/infiniband/hw/qib/qib_verbs.h145
1 files changed, 82 insertions, 63 deletions
diff --git a/drivers/infiniband/hw/qib/qib_verbs.h b/drivers/infiniband/hw/qib/qib_verbs.h
index 0c19ef0c4123..487606024659 100644
--- a/drivers/infiniband/hw/qib/qib_verbs.h
+++ b/drivers/infiniband/hw/qib/qib_verbs.h
@@ -367,9 +367,10 @@ struct qib_rwq {
367 367
368struct qib_rq { 368struct qib_rq {
369 struct qib_rwq *wq; 369 struct qib_rwq *wq;
370 spinlock_t lock; /* protect changes in this struct */
371 u32 size; /* size of RWQE array */ 370 u32 size; /* size of RWQE array */
372 u8 max_sge; 371 u8 max_sge;
372 spinlock_t lock /* protect changes in this struct */
373 ____cacheline_aligned_in_smp;
373}; 374};
374 375
375struct qib_srq { 376struct qib_srq {
@@ -412,31 +413,75 @@ struct qib_ack_entry {
412 */ 413 */
413struct qib_qp { 414struct qib_qp {
414 struct ib_qp ibqp; 415 struct ib_qp ibqp;
415 struct qib_qp *next; /* link list for QPN hash table */ 416 /* read mostly fields above and below */
416 struct qib_qp *timer_next; /* link list for qib_ib_timer() */
417 struct list_head iowait; /* link for wait PIO buf */
418 struct list_head rspwait; /* link for waititing to respond */
419 struct ib_ah_attr remote_ah_attr; 417 struct ib_ah_attr remote_ah_attr;
420 struct ib_ah_attr alt_ah_attr; 418 struct ib_ah_attr alt_ah_attr;
421 struct qib_ib_header s_hdr; /* next packet header to send */ 419 struct qib_qp *next; /* link list for QPN hash table */
422 atomic_t refcount; 420 struct qib_swqe *s_wq; /* send work queue */
423 wait_queue_head_t wait;
424 wait_queue_head_t wait_dma;
425 struct timer_list s_timer;
426 struct work_struct s_work;
427 struct qib_mmap_info *ip; 421 struct qib_mmap_info *ip;
422 struct qib_ib_header *s_hdr; /* next packet header to send */
423 unsigned long timeout_jiffies; /* computed from timeout */
424
425 enum ib_mtu path_mtu;
426 u32 remote_qpn;
427 u32 pmtu; /* decoded from path_mtu */
428 u32 qkey; /* QKEY for this QP (for UD or RD) */
429 u32 s_size; /* send work queue size */
430 u32 s_rnr_timeout; /* number of milliseconds for RNR timeout */
431
432 u8 state; /* QP state */
433 u8 qp_access_flags;
434 u8 alt_timeout; /* Alternate path timeout for this QP */
435 u8 timeout; /* Timeout for this QP */
436 u8 s_srate;
437 u8 s_mig_state;
438 u8 port_num;
439 u8 s_pkey_index; /* PKEY index to use */
440 u8 s_alt_pkey_index; /* Alternate path PKEY index to use */
441 u8 r_max_rd_atomic; /* max number of RDMA read/atomic to receive */
442 u8 s_max_rd_atomic; /* max number of RDMA read/atomic to send */
443 u8 s_retry_cnt; /* number of times to retry */
444 u8 s_rnr_retry_cnt;
445 u8 r_min_rnr_timer; /* retry timeout value for RNR NAKs */
446 u8 s_max_sge; /* size of s_wq->sg_list */
447 u8 s_draining;
448
449 /* start of read/write fields */
450
451 atomic_t refcount ____cacheline_aligned_in_smp;
452 wait_queue_head_t wait;
453
454
455 struct qib_ack_entry s_ack_queue[QIB_MAX_RDMA_ATOMIC + 1]
456 ____cacheline_aligned_in_smp;
457 struct qib_sge_state s_rdma_read_sge;
458
459 spinlock_t r_lock ____cacheline_aligned_in_smp; /* used for APM */
460 unsigned long r_aflags;
461 u64 r_wr_id; /* ID for current receive WQE */
462 u32 r_ack_psn; /* PSN for next ACK or atomic ACK */
463 u32 r_len; /* total length of r_sge */
464 u32 r_rcv_len; /* receive data len processed */
465 u32 r_psn; /* expected rcv packet sequence number */
466 u32 r_msn; /* message sequence number */
467
468 u8 r_state; /* opcode of last packet received */
469 u8 r_flags;
470 u8 r_head_ack_queue; /* index into s_ack_queue[] */
471
472 struct list_head rspwait; /* link for waititing to respond */
473
474 struct qib_sge_state r_sge; /* current receive data */
475 struct qib_rq r_rq; /* receive work queue */
476
477 spinlock_t s_lock ____cacheline_aligned_in_smp;
428 struct qib_sge_state *s_cur_sge; 478 struct qib_sge_state *s_cur_sge;
479 u32 s_flags;
429 struct qib_verbs_txreq *s_tx; 480 struct qib_verbs_txreq *s_tx;
430 struct qib_mregion *s_rdma_mr; 481 struct qib_swqe *s_wqe;
431 struct qib_sge_state s_sge; /* current send request data */ 482 struct qib_sge_state s_sge; /* current send request data */
432 struct qib_ack_entry s_ack_queue[QIB_MAX_RDMA_ATOMIC + 1]; 483 struct qib_mregion *s_rdma_mr;
433 struct qib_sge_state s_ack_rdma_sge;
434 struct qib_sge_state s_rdma_read_sge;
435 struct qib_sge_state r_sge; /* current receive data */
436 spinlock_t r_lock; /* used for APM */
437 spinlock_t s_lock;
438 atomic_t s_dma_busy; 484 atomic_t s_dma_busy;
439 u32 s_flags;
440 u32 s_cur_size; /* size of send packet in bytes */ 485 u32 s_cur_size; /* size of send packet in bytes */
441 u32 s_len; /* total length of s_sge */ 486 u32 s_len; /* total length of s_sge */
442 u32 s_rdma_read_len; /* total length of s_rdma_read_sge */ 487 u32 s_rdma_read_len; /* total length of s_rdma_read_sge */
@@ -447,60 +492,34 @@ struct qib_qp {
447 u32 s_psn; /* current packet sequence number */ 492 u32 s_psn; /* current packet sequence number */
448 u32 s_ack_rdma_psn; /* PSN for sending RDMA read responses */ 493 u32 s_ack_rdma_psn; /* PSN for sending RDMA read responses */
449 u32 s_ack_psn; /* PSN for acking sends and RDMA writes */ 494 u32 s_ack_psn; /* PSN for acking sends and RDMA writes */
450 u32 s_rnr_timeout; /* number of milliseconds for RNR timeout */ 495 u32 s_head; /* new entries added here */
451 u32 r_ack_psn; /* PSN for next ACK or atomic ACK */ 496 u32 s_tail; /* next entry to process */
452 u64 r_wr_id; /* ID for current receive WQE */ 497 u32 s_cur; /* current work queue entry */
453 unsigned long r_aflags; 498 u32 s_acked; /* last un-ACK'ed entry */
454 u32 r_len; /* total length of r_sge */ 499 u32 s_last; /* last completed entry */
455 u32 r_rcv_len; /* receive data len processed */ 500 u32 s_ssn; /* SSN of tail entry */
456 u32 r_psn; /* expected rcv packet sequence number */ 501 u32 s_lsn; /* limit sequence number (credit) */
457 u32 r_msn; /* message sequence number */
458 u16 s_hdrwords; /* size of s_hdr in 32 bit words */ 502 u16 s_hdrwords; /* size of s_hdr in 32 bit words */
459 u16 s_rdma_ack_cnt; 503 u16 s_rdma_ack_cnt;
460 u8 state; /* QP state */
461 u8 s_state; /* opcode of last packet sent */ 504 u8 s_state; /* opcode of last packet sent */
462 u8 s_ack_state; /* opcode of packet to ACK */ 505 u8 s_ack_state; /* opcode of packet to ACK */
463 u8 s_nak_state; /* non-zero if NAK is pending */ 506 u8 s_nak_state; /* non-zero if NAK is pending */
464 u8 r_state; /* opcode of last packet received */
465 u8 r_nak_state; /* non-zero if NAK is pending */ 507 u8 r_nak_state; /* non-zero if NAK is pending */
466 u8 r_min_rnr_timer; /* retry timeout value for RNR NAKs */
467 u8 r_flags;
468 u8 r_max_rd_atomic; /* max number of RDMA read/atomic to receive */
469 u8 r_head_ack_queue; /* index into s_ack_queue[] */
470 u8 qp_access_flags;
471 u8 s_max_sge; /* size of s_wq->sg_list */
472 u8 s_retry_cnt; /* number of times to retry */
473 u8 s_rnr_retry_cnt;
474 u8 s_retry; /* requester retry counter */ 508 u8 s_retry; /* requester retry counter */
475 u8 s_rnr_retry; /* requester RNR retry counter */ 509 u8 s_rnr_retry; /* requester RNR retry counter */
476 u8 s_pkey_index; /* PKEY index to use */
477 u8 s_alt_pkey_index; /* Alternate path PKEY index to use */
478 u8 s_max_rd_atomic; /* max number of RDMA read/atomic to send */
479 u8 s_num_rd_atomic; /* number of RDMA read/atomic pending */ 510 u8 s_num_rd_atomic; /* number of RDMA read/atomic pending */
480 u8 s_tail_ack_queue; /* index into s_ack_queue[] */ 511 u8 s_tail_ack_queue; /* index into s_ack_queue[] */
481 u8 s_srate; 512
482 u8 s_draining; 513 struct qib_sge_state s_ack_rdma_sge;
483 u8 s_mig_state; 514 struct timer_list s_timer;
484 u8 timeout; /* Timeout for this QP */ 515 struct list_head iowait; /* link for wait PIO buf */
485 u8 alt_timeout; /* Alternate path timeout for this QP */ 516
486 u8 port_num; 517 struct work_struct s_work;
487 enum ib_mtu path_mtu; 518
488 u32 pmtu; /* decoded from path_mtu */ 519 wait_queue_head_t wait_dma;
489 u32 remote_qpn; 520
490 u32 qkey; /* QKEY for this QP (for UD or RD) */ 521 struct qib_sge r_sg_list[0] /* verified SGEs */
491 u32 s_size; /* send work queue size */ 522 ____cacheline_aligned_in_smp;
492 u32 s_head; /* new entries added here */
493 u32 s_tail; /* next entry to process */
494 u32 s_cur; /* current work queue entry */
495 u32 s_acked; /* last un-ACK'ed entry */
496 u32 s_last; /* last completed entry */
497 u32 s_ssn; /* SSN of tail entry */
498 u32 s_lsn; /* limit sequence number (credit) */
499 unsigned long timeout_jiffies; /* computed from timeout */
500 struct qib_swqe *s_wq; /* send work queue */
501 struct qib_swqe *s_wqe;
502 struct qib_rq r_rq; /* receive work queue */
503 struct qib_sge r_sg_list[0]; /* verified SGEs */
504}; 523};
505 524
506/* 525/*