diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2012-05-07 14:02:31 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-05-14 15:43:34 -0400 |
commit | 1c94283ddbe8a9945c4aaac8b0be90d47f97f2df (patch) | |
tree | 37d46ea239d1e872007bd0dc93b2a3d40311afa8 /drivers/infiniband | |
parent | 3236b2d469dba42fde837b8cb06308f7f360dfed (diff) |
IB/qib: Add cache line awareness to qib_qp and qib_devdata structures
This patch reorganizes the QP and devdata files to be more cache line aware.
qib_qp fields in particular are split into read-mostly, send, and receive fields.
qib_devdata fields are split into read-mostly and read/write fields
Testing has show that bidirectional tests improve by as much as 100%
with this patch.
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/qib/qib.h | 26 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_qp.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_rc.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_ruc.c | 12 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_uc.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_ud.c | 16 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_verbs.h | 145 |
7 files changed, 120 insertions, 94 deletions
diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h index 2d638877c4af..7e62f4137148 100644 --- a/drivers/infiniband/hw/qib/qib.h +++ b/drivers/infiniband/hw/qib/qib.h | |||
@@ -530,8 +530,6 @@ struct qib_pportdata { | |||
530 | /* qib_lflags driver is waiting for */ | 530 | /* qib_lflags driver is waiting for */ |
531 | u32 state_wanted; | 531 | u32 state_wanted; |
532 | spinlock_t lflags_lock; | 532 | spinlock_t lflags_lock; |
533 | /* number of (port-specific) interrupts for this port -- saturates... */ | ||
534 | u32 int_counter; | ||
535 | 533 | ||
536 | /* ref count for each pkey */ | 534 | /* ref count for each pkey */ |
537 | atomic_t pkeyrefs[4]; | 535 | atomic_t pkeyrefs[4]; |
@@ -543,24 +541,26 @@ struct qib_pportdata { | |||
543 | u64 *statusp; | 541 | u64 *statusp; |
544 | 542 | ||
545 | /* SendDMA related entries */ | 543 | /* SendDMA related entries */ |
546 | spinlock_t sdma_lock; | 544 | |
547 | struct qib_sdma_state sdma_state; | 545 | /* read mostly */ |
548 | unsigned long sdma_buf_jiffies; | ||
549 | struct qib_sdma_desc *sdma_descq; | 546 | struct qib_sdma_desc *sdma_descq; |
547 | struct qib_sdma_state sdma_state; | ||
548 | dma_addr_t sdma_descq_phys; | ||
549 | volatile __le64 *sdma_head_dma; /* DMA'ed by chip */ | ||
550 | dma_addr_t sdma_head_phys; | ||
551 | u16 sdma_descq_cnt; | ||
552 | |||
553 | /* read/write using lock */ | ||
554 | spinlock_t sdma_lock ____cacheline_aligned_in_smp; | ||
555 | struct list_head sdma_activelist; | ||
550 | u64 sdma_descq_added; | 556 | u64 sdma_descq_added; |
551 | u64 sdma_descq_removed; | 557 | u64 sdma_descq_removed; |
552 | u16 sdma_descq_cnt; | ||
553 | u16 sdma_descq_tail; | 558 | u16 sdma_descq_tail; |
554 | u16 sdma_descq_head; | 559 | u16 sdma_descq_head; |
555 | u16 sdma_next_intr; | ||
556 | u16 sdma_reset_wait; | ||
557 | u8 sdma_generation; | 560 | u8 sdma_generation; |
558 | struct tasklet_struct sdma_sw_clean_up_task; | ||
559 | struct list_head sdma_activelist; | ||
560 | 561 | ||
561 | dma_addr_t sdma_descq_phys; | 562 | struct tasklet_struct sdma_sw_clean_up_task |
562 | volatile __le64 *sdma_head_dma; /* DMA'ed by chip */ | 563 | ____cacheline_aligned_in_smp; |
563 | dma_addr_t sdma_head_phys; | ||
564 | 564 | ||
565 | wait_queue_head_t state_wait; /* for state_wanted */ | 565 | wait_queue_head_t state_wait; /* for state_wanted */ |
566 | 566 | ||
diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c index 7e7e16fbee99..1ce56b51ab1a 100644 --- a/drivers/infiniband/hw/qib/qib_qp.c +++ b/drivers/infiniband/hw/qib/qib_qp.c | |||
@@ -1038,6 +1038,11 @@ struct ib_qp *qib_create_qp(struct ib_pd *ibpd, | |||
1038 | goto bail_swq; | 1038 | goto bail_swq; |
1039 | } | 1039 | } |
1040 | RCU_INIT_POINTER(qp->next, NULL); | 1040 | RCU_INIT_POINTER(qp->next, NULL); |
1041 | qp->s_hdr = kzalloc(sizeof(*qp->s_hdr), GFP_KERNEL); | ||
1042 | if (!qp->s_hdr) { | ||
1043 | ret = ERR_PTR(-ENOMEM); | ||
1044 | goto bail_qp; | ||
1045 | } | ||
1041 | qp->timeout_jiffies = | 1046 | qp->timeout_jiffies = |
1042 | usecs_to_jiffies((4096UL * (1UL << qp->timeout)) / | 1047 | usecs_to_jiffies((4096UL * (1UL << qp->timeout)) / |
1043 | 1000UL); | 1048 | 1000UL); |
@@ -1159,6 +1164,7 @@ bail_ip: | |||
1159 | vfree(qp->r_rq.wq); | 1164 | vfree(qp->r_rq.wq); |
1160 | free_qpn(&dev->qpn_table, qp->ibqp.qp_num); | 1165 | free_qpn(&dev->qpn_table, qp->ibqp.qp_num); |
1161 | bail_qp: | 1166 | bail_qp: |
1167 | kfree(qp->s_hdr); | ||
1162 | kfree(qp); | 1168 | kfree(qp); |
1163 | bail_swq: | 1169 | bail_swq: |
1164 | vfree(swq); | 1170 | vfree(swq); |
@@ -1214,6 +1220,7 @@ int qib_destroy_qp(struct ib_qp *ibqp) | |||
1214 | else | 1220 | else |
1215 | vfree(qp->r_rq.wq); | 1221 | vfree(qp->r_rq.wq); |
1216 | vfree(qp->s_wq); | 1222 | vfree(qp->s_wq); |
1223 | kfree(qp->s_hdr); | ||
1217 | kfree(qp); | 1224 | kfree(qp); |
1218 | return 0; | 1225 | return 0; |
1219 | } | 1226 | } |
diff --git a/drivers/infiniband/hw/qib/qib_rc.c b/drivers/infiniband/hw/qib/qib_rc.c index 765b4cbaa020..b641416148eb 100644 --- a/drivers/infiniband/hw/qib/qib_rc.c +++ b/drivers/infiniband/hw/qib/qib_rc.c | |||
@@ -244,9 +244,9 @@ int qib_make_rc_req(struct qib_qp *qp) | |||
244 | int ret = 0; | 244 | int ret = 0; |
245 | int delta; | 245 | int delta; |
246 | 246 | ||
247 | ohdr = &qp->s_hdr.u.oth; | 247 | ohdr = &qp->s_hdr->u.oth; |
248 | if (qp->remote_ah_attr.ah_flags & IB_AH_GRH) | 248 | if (qp->remote_ah_attr.ah_flags & IB_AH_GRH) |
249 | ohdr = &qp->s_hdr.u.l.oth; | 249 | ohdr = &qp->s_hdr->u.l.oth; |
250 | 250 | ||
251 | /* | 251 | /* |
252 | * The lock is needed to synchronize between the sending tasklet, | 252 | * The lock is needed to synchronize between the sending tasklet, |
diff --git a/drivers/infiniband/hw/qib/qib_ruc.c b/drivers/infiniband/hw/qib/qib_ruc.c index b4b37e47321a..c0ee7e095d81 100644 --- a/drivers/infiniband/hw/qib/qib_ruc.c +++ b/drivers/infiniband/hw/qib/qib_ruc.c | |||
@@ -688,17 +688,17 @@ void qib_make_ruc_header(struct qib_qp *qp, struct qib_other_headers *ohdr, | |||
688 | nwords = (qp->s_cur_size + extra_bytes) >> 2; | 688 | nwords = (qp->s_cur_size + extra_bytes) >> 2; |
689 | lrh0 = QIB_LRH_BTH; | 689 | lrh0 = QIB_LRH_BTH; |
690 | if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) { | 690 | if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) { |
691 | qp->s_hdrwords += qib_make_grh(ibp, &qp->s_hdr.u.l.grh, | 691 | qp->s_hdrwords += qib_make_grh(ibp, &qp->s_hdr->u.l.grh, |
692 | &qp->remote_ah_attr.grh, | 692 | &qp->remote_ah_attr.grh, |
693 | qp->s_hdrwords, nwords); | 693 | qp->s_hdrwords, nwords); |
694 | lrh0 = QIB_LRH_GRH; | 694 | lrh0 = QIB_LRH_GRH; |
695 | } | 695 | } |
696 | lrh0 |= ibp->sl_to_vl[qp->remote_ah_attr.sl] << 12 | | 696 | lrh0 |= ibp->sl_to_vl[qp->remote_ah_attr.sl] << 12 | |
697 | qp->remote_ah_attr.sl << 4; | 697 | qp->remote_ah_attr.sl << 4; |
698 | qp->s_hdr.lrh[0] = cpu_to_be16(lrh0); | 698 | qp->s_hdr->lrh[0] = cpu_to_be16(lrh0); |
699 | qp->s_hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid); | 699 | qp->s_hdr->lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid); |
700 | qp->s_hdr.lrh[2] = cpu_to_be16(qp->s_hdrwords + nwords + SIZE_OF_CRC); | 700 | qp->s_hdr->lrh[2] = cpu_to_be16(qp->s_hdrwords + nwords + SIZE_OF_CRC); |
701 | qp->s_hdr.lrh[3] = cpu_to_be16(ppd_from_ibp(ibp)->lid | | 701 | qp->s_hdr->lrh[3] = cpu_to_be16(ppd_from_ibp(ibp)->lid | |
702 | qp->remote_ah_attr.src_path_bits); | 702 | qp->remote_ah_attr.src_path_bits); |
703 | bth0 |= qib_get_pkey(ibp, qp->s_pkey_index); | 703 | bth0 |= qib_get_pkey(ibp, qp->s_pkey_index); |
704 | bth0 |= extra_bytes << 20; | 704 | bth0 |= extra_bytes << 20; |
@@ -758,7 +758,7 @@ void qib_do_send(struct work_struct *work) | |||
758 | * If the packet cannot be sent now, return and | 758 | * If the packet cannot be sent now, return and |
759 | * the send tasklet will be woken up later. | 759 | * the send tasklet will be woken up later. |
760 | */ | 760 | */ |
761 | if (qib_verbs_send(qp, &qp->s_hdr, qp->s_hdrwords, | 761 | if (qib_verbs_send(qp, qp->s_hdr, qp->s_hdrwords, |
762 | qp->s_cur_sge, qp->s_cur_size)) | 762 | qp->s_cur_sge, qp->s_cur_size)) |
763 | break; | 763 | break; |
764 | /* Record that s_hdr is empty. */ | 764 | /* Record that s_hdr is empty. */ |
diff --git a/drivers/infiniband/hw/qib/qib_uc.c b/drivers/infiniband/hw/qib/qib_uc.c index 7ce2ac2ed219..ce7387ff5d91 100644 --- a/drivers/infiniband/hw/qib/qib_uc.c +++ b/drivers/infiniband/hw/qib/qib_uc.c | |||
@@ -72,9 +72,9 @@ int qib_make_uc_req(struct qib_qp *qp) | |||
72 | goto done; | 72 | goto done; |
73 | } | 73 | } |
74 | 74 | ||
75 | ohdr = &qp->s_hdr.u.oth; | 75 | ohdr = &qp->s_hdr->u.oth; |
76 | if (qp->remote_ah_attr.ah_flags & IB_AH_GRH) | 76 | if (qp->remote_ah_attr.ah_flags & IB_AH_GRH) |
77 | ohdr = &qp->s_hdr.u.l.oth; | 77 | ohdr = &qp->s_hdr->u.l.oth; |
78 | 78 | ||
79 | /* header size in 32-bit words LRH+BTH = (8+12)/4. */ | 79 | /* header size in 32-bit words LRH+BTH = (8+12)/4. */ |
80 | hwords = 5; | 80 | hwords = 5; |
diff --git a/drivers/infiniband/hw/qib/qib_ud.c b/drivers/infiniband/hw/qib/qib_ud.c index 828609fa4d28..a468bf2d4465 100644 --- a/drivers/infiniband/hw/qib/qib_ud.c +++ b/drivers/infiniband/hw/qib/qib_ud.c | |||
@@ -321,11 +321,11 @@ int qib_make_ud_req(struct qib_qp *qp) | |||
321 | 321 | ||
322 | if (ah_attr->ah_flags & IB_AH_GRH) { | 322 | if (ah_attr->ah_flags & IB_AH_GRH) { |
323 | /* Header size in 32-bit words. */ | 323 | /* Header size in 32-bit words. */ |
324 | qp->s_hdrwords += qib_make_grh(ibp, &qp->s_hdr.u.l.grh, | 324 | qp->s_hdrwords += qib_make_grh(ibp, &qp->s_hdr->u.l.grh, |
325 | &ah_attr->grh, | 325 | &ah_attr->grh, |
326 | qp->s_hdrwords, nwords); | 326 | qp->s_hdrwords, nwords); |
327 | lrh0 = QIB_LRH_GRH; | 327 | lrh0 = QIB_LRH_GRH; |
328 | ohdr = &qp->s_hdr.u.l.oth; | 328 | ohdr = &qp->s_hdr->u.l.oth; |
329 | /* | 329 | /* |
330 | * Don't worry about sending to locally attached multicast | 330 | * Don't worry about sending to locally attached multicast |
331 | * QPs. It is unspecified by the spec. what happens. | 331 | * QPs. It is unspecified by the spec. what happens. |
@@ -333,7 +333,7 @@ int qib_make_ud_req(struct qib_qp *qp) | |||
333 | } else { | 333 | } else { |
334 | /* Header size in 32-bit words. */ | 334 | /* Header size in 32-bit words. */ |
335 | lrh0 = QIB_LRH_BTH; | 335 | lrh0 = QIB_LRH_BTH; |
336 | ohdr = &qp->s_hdr.u.oth; | 336 | ohdr = &qp->s_hdr->u.oth; |
337 | } | 337 | } |
338 | if (wqe->wr.opcode == IB_WR_SEND_WITH_IMM) { | 338 | if (wqe->wr.opcode == IB_WR_SEND_WITH_IMM) { |
339 | qp->s_hdrwords++; | 339 | qp->s_hdrwords++; |
@@ -346,15 +346,15 @@ int qib_make_ud_req(struct qib_qp *qp) | |||
346 | lrh0 |= 0xF000; /* Set VL (see ch. 13.5.3.1) */ | 346 | lrh0 |= 0xF000; /* Set VL (see ch. 13.5.3.1) */ |
347 | else | 347 | else |
348 | lrh0 |= ibp->sl_to_vl[ah_attr->sl] << 12; | 348 | lrh0 |= ibp->sl_to_vl[ah_attr->sl] << 12; |
349 | qp->s_hdr.lrh[0] = cpu_to_be16(lrh0); | 349 | qp->s_hdr->lrh[0] = cpu_to_be16(lrh0); |
350 | qp->s_hdr.lrh[1] = cpu_to_be16(ah_attr->dlid); /* DEST LID */ | 350 | qp->s_hdr->lrh[1] = cpu_to_be16(ah_attr->dlid); /* DEST LID */ |
351 | qp->s_hdr.lrh[2] = cpu_to_be16(qp->s_hdrwords + nwords + SIZE_OF_CRC); | 351 | qp->s_hdr->lrh[2] = cpu_to_be16(qp->s_hdrwords + nwords + SIZE_OF_CRC); |
352 | lid = ppd->lid; | 352 | lid = ppd->lid; |
353 | if (lid) { | 353 | if (lid) { |
354 | lid |= ah_attr->src_path_bits & ((1 << ppd->lmc) - 1); | 354 | lid |= ah_attr->src_path_bits & ((1 << ppd->lmc) - 1); |
355 | qp->s_hdr.lrh[3] = cpu_to_be16(lid); | 355 | qp->s_hdr->lrh[3] = cpu_to_be16(lid); |
356 | } else | 356 | } else |
357 | qp->s_hdr.lrh[3] = IB_LID_PERMISSIVE; | 357 | qp->s_hdr->lrh[3] = IB_LID_PERMISSIVE; |
358 | if (wqe->wr.send_flags & IB_SEND_SOLICITED) | 358 | if (wqe->wr.send_flags & IB_SEND_SOLICITED) |
359 | bth0 |= IB_BTH_SOLICITED; | 359 | bth0 |= IB_BTH_SOLICITED; |
360 | bth0 |= extra_bytes << 20; | 360 | bth0 |= extra_bytes << 20; |
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 | ||
368 | struct qib_rq { | 368 | struct 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 | ||
375 | struct qib_srq { | 376 | struct qib_srq { |
@@ -412,31 +413,75 @@ struct qib_ack_entry { | |||
412 | */ | 413 | */ |
413 | struct qib_qp { | 414 | struct 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 | /* |