RDMA/hfi1,qib,rdmavt: Second round of fixes for 4.8
Subsystems (4)
cover RDMA/hfi1,qib,rdmavt: Second round of fixes for 4.8
Doug,
Here are the next set of fixes for 4.8. There is one marked as stable but it should filter through the process and require no special handling. This is mostly bug fixes but there are some clean ups as well.
This does bring in a new feature, that is to support fast register memory region (FRMR) in rdmavt and hfi1.
Patches can also be viewed in my repo at:
https://github.com/ddalessa/kernel/tree/for-4.8
---
Dasaratharaman Chandramouli (5):
IB/hfi1: Remove unused elements from struct ahg_ib_header IB/hfi1: Rename struct ahg_ib_header to struct hfi1_ahg_info IB/hfi1: Cleanup UD packet handler.
IB/hfi1: Use hdr2sc function to calculate 5-bit SC IB/qib, IB/hfi1: Fix grh creation in ud loopback
Dean Luick (3):
IB/hfi1: Explain state complete frame details IB/hfi1: Read all firmware versions IB/hfi1: Add static PCIe Gen3 CTLE tuning
Don Hiatt (1):
IB/hfi1: Rename hfi1_pio_header to hfi1_sdma_header.
Easwar Hariharan (3):
IB/hfi1: Disable external device configuration requests IB/hfi1: Ignore QSFP interrupts until power stabilizes IB/hfi1: Reset QSFP on every run through channel tuning
Grzegorz Heldt (1):
IB/hfi1: Fix trace message units
Harish Chegondi (1):
IB/hfi1: Modify the default number of kernel receive conexts
Jakub Pawlak (1):
IB/hfi1: Fix integrity errors counter value calculation
Jianxin Xiong (9):
IB/rdmavt: Add support for ib_map_mr_sg
IB/rdmavt: Add mechanism to invalidate MR keys IB/rdmavt: Handle local operations in post send
IB/hfi1: Handle send with invalidate opcode in the RC recv path IB/hfi1: Work request processing for fast register mr and invalidate IB/hfi1: Add support for extended memory management IB/rdmavt: Add missing spin_lock_init call for rdi->n_cqs_lock IB/hfi1: Fix "suspicious rcu_dereference_check() usage" warnings IB/rdmavt,hfi1: Fix NFSoRDMA failure with FRMR enabled
Mike Marciniszyn (1):
IB/hfi1: Add the capability for reserved operations
Mitko Haralanov (1):
IB/hfi1: Pull FECN/BECN processing to a common place
Tadeusz Struk (1):
IB/hfi1: Add sysfs entry to override SDMA interrupt affinity
Tymoteusz Kielan (1):
IB/hfi1: Fix to fully initialize send context area
drivers/infiniband/hw/hfi1/affinity.c | 68 ++++++++++ drivers/infiniband/hw/hfi1/affinity.h | 4 + drivers/infiniband/hw/hfi1/chip.c | 193 +++++++++++++++++++++------ drivers/infiniband/hw/hfi1/chip.h | 1 drivers/infiniband/hw/hfi1/chip_registers.h | 4 + drivers/infiniband/hw/hfi1/driver.c | 51 ++++--- drivers/infiniband/hw/hfi1/firmware.c | 125 +++++++++++++++++ drivers/infiniband/hw/hfi1/hfi.h | 36 ++++- drivers/infiniband/hw/hfi1/init.c | 15 +- drivers/infiniband/hw/hfi1/mad.c | 34 +---- drivers/infiniband/hw/hfi1/pcie.c | 68 +++++++++- drivers/infiniband/hw/hfi1/pio.c | 2 drivers/infiniband/hw/hfi1/platform.c | 20 +-- drivers/infiniband/hw/hfi1/qp.c | 24 +++ drivers/infiniband/hw/hfi1/qp.h | 2 drivers/infiniband/hw/hfi1/rc.c | 82 +++++++++-- drivers/infiniband/hw/hfi1/ruc.c | 57 ++++++-- drivers/infiniband/hw/hfi1/sysfs.c | 25 +++ drivers/infiniband/hw/hfi1/uc.c | 61 ++++----- drivers/infiniband/hw/hfi1/ud.c | 86 ++++-------- drivers/infiniband/hw/hfi1/verbs.c | 42 +++--- drivers/infiniband/hw/hfi1/verbs.h | 8 - drivers/infiniband/hw/hfi1/verbs_txreq.h | 2 drivers/infiniband/hw/qib/qib_ud.c | 8 + drivers/infiniband/sw/rdmavt/cq.c | 1 drivers/infiniband/sw/rdmavt/mr.c | 124 +++++++++++++++++ drivers/infiniband/sw/rdmavt/mr.h | 2 drivers/infiniband/sw/rdmavt/qp.c | 146 +++++++++++++++++--- drivers/infiniband/sw/rdmavt/vt.c | 7 + include/rdma/rdma_vt.h | 4 + include/rdma/rdmavt_mr.h | 1 include/rdma/rdmavt_qp.h | 54 ++++++++ 32 files changed, 1039 insertions(+), 318 deletions(-)
--
-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160725203554.4800.37248.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org
PATCH 1/28 IB/hfi1: Fix integrity errors counter value calculation
From: Jakub Pawlak <[email protected]>
PMA should not sum TX and RX replay counts when reporting local link integrity errors. Fixed by removing C_DC_TX_REPLAY counter from calculation of the link integrity errors counter value.
--- drivers/infiniband/hw/hfi1/mad.c | 32 +++++++++----------------------- 1 files changed, 9 insertions(+), 23 deletions(-)
drivers/infiniband/hw/hfi1/mad.c +9 -23
@@ -2418,14 +2418,9 @@ static int pma_get_opa_portstatus(struct opa_pma_mad *pmp, rsp->port_rcv_remote_physical_errors =cpu_to_be64 (read_dev_cntr (dd,C_DC_RMT_PHY_ERR ,CNTR_INVALID_VL )); - tmp =read_dev_cntr (dd,C_DC_RX_REPLAY ,CNTR_INVALID_VL ); - tmp2 = tmp +read_dev_cntr (dd,C_DC_TX_REPLAY ,CNTR_INVALID_VL ); -if (tmp2 < tmp) { -/* overflow/wrapped */ - rsp->local_link_integrity_errors =cpu_to_be64 (~0 ); - }else { - rsp->local_link_integrity_errors =cpu_to_be64 (tmp2); - } + rsp->local_link_integrity_errors = +cpu_to_be64 (read_dev_cntr (dd,C_DC_RX_REPLAY , +CNTR_INVALID_VL )); tmp =read_dev_cntr (dd,C_DC_SEQ_CRC_CNT ,CNTR_INVALID_VL ); tmp2 = tmp +read_dev_cntr (dd,C_DC_REINIT_FROM_PEER_CNT ,CNTR_INVALID_VL );
@@ -2520,9 +2515,8 @@ static u64 get_error_counter_summary(struct ib_device *ibdev, u8 port, error_counter_summary +=read_dev_cntr (dd,C_DC_RMT_PHY_ERR ,CNTR_INVALID_VL );/* local link integrity must be right-shifted by the lli resolution */ - tmp =read_dev_cntr (dd,C_DC_RX_REPLAY ,CNTR_INVALID_VL ); - tmp +=read_dev_cntr (dd,C_DC_TX_REPLAY ,CNTR_INVALID_VL ); - error_counter_summary += (tmp >> res_lli); + error_counter_summary += (read_dev_cntr (dd,C_DC_RX_REPLAY , +CNTR_INVALID_VL ) >> res_lli);/* link error recovery must b right-shifted by the ler resolution */ tmp =read_dev_cntr (dd,C_DC_SEQ_CRC_CNT ,CNTR_INVALID_VL ); tmp +=read_dev_cntr (dd,C_DC_REINIT_FROM_PEER_CNT ,CNTR_INVALID_VL );
@@ -2791,14 +2785,9 @@ static void pma_get_opa_port_ectrs(struct ib_device *ibdev, rsp->port_rcv_constraint_errors =cpu_to_be64 (read_port_cntr (ppd,C_SW_RCV_CSTR_ERR ,CNTR_INVALID_VL )); - tmp =read_dev_cntr (dd,C_DC_RX_REPLAY ,CNTR_INVALID_VL ); - tmp2 = tmp +read_dev_cntr (dd,C_DC_TX_REPLAY ,CNTR_INVALID_VL ); -if (tmp2 < tmp) { -/* overflow/wrapped */ - rsp->local_link_integrity_errors =cpu_to_be64 (~0 ); - }else { - rsp->local_link_integrity_errors =cpu_to_be64 (tmp2); - } + rsp->local_link_integrity_errors = +cpu_to_be64 (read_dev_cntr (dd,C_DC_RX_REPLAY , +CNTR_INVALID_VL )); rsp->excessive_buffer_overruns =cpu_to_be64 (read_dev_cntr (dd,C_RCV_OVF ,CNTR_INVALID_VL )); }
@@ -3156,10 +3145,8 @@ static int pma_set_opa_portstatus(struct opa_pma_mad *pmp,if (counter_select &CS_PORT_RCV_REMOTE_PHYSICAL_ERRORS )write_dev_cntr (dd,C_DC_RMT_PHY_ERR ,CNTR_INVALID_VL ,0 ); -if (counter_select &CS_LOCAL_LINK_INTEGRITY_ERRORS ) { -write_dev_cntr (dd,C_DC_TX_REPLAY ,CNTR_INVALID_VL ,0 ); +if (counter_select &CS_LOCAL_LINK_INTEGRITY_ERRORS )write_dev_cntr (dd,C_DC_RX_REPLAY ,CNTR_INVALID_VL ,0 ); - }if (counter_select &CS_LINK_ERROR_RECOVERY ) {write_dev_cntr (dd,C_DC_SEQ_CRC_CNT ,CNTR_INVALID_VL ,0 );
@@ -3956,7 +3943,6 @@ void clear_linkup_counters(struct hfi1_devdata *dd)write_dev_cntr (dd,C_DC_SEQ_CRC_CNT ,CNTR_INVALID_VL ,0 );write_dev_cntr (dd,C_DC_REINIT_FROM_PEER_CNT ,CNTR_INVALID_VL ,0 );/* LocalLinkIntegrityErrors */ -write_dev_cntr (dd,C_DC_TX_REPLAY ,CNTR_INVALID_VL ,0 );write_dev_cntr (dd,C_DC_RX_REPLAY ,CNTR_INVALID_VL ,0 );/* ExcessiveBufferOverruns */ write_dev_cntr (dd,C_RCV_OVF ,CNTR_INVALID_VL ,0 );
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/28 IB/hfi1: Fix to fully initialize send context area
In reply to a message not in the archiveFrom: Tymoteusz Kielan <[email protected]>
While handling buffer control MAD, partially initialized dd->kernel_send_context area may cause potential dereference of uninitialized pointers. Fix by using kzalloc_node() instead of kmalloc_node().
--- drivers/infiniband/hw/hfi1/pio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/infiniband/hw/hfi1/pio.c +1 -1
@@ -1956,7 +1956,7 @@ int init_pervl_scs(struct hfi1_devdata *dd)hfi1_init_ctxt (dd->vld[15 ].sc); dd->vld[15 ].mtu =enum_to_mtu (OPA_MTU_2048 ); - dd->kernel_send_context =kmalloc_node (dd->num_send_contexts * + dd->kernel_send_context =kzalloc_node (dd->num_send_contexts *sizeof (struct send_context *),GFP_KERNEL , dd->node); dd->kernel_send_context[0 ] = dd->vld[15 ].sc;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160725203759.4800.2358.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org
Re: [PATCH 02/28] IB/hfi1: Fix to fully initialize send context area
Quoted 22 lines · Dennis Dalessandro
From: Tymoteusz Kielan <[email protected]>
While handling buffer control MAD, partially initialized
dd->kernel_send_contextarea may cause potential dereference of uninitialized pointers. Fix by usingkzalloc_node()instead ofkmalloc_node().Reviewed-by Mike Marciniszyn <[email protected]>Reviewed-by Dennis Dalessandro <[email protected]>Reviewed-by Andrzej Kacprowski <[email protected]>Signed-off-by Tymoteusz Kielan <[email protected]>Signed-off-by Andrzej Kacprowski <[email protected]>Signed-off-by Dennis Dalessandro <[email protected]>--- drivers/infiniband/hw/hfi1/pio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/infiniband/hw/hfi1/pio.c +0
-0
drivers/infiniband/hw/hfi1/pio.c int init_pervl_scs(struct hfi1_devdata *dd) · line 1961
Quoted 7 lines
drivers/infiniband/hw/hfi1/pio.c +1
-1@@ -1956,7 +1956,7 @@ int init_pervl_scs(struct hfi1_devdata *dd)hfi1_init_ctxt (dd->vld[15 ].sc); dd->vld[15 ].mtu =enum_to_mtu (OPA_MTU_2048 ); - dd->kernel_send_context =kmalloc_node (dd->num_send_contexts * + dd->kernel_send_context =kzalloc_node (dd->num_send_contexts *sizeof (struct send_context *),GFP_KERNEL , dd->node);
Dennis,
Don't you want to check kzalloc_node execution success prior to use dd->kernel_send_context?
Quoted 6 lines
drivers/infiniband/hw/hfi1/pio.c +0
-1dd->kernel_send_context[0 ] = dd->vld[15 ].sc; --To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160726052657.GD20674-2ukJVAZIZ/[email protected]
Re: [PATCH 02/28] IB/hfi1: Fix to fully initialize send context area
T24gVHVlLCAyMDE2LTA3LTI2IGF0IDA4OjI2ICswMzAwLCBMZW9uIFJvbWFub3Zza3kgd3JvdGU6 DQo+IERlbm5pcywNCj4gRG9uJ3QgeW91IHdhbnQgdG8gY2hlY2sga3phbGxvY19ub2RlIGV4ZWN1 dGlvbiBzdWNjZXNzDQo+IHByaW9yIHRvIHVzZSBkZC0+a2VybmVsX3NlbmRfY29udGV4dD8NCj4g DQo+ID4gwqAJZGQtPmtlcm5lbF9zZW5kX2NvbnRleHRbMF0gPSBkZC0+dmxkWzE1XS5zYzsNCg0K VGhhbmtzIGZvciBjYXRjaGluZyB0aGF0IExlb24uIFdlJ2xsIHNlbmQgYSBmaXggc29vbi4NCg0K LURlbm55DQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/28] IB/hfi1: Fix to fully initialize send context area
In reply to a message not in the archiveQuoted 4 lines · Leon Romanovsky
Quoted 3 lines · Dennis Dalessandro
From: Tymoteusz Kielan <[email protected]>
Quoted 8 lines
drivers/infiniband/hw/hfi1/pio.c int init_pervl_scs(struct hfi1_devdata *dd) · line 1961
Quoted 4 lines
drivers/infiniband/hw/hfi1/pio.c +1
-1- dd->kernel_send_context =kmalloc_node (dd->num_send_contexts * + dd->kernel_send_context =kzalloc_node (dd->num_send_contexts *sizeof (struct send_context *),GFP_KERNEL , dd->node);Dennis,
Don't you want to checkkzalloc_nodeexecution success prior to usedd->kernel_send_context?
Again thanks for catching this. Follow on fix was sent which depends on this patch.
Thanks,
Ira
Quoted 7 lines
Quoted 7 lines
dd->kernel_send_context[0] = dd->vld[15].sc;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160728163209.GA28030-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org
Re: [PATCH 02/28] IB/hfi1: Fix to fully initialize send context area
Quoted 14 lines · ira.weiny
Quoted 4 lines · Leon Romanovsky
Quoted 3 lines · Dennis Dalessandro
From: Tymoteusz Kielan <[email protected]>
Quoted 8 lines
drivers/infiniband/hw/hfi1/pio.c int init_pervl_scs(struct hfi1_devdata *dd) · line 1961
Quoted 4 lines
drivers/infiniband/hw/hfi1/pio.c +1
-1- dd->kernel_send_context =kmalloc_node (dd->num_send_contexts * + dd->kernel_send_context =kzalloc_node (dd->num_send_contexts *sizeof (struct send_context *),GFP_KERNEL , dd->node);Dennis,
Don't you want to checkkzalloc_nodeexecution success prior to usedd->kernel_send_context?
Quoted 2 lines
Again thanks for catching this. Follow on fix was sent which depends on this patch.
No problem.
Quoted 17 lines
Thanks,
IraQuoted 7 lines
Quoted 7 lines
dd->kernel_send_context[0] = dd->vld[15].sc;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/28 IB/hfi1: Pull FECN/BECN processing to a common place
In reply to a message not in the archiveFrom: Mitko Haralanov <[email protected]>
There were multiple places where FECN/BECN processing was being done for the different types of QPs. All of that code was very similar, which meant that it could be pulled into a single function used by the different QP types.
To retain the performance in the fastpath, the common code starts with an inline function, which only calls the slow path if the packet has any of the [FB]ECN bits set.
--- drivers/infiniband/hw/hfi1/driver.c | 47 +++++++++++++++++++---------------- drivers/infiniband/hw/hfi1/hfi.h | 16 ++++++++++++ drivers/infiniband/hw/hfi1/rc.c | 19 +------------- drivers/infiniband/hw/hfi1/uc.c | 36 +-------------------------- drivers/infiniband/hw/hfi1/ud.c | 24 +----------------- 5 files changed, 45 insertions(+), 97 deletions(-)
drivers/infiniband/hw/hfi1/driver.c +26 -21
@@ -450,14 +450,20 @@ static inline void init_packet(struct hfi1_ctxtdata *rcd, packet->rcv_flags =0 ; } -static void process_ecn (struct rvt_qp *qp,struct hfi1_ib_header *hdr, -struct hfi1_other_headers *ohdr, -u64 rhf,u32 bth1,struct ib_grh *grh) +void hfi1_process_ecn_slowpath (struct rvt_qp *qp,struct hfi1_packet *pkt, +bool do_cnp) {struct hfi1_ibport *ibp =to_iport (qp->ibqp.device, qp->port_num); -u32 rqpn =0 ; -u16 rlid; -u8 sc5, svc_type; +struct hfi1_ib_header *hdr = pkt->hdr; +struct hfi1_other_headers *ohdr = pkt->ohdr; +struct ib_grh *grh =NULL ; +u32 rqpn =0 , bth1; +u16 rlid, dlid =be16_to_cpu (hdr->lrh[1 ]); +u8 sc, svc_type; +bool is_mcast = false; + +if (pkt->rcv_flags &HFI1_HAS_GRH ) + grh = &hdr->u.l.grh;switch (qp->ibqp.qp_type) {case IB_QPT_SMI :
@@ -466,6 +472,8 @@ static void process_ecn(struct rvt_qp *qp, struct hfi1_ib_header *hdr, rlid =be16_to_cpu (hdr->lrh[3 ]); rqpn =be32_to_cpu (ohdr->u.ud.deth[1 ]) &RVT_QPN_MASK ; svc_type =IB_CC_SVCTYPE_UD ; + is_mcast = (dlid >be16_to_cpu (IB_MULTICAST_LID_BASE )) && + (dlid !=be16_to_cpu (IB_LID_PERMISSIVE ));break ;case IB_QPT_UC : rlid = qp->remote_ah_attr.dlid;
@@ -481,24 +489,23 @@ static void process_ecn(struct rvt_qp *qp, struct hfi1_ib_header *hdr,return ; } - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; -if (rhf_dc_info (rhf)) - sc5 |=0x10 ; + sc =hdr2sc ((struct hfi1_message_header *)hdr, pkt->rhf); -if (bth1 &HFI1_FECN_SMASK ) { + bth1 =be32_to_cpu (ohdr->bth[1 ]); +if (do_cnp && (bth1 &HFI1_FECN_SMASK )) {u16 pkey = (u16 )be32_to_cpu (ohdr->bth[0 ]); -u16 dlid =be16_to_cpu (hdr->lrh[1 ]); -return_cnp (ibp, qp, rqpn, pkey, dlid, rlid, sc5, grh); +return_cnp (ibp, qp, rqpn, pkey, dlid, rlid, sc, grh); } -if (bth1 &HFI1_BECN_SMASK ) { +if (!is_mcast && (bth1 &HFI1_BECN_SMASK )) {struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);u32 lqpn = bth1 &RVT_QPN_MASK ; -u8 sl = ibp->sc_to_sl[sc5]; +u8 sl = ibp->sc_to_sl[sc];process_becn (ppd, sl, rlid, lqpn, rqpn, svc_type); } + }struct ps_mdata {
@@ -596,7 +603,6 @@ static void __prescan_rxq(struct hfi1_packet *packet)struct rvt_qp *qp;struct hfi1_ib_header *hdr;struct hfi1_other_headers *ohdr; -struct ib_grh *grh =NULL ;struct rvt_dev_info *rdi = &dd->verbs_dev.rdi;u64 rhf =rhf_to_cpu (rhf_addr);u32 etype =rhf_rcv_type (rhf), qpn, bth1;
@@ -616,14 +622,13 @@ static void __prescan_rxq(struct hfi1_packet *packet)hfi1_get_msgheader (dd, rhf_addr); lnh =be16_to_cpu (hdr->lrh[0 ]) &3 ; -if (lnh ==HFI1_LRH_BTH ) { +if (lnh ==HFI1_LRH_BTH ) ohdr = &hdr->u.oth; - }else if (lnh ==HFI1_LRH_GRH ) { +else if (lnh ==HFI1_LRH_GRH ) ohdr = &hdr->u.l.oth; - grh = &hdr->u.l.grh; - }else { +else goto next;/* just in case */ - } + bth1 =be32_to_cpu (ohdr->bth[1 ]); is_ecn = !!(bth1 & (HFI1_FECN_SMASK |HFI1_BECN_SMASK ));
@@ -639,7 +644,7 @@ static void __prescan_rxq(struct hfi1_packet *packet) goto next; } -process_ecn (qp, hdr, ohdr, rhf, bth1, grh); +process_ecn (qp, packet, true);rcu_read_unlock ();/* turn off BECN, FECN */
drivers/infiniband/hw/hfi1/hfi.h +16 -0
@@ -1583,6 +1583,22 @@ static inline struct hfi1_ibport *to_iport(struct ib_device *ibdev, u8 port)return &dd->pport[pidx].ibport_data; } +void hfi1_process_ecn_slowpath (struct rvt_qp *qp,struct hfi1_packet *pkt, +bool do_cnp); +static inline bool process_ecn (struct rvt_qp *qp,struct hfi1_packet *pkt, +bool do_cnp) +{ +struct hfi1_other_headers *ohdr = pkt->ohdr; +u32 bth1; + + bth1 =be32_to_cpu (ohdr->bth[1 ]); +if (unlikely (bth1 & (HFI1_BECN_SMASK |HFI1_FECN_SMASK ))) { +hfi1_process_ecn_slowpath (qp, pkt, do_cnp); +return bth1 &HFI1_FECN_SMASK ; + } +return false; +} +/* * Return the indexed PKEY from the port PKEY table. */
drivers/infiniband/hw/hfi1/rc.c +1 -18
@@ -2086,7 +2086,6 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)u32 tlen = packet->tlen;struct rvt_qp *qp = packet->qp;struct hfi1_ibport *ibp =to_iport (qp->ibqp.device, qp->port_num); -struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);struct hfi1_other_headers *ohdr = packet->ohdr;u32 bth0, opcode;u32 hdrsize = packet->hlen;
@@ -2097,7 +2096,6 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)int diff;struct ib_reth *reth;unsigned long flags; -u32 bth1;int ret, is_fecn =0 ;int copy_last =0 ;
@@ -2105,22 +2103,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)if (hfi1_ruc_check_hdr (ibp, hdr, rcv_flags &HFI1_HAS_GRH , qp, bth0))return ; - bth1 =be32_to_cpu (ohdr->bth[1 ]); -if (unlikely (bth1 & (HFI1_BECN_SMASK |HFI1_FECN_SMASK ))) { -if (bth1 &HFI1_BECN_SMASK ) { -u16 rlid = qp->remote_ah_attr.dlid; -u32 lqpn, rqpn; - - lqpn = qp->ibqp.qp_num; - rqpn = qp->remote_qpn; -process_becn ( - ppd, - qp->remote_ah_attr.sl, - rlid, lqpn, rqpn, -IB_CC_SVCTYPE_RC ); - } - is_fecn = bth1 &HFI1_FECN_SMASK ; - } + is_fecn =process_ecn (qp, packet, false); psn =be32_to_cpu (ohdr->bth[2 ]); opcode = (bth0 >>24 ) &0xff ;
drivers/infiniband/hw/hfi1/uc.c +1 -35
@@ -294,46 +294,12 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)struct ib_reth *reth;int has_grh = rcv_flags &HFI1_HAS_GRH ;int ret; -u32 bth1; bth0 =be32_to_cpu (ohdr->bth[0 ]);if (hfi1_ruc_check_hdr (ibp, hdr, has_grh, qp, bth0))return ; - bth1 =be32_to_cpu (ohdr->bth[1 ]); -if (unlikely (bth1 & (HFI1_BECN_SMASK |HFI1_FECN_SMASK ))) { -if (bth1 &HFI1_BECN_SMASK ) { -struct hfi1_pportdata *ppd =ppd_from_ibp (ibp); -u32 rqpn, lqpn; -u16 rlid =be16_to_cpu (hdr->lrh[3 ]); -u8 sl, sc5; - - lqpn = bth1 &RVT_QPN_MASK ; - rqpn = qp->remote_qpn; - - sc5 = ibp->sl_to_sc[qp->remote_ah_attr.sl]; - sl = ibp->sc_to_sl[sc5]; - -process_becn (ppd, sl, rlid, lqpn, rqpn, -IB_CC_SVCTYPE_UC ); - } - -if (bth1 &HFI1_FECN_SMASK ) { -struct ib_grh *grh =NULL ; -u16 pkey = (u16 )be32_to_cpu (ohdr->bth[0 ]); -u16 slid =be16_to_cpu (hdr->lrh[3 ]); -u16 dlid =be16_to_cpu (hdr->lrh[1 ]); -u32 src_qp = qp->remote_qpn; -u8 sc5; - - sc5 = ibp->sl_to_sc[qp->remote_ah_attr.sl]; -if (has_grh) - grh = &hdr->u.l.grh; - -return_cnp (ibp, qp, src_qp, pkey, dlid, slid, sc5, - grh); - } - } +process_ecn (qp, packet, true); psn =be32_to_cpu (ohdr->bth[2 ]); opcode = (bth0 >>24 ) &0xff ;
drivers/infiniband/hw/hfi1/ud.c +1 -23
@@ -679,29 +679,10 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)struct rvt_qp *qp = packet->qp;bool has_grh = rcv_flags &HFI1_HAS_GRH ;u8 sc5 =hdr2sc ((struct hfi1_message_header *)hdr, packet->rhf); -u32 bth1; -int is_mcast; -struct ib_grh *grh =NULL ; qkey =be32_to_cpu (ohdr->u.ud.deth[0 ]); src_qp =be32_to_cpu (ohdr->u.ud.deth[1 ]) &RVT_QPN_MASK ; dlid =be16_to_cpu (hdr->lrh[1 ]); - is_mcast = (dlid >be16_to_cpu (IB_MULTICAST_LID_BASE )) && - (dlid !=be16_to_cpu (IB_LID_PERMISSIVE )); - bth1 =be32_to_cpu (ohdr->bth[1 ]); -if (unlikely (bth1 &HFI1_BECN_SMASK )) { -/* -* In pre-B0 h/w the CNP_OPCODE is handled via an -* error path. -*/ -struct hfi1_pportdata *ppd =ppd_from_ibp (ibp); -u32 lqpn =be32_to_cpu (ohdr->bth[1 ]) &RVT_QPN_MASK ; -u8 sl; - - sl = ibp->sc_to_sl[sc5]; - -process_becn (ppd, sl,0 , lqpn,0 ,IB_CC_SVCTYPE_UD ); - }/* * The opcode is in the low byte when its in network order
@@ -712,11 +693,8 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) pkey = (u16 )be32_to_cpu (ohdr->bth[0 ]); -if (!is_mcast && (opcode !=IB_OPCODE_CNP ) && bth1 &HFI1_FECN_SMASK ) { -u16 slid =be16_to_cpu (hdr->lrh[3 ]); +process_ecn (qp, packet, (opcode !=IB_OPCODE_CNP )); -return_cnp (ibp, qp, src_qp, pkey, dlid, slid, sc5, grh); - }/* * Get the number of bytes the message was padded by * and drop incomplete packets.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/28 IB/rdmavt: Add support for ib_map_mr_sg
In reply to a message not in the archiveFrom: Jianxin Xiong <[email protected]>
This implements the device specific function needed by the verbs API function ib_map_mr_sg().
--- drivers/infiniband/sw/rdmavt/mr.c | 51 +++++++++++++++++++++++++++++++++++++ drivers/infiniband/sw/rdmavt/mr.h | 2 + drivers/infiniband/sw/rdmavt/vt.c | 7 +++++ 3 files changed, 60 insertions(+), 0 deletions(-)
drivers/infiniband/sw/rdmavt/mr.c +51 -0
@@ -480,6 +480,57 @@ struct ib_mr *rvt_alloc_mr(struct ib_pd *pd, }/** +* rvt_set_page - page assignment function called by ib_sg_to_pages +* @ibmr: memory region +* @addr: dma address of mapped page +* +* Return: 0 on success +*/ +static int rvt_set_page (struct ib_mr *ibmr,u64 addr) +{ +struct rvt_mr *mr =to_imr (ibmr); +u32 ps =1 << mr->mr.page_shift; +u32 mapped_segs = mr->mr.length >> mr->mr.page_shift; +int m, n; + +if (unlikely (mapped_segs == mr->mr.max_segs)) +return -ENOMEM ; + +if (mr->mr.length ==0 ) { + mr->mr.user_base = addr; + mr->mr.iova = addr; + } + + m = mapped_segs /RVT_SEGSZ ; + n = mapped_segs %RVT_SEGSZ ; + mr->mr.map[m]->segs[n].vaddr = (void *)addr; + mr->mr.map[m]->segs[n].length = ps; + mr->mr.length += ps; + +return 0 ; +} + +/** +* rvt_map_mr_sg - map sg list and set it the memory region +* @ibmr: memory region +* @sg: dma mapped scatterlist +* @sg_nents: number of entries in sg +* @sg_offset: offset in bytes into sg +* +* Return: number of sg elements mapped to the memory region +*/ +int rvt_map_mr_sg (struct ib_mr *ibmr,struct scatterlist *sg, +int sg_nents,unsigned int *sg_offset) +{ +struct rvt_mr *mr =to_imr (ibmr); + + mr->mr.length =0 ; + mr->mr.page_shift =PAGE_SHIFT ; +return ib_sg_to_pages (ibmr, sg, sg_nents, sg_offset, + rvt_set_page); +} + +/** * rvt_alloc_fmr - allocate a fast memory region * @pd: the protection domain for this memory region * @mr_access_flags: access flags for this memory region
drivers/infiniband/sw/rdmavt/mr.h +2 -0
@@ -82,6 +82,8 @@ int rvt_dereg_mr(struct ib_mr *ibmr);struct ib_mr *rvt_alloc_mr (struct ib_pd *pd,enum ib_mr_type mr_type,u32 max_num_sg); +int rvt_map_mr_sg (struct ib_mr *ibmr,struct scatterlist *sg, +int sg_nents,unsigned int *sg_offset);struct ib_fmr *rvt_alloc_fmr (struct ib_pd *pd,int mr_access_flags,struct ib_fmr_attr *fmr_attr); int rvt_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list,
drivers/infiniband/sw/rdmavt/vt.c +7 -0
@@ -370,6 +370,7 @@ enum {REG_USER_MR ,DEREG_MR ,ALLOC_MR , +MAP_MR_SG ,ALLOC_FMR ,MAP_PHYS_FMR , UNMAP_FMR,
@@ -634,6 +635,12 @@ static noinline int check_support(struct rvt_dev_info *rdi, int verb) rvt_alloc_mr);break ; +case MAP_MR_SG : +check_driver_override (rdi, offsetof(struct ib_device , + map_mr_sg), + rvt_map_mr_sg); +break ; +case MAP_PHYS_FMR : check_driver_override(rdi, offsetof(struct ib_device, map_phys_fmr),
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/28 IB/rdmavt: Add mechanism to invalidate MR keys
In reply to a message not in the archiveFrom: Jianxin Xiong <[email protected]>
In order to support extended memory management, add the mechanism to invalidate MR keys. This includes a flag "lkey_invalid" in the MR data structure that is to be checked when validating access to the MR via the associated key, and two utility functions to perform fast memory registration and memory key invalidate operations.
--- drivers/infiniband/sw/rdmavt/mr.c | 73 ++++++++++++++++++++++++++++++++++++- include/rdma/rdma_vt.h | 3 ++ include/rdma/rdmavt_mr.h | 1 + 3 files changed, 75 insertions(+), 2 deletions(-)
drivers/infiniband/sw/rdmavt/mr.c +71 -2
@@ -140,6 +140,7 @@ static int rvt_init_mregion(struct rvt_mregion *mr, struct ib_pd *pd,init_completion (&mr->comp);/* count returning the ptr to user */ atomic_set (&mr->refcount,1 ); +atomic_set (&mr->lkey_invalid,0 ); mr->pd = pd; mr->max_segs = count;return 0 ;
@@ -531,6 +532,72 @@ int rvt_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, }/** +* rvt_fast_reg_mr - fast register physical MR +* @qp: the queue pair where the work request comes from +* @ibmr: the memory region to be registered +* @key: updated key for this memory region +* @access: access flags for this memory region +* +* Returns 0 on success. +*/ +int rvt_fast_reg_mr (struct rvt_qp *qp,struct ib_mr *ibmr,u32 key, +int access) +{ +struct rvt_mr *mr =to_imr (ibmr); + +if (qp->ibqp.pd != mr->mr.pd) +return -EACCES ; + +/* not applicable to dma MR or user MR */ +if (!mr->mr.lkey || mr->umem) +return -EINVAL ; + +if ((key &0xFFFFFF00 ) != (mr->mr.lkey &0xFFFFFF00 )) +return -EINVAL ; + + ibmr->lkey = key; + ibmr->rkey = key; + mr->mr.lkey = key; + mr->mr.access_flags = access; +atomic_set (&mr->mr.lkey_invalid,0 ); + +return 0 ; +} +EXPORT_SYMBOL (rvt_fast_reg_mr); + +/** +* rvt_invalidate_rkey - invalidate an MR rkey +* @qp: queue pair associated with the invalidate op +* @rkey: rkey to invalidate +* +* Returns 0 on success. +*/ +int rvt_invalidate_rkey (struct rvt_qp *qp,u32 rkey) +{ +struct rvt_dev_info *dev =ib_to_rvt (qp->ibqp.device); +struct rvt_lkey_table *rkt = &dev->lkey_table; +struct rvt_mregion *mr; + +if (rkey ==0 ) +return -EINVAL ; + +rcu_read_lock (); + mr =rcu_dereference ( + rkt->table[(rkey >> (32 - dev->dparms.lkey_table_size))]); +if (unlikely (!mr || mr->lkey != rkey || qp->ibqp.pd != mr->pd)) + goto bail; + +atomic_set (&mr->lkey_invalid,1 ); +rcu_read_unlock (); +return 0 ; + +bail: +rcu_read_unlock (); +return -EINVAL ; +} +EXPORT_SYMBOL (rvt_invalidate_rkey); + +/** * rvt_alloc_fmr - allocate a fast memory region * @pd: the protection domain for this memory region * @mr_access_flags: access flags for this memory region
@@ -733,7 +800,8 @@ int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd, } mr =rcu_dereference ( rkt->table[(sge->lkey >> (32 - dev->dparms.lkey_table_size))]); -if (unlikely (!mr || mr->lkey != sge->lkey || mr->pd != &pd->ibpd)) +if (unlikely (!mr ||atomic_read (&mr->lkey_invalid) || + mr->lkey != sge->lkey || mr->pd != &pd->ibpd)) goto bail; off = sge->addr - mr->user_base;
@@ -833,7 +901,8 @@ int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge, mr =rcu_dereference ( rkt->table[(rkey >> (32 - dev->dparms.lkey_table_size))]); -if (unlikely (!mr || mr->lkey != rkey || qp->ibqp.pd != mr->pd)) +if (unlikely (!mr ||atomic_read (&mr->lkey_invalid) || + mr->lkey != rkey || qp->ibqp.pd != mr->pd)) goto bail; off = vaddr - mr->iova;
include/rdma/rdma_vt.h +3 -0
@@ -487,6 +487,9 @@ void rvt_unregister_device(struct rvt_dev_info *rvd);int rvt_check_ah (struct ib_device *ibdev,struct ib_ah_attr *ah_attr);int rvt_init_port (struct rvt_dev_info *rdi,struct rvt_ibport *port,int port_index,u16 *pkey_table); +int rvt_fast_reg_mr (struct rvt_qp *qp,struct ib_mr *ibmr,u32 key, +int access); +int rvt_invalidate_rkey (struct rvt_qp *qp,u32 rkey);int rvt_rkey_ok (struct rvt_qp *qp,struct rvt_sge *sge,u32 len,u64 vaddr,u32 rkey,int acc); int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,
include/rdma/rdmavt_mr.h +1 -0
@@ -81,6 +81,7 @@ struct rvt_mregion {u32 mapsz;/* size of the map array */ u8 page_shift;/* 0 - non unform/non powerof2 sizes */ u8 lkey_published;/* in global table */ +atomic_t lkey_invalid;/* true if current lkey is invalid */ struct completion comp;/* complete when refcount goes to zero */ atomic_t refcount;struct rvt_segarray *map[0 ];/* the segments */
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/28 IB/rdmavt: Handle local operations in post send
In reply to a message not in the archiveFrom: Jianxin Xiong <[email protected]>
Some work requests are local operations, such as IB_WR_REG_MR and IB_WR_LOCAL_INV. They differ from non-local operations in that:
(1) Local operations can be processed immediately without being posted to the send queue if neither fencing nor completion generation is needed. However, to ensure correct ordering, once a local operation is posted to the work queue due to fencing or completion requiement, all subsequent local operations must also be posted to the work queue until all the local operations on the work queue have completed.
(2) Local operations don't send packets over the wire and thus don't need (and shouldn't update) the packet sequence numbers.
Define a new a flag bit for the post send table to identify local operations.
Add a new field to the QP structure to track the number of local operations on the send queue to determine if direct processing of new local operations should be enabled/disabled.
--- drivers/infiniband/sw/rdmavt/qp.c | 45 +++++++++++++++++++++++++++++++++---- include/rdma/rdmavt_qp.h | 3 ++ 2 files changed, 43 insertions(+), 5 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +40 -5
@@ -743,6 +743,7 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,spin_lock_init (&qp->s_lock);spin_lock_init (&qp->r_rq.lock);atomic_set (&qp->refcount,0 ); +atomic_set (&qp->local_ops_pending,0 );init_waitqueue_head (&qp->wait);init_timer (&qp->s_timer); qp->s_timer.data = (unsigned long )qp;
@@ -1548,6 +1549,31 @@ static int rvt_post_one_wr(struct rvt_qp *qp,return ret; cplen = ret; +/* +* Local operations including fast register and local invalidate +* can be processed immediately w/o being posted to the send queue +* if neither fencing nor completion generation is needed. However, +* once fencing or completion is requested, direct processing of +* following local operations must be disabled until all the local +* operations posted to the send queue have completed. This is +* necessary to ensure the correct ordering. +*/ +if ((rdi->post_parms[wr->opcode].flags &RVT_OPERATION_LOCAL ) && + !(wr->send_flags & (IB_SEND_FENCE |IB_SEND_SIGNALED )) && + !atomic_read (&qp->local_ops_pending)) { +struct ib_reg_wr *reg =reg_wr (wr); + +switch (wr->opcode) { +case IB_WR_REG_MR : +return rvt_fast_reg_mr (qp, reg->mr, reg->key, + reg->access); +case IB_WR_LOCAL_INV : +return rvt_invalidate_rkey (qp, wr->ex.invalidate_rkey); +default : +return -EINVAL ; + } + } +/* check for avail */ if (unlikely (!qp->s_avail)) { qp->s_avail =qp_get_savail (qp);
@@ -1612,11 +1638,20 @@ static int rvt_post_one_wr(struct rvt_qp *qp,atomic_inc (&ibah_to_rvtah (ud_wr (wr)->ah)->refcount); } - wqe->ssn = qp->s_ssn++; - wqe->psn = qp->s_next_psn; - wqe->lpsn = wqe->psn + - (wqe->length ? ((wqe->length -1 ) >> log_pmtu) :0 ); - qp->s_next_psn = wqe->lpsn +1 ; +if (rdi->post_parms[wr->opcode].flags &RVT_OPERATION_LOCAL ) { +atomic_inc (&qp->local_ops_pending); + wqe->ssn =0 ; + wqe->psn =0 ; + wqe->lpsn =0 ; + }else { + wqe->ssn = qp->s_ssn++; + wqe->psn = qp->s_next_psn; + wqe->lpsn = wqe->psn + + (wqe->length ? + ((wqe->length -1 ) >> log_pmtu) : +0 ); + qp->s_next_psn = wqe->lpsn +1 ; + }trace_rvt_post_one_wr (qp, wqe);smp_wmb ();/* see request builders */ qp->s_avail--;
include/rdma/rdmavt_qp.h +3 -0
@@ -231,6 +231,7 @@ struct rvt_ack_entry {#define RVT_OPERATION_PRIV 0x00000001#define RVT_OPERATION_ATOMIC 0x00000002#define RVT_OPERATION_ATOMIC_SGE 0x00000004 +#define RVT_OPERATION_LOCAL 0x00000008#define RVT_OPERATION_MAX (IB_WR_RESERVED10 + 1)
@@ -363,6 +364,8 @@ struct rvt_qp {struct rvt_sge_state s_ack_rdma_sge;struct timer_list s_timer; +atomic_t local_ops_pending;/* number of fast_reg/local_inv reqs */ +/* * This sge list MUST be last. Do not add anything below here. */
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 7/28 IB/hfi1: Handle send with invalidate opcode in the RC recv path
In reply to a message not in the archiveFrom: Jianxin Xiong <[email protected]>
As part of enabling extended memory management support, add the processing of the RC send with invalidate.
--- drivers/infiniband/hw/hfi1/rc.c | 16 +++++++++++++++- drivers/infiniband/hw/hfi1/verbs.c | 2 ++ 2 files changed, 17 insertions(+), 1 deletions(-)
drivers/infiniband/hw/hfi1/rc.c +15 -1
@@ -2098,6 +2098,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)unsigned long flags;int ret, is_fecn =0 ;int copy_last =0 ; +u32 rkey; bth0 =be32_to_cpu (ohdr->bth[0 ]);if (hfi1_ruc_check_hdr (ibp, hdr, rcv_flags &HFI1_HAS_GRH , qp, bth0))
@@ -2137,7 +2138,8 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)case OP (SEND_MIDDLE ):if (opcode ==OP (SEND_MIDDLE ) || opcode ==OP (SEND_LAST ) || - opcode ==OP (SEND_LAST_WITH_IMMEDIATE )) + opcode ==OP (SEND_LAST_WITH_IMMEDIATE ) || + opcode ==OP (SEND_LAST_WITH_INVALIDATE ))break ; goto nack_inv;
@@ -2153,6 +2155,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)if (opcode ==OP (SEND_MIDDLE ) || opcode ==OP (SEND_LAST ) || opcode ==OP (SEND_LAST_WITH_IMMEDIATE ) || + opcode ==OP (SEND_LAST_WITH_INVALIDATE ) || opcode ==OP (RDMA_WRITE_MIDDLE ) || opcode ==OP (RDMA_WRITE_LAST ) || opcode ==OP (RDMA_WRITE_LAST_WITH_IMMEDIATE ))
@@ -2201,6 +2204,7 @@ send_middle:case OP (SEND_ONLY ):case OP (SEND_ONLY_WITH_IMMEDIATE ): +case OP (SEND_ONLY_WITH_INVALIDATE ): ret =hfi1_rvt_get_rwqe (qp,0 );if (ret <0 ) goto nack_op_err;
@@ -2209,12 +2213,22 @@ send_middle: qp->r_rcv_len =0 ;if (opcode ==OP (SEND_ONLY )) goto no_immediate_data; +if (opcode ==OP (SEND_ONLY_WITH_INVALIDATE )) + goto send_last_inv;/* FALLTHROUGH for SEND_ONLY_WITH_IMMEDIATE */ case OP (SEND_LAST_WITH_IMMEDIATE ): send_last_imm: wc.ex.imm_data = ohdr->u.imm_data; wc.wc_flags =IB_WC_WITH_IMM ; goto send_last; +case OP (SEND_LAST_WITH_INVALIDATE ): +send_last_inv: + rkey =be32_to_cpu (ohdr->u.ieth); +if (rvt_invalidate_rkey (qp, rkey)) + goto no_immediate_data; + wc.ex.invalidate_rkey = rkey; + wc.wc_flags =IB_WC_WITH_INVALIDATE ; + goto send_last;case OP (RDMA_WRITE_LAST ): copy_last =ibpd_to_rvtpd (qp->ibqp.pd)->user;/* fall through */
drivers/infiniband/hw/hfi1/verbs.c +2 -0
@@ -378,6 +378,8 @@ static const opcode_handler opcode_handler_tbl[256] = { [IB_OPCODE_RC_ATOMIC_ACKNOWLEDGE] = &hfi1_rc_rcv, [IB_OPCODE_RC_COMPARE_SWAP] = &hfi1_rc_rcv, [IB_OPCODE_RC_FETCH_ADD] = &hfi1_rc_rcv, + [IB_OPCODE_RC_SEND_LAST_WITH_INVALIDATE] = &hfi1_rc_rcv, + [IB_OPCODE_RC_SEND_ONLY_WITH_INVALIDATE] = &hfi1_rc_rcv,/* UC */ [IB_OPCODE_UC_SEND_FIRST] = &hfi1_uc_rcv, [IB_OPCODE_UC_SEND_MIDDLE] = &hfi1_uc_rcv,
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/28 IB/hfi1: Work request processing for fast register mr and invalidate
In reply to a message not in the archiveFrom: Jianxin Xiong <[email protected]>
In order to support extended memory management support, add send side processing of work requests of type IB_WR_REG_MR, IB_WR_LOCAL_INV, and IB_WR_SEND_WITH_INV. The first two are local operations and are supported for both RC and UC. Send with invalidate is only supported for RC because the corresponding IB opcodes are not defined for UC.
--- drivers/infiniband/hw/hfi1/rc.c | 46 ++++++++++++++++++++++++++++++++++-- drivers/infiniband/hw/hfi1/ruc.c | 26 ++++++++++++++++++++ drivers/infiniband/hw/hfi1/uc.c | 24 +++++++++++++++++++ drivers/infiniband/hw/hfi1/verbs.c | 5 +++- 4 files changed, 98 insertions(+), 3 deletions(-)
drivers/infiniband/hw/hfi1/rc.c +44 -2
@@ -402,6 +402,7 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)char newreq;int middle =0 ;int delta; +int err; ps->s_txreq =get_txreq (ps->dev, qp);if (IS_ERR (ps->s_txreq))
@@ -477,6 +478,35 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) qp->s_flags |=RVT_S_WAIT_FENCE ; goto bail; } +/* +* Local operations are processed immediately +* after all prior requests have completed +*/ +if (wqe->wr.opcode ==IB_WR_REG_MR || + wqe->wr.opcode ==IB_WR_LOCAL_INV ) { +if (qp->s_last != qp->s_cur) + goto bail; +if (++qp->s_cur == qp->s_size) + qp->s_cur =0 ; +if (++qp->s_tail == qp->s_size) + qp->s_tail =0 ; +if (wqe->wr.opcode ==IB_WR_REG_MR ) + err =rvt_fast_reg_mr ( + qp, wqe->reg_wr.mr, + wqe->reg_wr.key, + wqe->reg_wr.access); +else + err =rvt_invalidate_rkey ( + qp, + wqe->wr.ex.invalidate_rkey); +hfi1_send_complete (qp, wqe, + err ?IB_WC_LOC_PROT_ERR + :IB_WC_SUCCESS ); +atomic_dec (&qp->local_ops_pending); + qp->s_hdrwords =0 ; + goto done_free_tx; + } + newreq =1 ; qp->s_psn = wqe->psn; }
@@ -491,6 +521,7 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)switch (wqe->wr.opcode) {case IB_WR_SEND :case IB_WR_SEND_WITH_IMM : +case IB_WR_SEND_WITH_INV :/* If no credit, return. */ if (!(qp->s_flags &RVT_S_UNLIMITED_CREDIT ) &&cmp_msn (wqe->ssn, qp->s_lsn +1 ) >0 ) {
@@ -504,11 +535,17 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) }if (wqe->wr.opcode ==IB_WR_SEND ) { qp->s_state =OP (SEND_ONLY ); - }else { + }else if (wqe->wr.opcode ==IB_WR_SEND_WITH_IMM ) { qp->s_state =OP (SEND_ONLY_WITH_IMMEDIATE );/* Immediate data comes after the BTH */ ohdr->u.imm_data = wqe->wr.ex.imm_data; hwords +=1 ; + }else { + qp->s_state =OP (SEND_ONLY_WITH_INVALIDATE ); +/* Invalidate rkey comes after the BTH */ + ohdr->u.ieth =cpu_to_be32 ( + wqe->wr.ex.invalidate_rkey); + hwords +=1 ; }if (wqe->wr.send_flags &IB_SEND_SOLICITED ) bth0 |=IB_BTH_SOLICITED ;
@@ -671,11 +708,16 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) }if (wqe->wr.opcode ==IB_WR_SEND ) { qp->s_state =OP (SEND_LAST ); - }else { + }else if (wqe->wr.opcode ==IB_WR_SEND_WITH_IMM ) { qp->s_state =OP (SEND_LAST_WITH_IMMEDIATE );/* Immediate data comes after the BTH */ ohdr->u.imm_data = wqe->wr.ex.imm_data; hwords +=1 ; + }else { + qp->s_state =OP (SEND_LAST_WITH_INVALIDATE ); +/* invalidate data comes after the BTH */ + ohdr->u.ieth =cpu_to_be32 (wqe->wr.ex.invalidate_rkey); + hwords +=1 ; }if (wqe->wr.send_flags &IB_SEND_SOLICITED ) bth0 |=IB_BTH_SOLICITED ;
drivers/infiniband/hw/hfi1/ruc.c +26 -0
@@ -372,6 +372,7 @@ static void ruc_loopback(struct rvt_qp *sqp)int ret;int copy_last =0 ;u32 to; +int local_ops =0 ;rcu_read_lock ();
@@ -440,11 +441,32 @@ again: sqp->s_sge.num_sge = wqe->wr.num_sge; sqp->s_len = wqe->length;switch (wqe->wr.opcode) { +case IB_WR_REG_MR : +if (rvt_fast_reg_mr (sqp, wqe->reg_wr.mr, wqe->reg_wr.key, + wqe->reg_wr.access)) + send_status =IB_WC_LOC_PROT_ERR ; + local_ops =1 ; + goto send_comp; + +case IB_WR_LOCAL_INV : +if (rvt_invalidate_rkey (sqp, wqe->wr.ex.invalidate_rkey)) + send_status =IB_WC_LOC_PROT_ERR ; + local_ops =1 ; + goto send_comp; + +case IB_WR_SEND_WITH_INV : +if (!rvt_invalidate_rkey (qp, wqe->wr.ex.invalidate_rkey)) { + wc.wc_flags =IB_WC_WITH_INVALIDATE ; + wc.ex.invalidate_rkey = wqe->wr.ex.invalidate_rkey; + } + goto send; +case IB_WR_SEND_WITH_IMM : wc.wc_flags =IB_WC_WITH_IMM ; wc.ex.imm_data = wqe->wr.ex.imm_data;/* FALLTHROUGH */ case IB_WR_SEND : +send: ret =hfi1_rvt_get_rwqe (qp,0 );if (ret <0 ) goto op_err;
@@ -583,6 +605,10 @@ send_comp: flush_send: sqp->s_rnr_retry = sqp->s_rnr_retry_cnt;hfi1_send_complete (sqp, wqe, send_status); +if (local_ops) { +atomic_dec (&sqp->local_ops_pending); + local_ops =0 ; + } goto again; rnr_nak:
drivers/infiniband/hw/hfi1/uc.c +24 -0
@@ -77,6 +77,7 @@ int hfi1_make_uc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)u32 len;u32 pmtu = qp->pmtu;int middle =0 ; +int err; ps->s_txreq =get_txreq (ps->dev, qp);if (IS_ERR (ps->s_txreq))
@@ -119,6 +120,29 @@ int hfi1_make_uc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) goto bail; }/* +* Local operations are processed immediately +* after all prior requests have completed. +*/ +if (wqe->wr.opcode ==IB_WR_REG_MR || + wqe->wr.opcode ==IB_WR_LOCAL_INV ) { +if (qp->s_last != qp->s_cur) + goto bail; +if (++qp->s_cur == qp->s_size) + qp->s_cur =0 ; +if (wqe->wr.opcode ==IB_WR_REG_MR ) + err =rvt_fast_reg_mr (qp, wqe->reg_wr.mr, + wqe->reg_wr.key, + wqe->reg_wr.access); +else + err =rvt_invalidate_rkey ( + qp, wqe->wr.ex.invalidate_rkey); +hfi1_send_complete (qp, wqe, err ?IB_WC_LOC_PROT_ERR + :IB_WC_SUCCESS ); +atomic_dec (&qp->local_ops_pending); + qp->s_hdrwords =0 ; + goto done_free_tx; + } +/* * Start a new request. */ qp->s_psn = wqe->psn;
drivers/infiniband/hw/hfi1/verbs.c +4 -1
@@ -306,7 +306,10 @@ const enum ib_wc_opcode ib_hfi1_wc_opcode[] = { [IB_WR_SEND_WITH_IMM] = IB_WC_SEND, [IB_WR_RDMA_READ] = IB_WC_RDMA_READ, [IB_WR_ATOMIC_CMP_AND_SWP] = IB_WC_COMP_SWAP, - [IB_WR_ATOMIC_FETCH_AND_ADD] = IB_WC_FETCH_ADD + [IB_WR_ATOMIC_FETCH_AND_ADD] = IB_WC_FETCH_ADD, + [IB_WR_SEND_WITH_INV] = IB_WC_SEND, + [IB_WR_LOCAL_INV] = IB_WC_LOCAL_INV, + [IB_WR_REG_MR] = IB_WC_REG_MR };/*
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 9/28 IB/hfi1: Add support for extended memory management
In reply to a message not in the archiveFrom: Jianxin Xiong <[email protected]>
Advertise and add the capability of handing all aspects of IBTA extended memory management support in post send.
--- drivers/infiniband/hw/hfi1/qp.c | 17 +++++++++++++++++ drivers/infiniband/hw/hfi1/verbs.c | 6 ++++-- 2 files changed, 21 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/qp.c +17 -0
@@ -157,6 +157,23 @@ const struct rvt_operation_params hfi1_post_parms[RVT_OPERATION_MAX] = { BIT(IB_QPT_UC) | BIT(IB_QPT_RC), }, +[IB_WR_REG_MR] = { + .length = sizeof(struct ib_reg_wr), + .qpt_support = BIT(IB_QPT_UC) | BIT(IB_QPT_RC), + .flags = RVT_OPERATION_LOCAL, +}, + +[IB_WR_LOCAL_INV] = { + .length = sizeof(struct ib_send_wr), + .qpt_support = BIT(IB_QPT_UC) | BIT(IB_QPT_RC), + .flags = RVT_OPERATION_LOCAL, +}, + +[IB_WR_SEND_WITH_INV] = { + .length = sizeof(struct ib_send_wr), + .qpt_support = BIT(IB_QPT_RC), +}, + };static void flush_tx_list (struct rvt_qp *qp)
drivers/infiniband/hw/hfi1/verbs.c +4 -2
@@ -1305,13 +1305,15 @@ static void hfi1_fill_device_attr(struct hfi1_devdata *dd) rdi->dparms.props.device_cap_flags =IB_DEVICE_BAD_PKEY_CNTR |IB_DEVICE_BAD_QKEY_CNTR |IB_DEVICE_SHUTDOWN_PORT |IB_DEVICE_SYS_IMAGE_GUID |IB_DEVICE_RC_RNR_NAK_GEN | -IB_DEVICE_PORT_ACTIVE_EVENT |IB_DEVICE_SRQ_RESIZE ; +IB_DEVICE_PORT_ACTIVE_EVENT |IB_DEVICE_SRQ_RESIZE | +IB_DEVICE_MEM_MGT_EXTENSIONS ; rdi->dparms.props.page_size_cap =PAGE_SIZE ; rdi->dparms.props.vendor_id = dd->oui1 <<16 | dd->oui2 <<8 | dd->oui3; rdi->dparms.props.vendor_part_id = dd->pcidev->device; rdi->dparms.props.hw_ver = dd->minrev; rdi->dparms.props.sys_image_guid = ib_hfi1_sys_image_guid; - rdi->dparms.props.max_mr_size = ~0ULL ; + rdi->dparms.props.max_mr_size =U64_MAX ; + rdi->dparms.props.max_fast_reg_page_list_len =UINT_MAX ; rdi->dparms.props.max_qp = hfi1_max_qps; rdi->dparms.props.max_qp_wr = hfi1_max_qp_wrs; rdi->dparms.props.max_sge = hfi1_max_sges;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160725203842.4800.60710.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org
Re: [PATCH 09/28] IB/hfi1: Add support for extended memory management
drivers/infiniband/hw/hfi1/verbs.c static void hfi1_fill_device_attr(struct hfi1_devdata *dd) · line 1309
Quoted 6 lines · Dennis Dalessandro
drivers/infiniband/hw/hfi1/verbs.c +2
-1rdi->dparms.props.device_cap_flags =IB_DEVICE_BAD_PKEY_CNTR |IB_DEVICE_BAD_QKEY_CNTR |IB_DEVICE_SHUTDOWN_PORT |IB_DEVICE_SYS_IMAGE_GUID |IB_DEVICE_RC_RNR_NAK_GEN | -IB_DEVICE_PORT_ACTIVE_EVENT |IB_DEVICE_SRQ_RESIZE ; +IB_DEVICE_PORT_ACTIVE_EVENT |IB_DEVICE_SRQ_RESIZE | +IB_DEVICE_MEM_MGT_EXTENSIONS ;
It would be good to do IB_DEVICE_LOCAL_DMA_LKEY as well, that feature is used automatically now.
Any chance we will see a qib update for FWRW as well?
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160725212457.GA21162-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Re: [PATCH 09/28] IB/hfi1: Add support for extended memory management
T24gTW9uLCAyMDE2LTA3LTI1IGF0IDE1OjI0IC0wNjAwLCBKYXNvbiBHdW50aG9ycGUgd3JvdGU6 DQo+IE9uIE1vbiwgSnVsIDI1LCAyMDE2IGF0IDAxOjM4OjQzUE0gLTA3MDAsIERlbm5pcyBEYWxl c3NhbmRybyB3cm90ZToNCj4gPiDCoAlyZGktPmRwYXJtcy5wcm9wcy5kZXZpY2VfY2FwX2ZsYWdz ID0NCj4gPiBJQl9ERVZJQ0VfQkFEX1BLRVlfQ05UUiB8DQo+ID4gwqAJCQlJQl9ERVZJQ0VfQkFE X1FLRVlfQ05UUiB8DQo+ID4gSUJfREVWSUNFX1NIVVRET1dOX1BPUlQgfA0KPiA+IMKgCQkJSUJf REVWSUNFX1NZU19JTUFHRV9HVUlEIHwNCj4gPiBJQl9ERVZJQ0VfUkNfUk5SX05BS19HRU4gfA0K PiA+IC0JCQlJQl9ERVZJQ0VfUE9SVF9BQ1RJVkVfRVZFTlQgfA0KPiA+IElCX0RFVklDRV9TUlFf UkVTSVpFOw0KPiA+ICsJCQlJQl9ERVZJQ0VfUE9SVF9BQ1RJVkVfRVZFTlQgfA0KPiA+IElCX0RF VklDRV9TUlFfUkVTSVpFIHwNCj4gPiArCQkJSUJfREVWSUNFX01FTV9NR1RfRVhURU5TSU9OUzsN Cj4gDQo+IEl0IHdvdWxkIGJlIGdvb2QgdG8gZG8gSUJfREVWSUNFX0xPQ0FMX0RNQV9MS0VZIGFz IHdlbGwsIHRoYXQgZmVhdHVyZQ0KPiBpcyB1c2VkIGF1dG9tYXRpY2FsbHkgbm93Lg0KDQpJJ2xs IGNoZWNrIGludG8gdGhhdC4NCg0KPiBBbnkgY2hhbmNlIHdlIHdpbGwgc2VlIGEgcWliIHVwZGF0 ZSBmb3IgRldSVyBhcyB3ZWxsPw0KDQpCZWVuIHRhbGtpbmcgaW50ZXJuYWxseSBhYm91dCB0aGF0 LiBOZWVkIHRvIGxvb2sgaW50byBpdCBhIGJpdCBtb3JlIHRvDQpzZWUgd2hhdCBjYW4gYmUgZG9u ZS4gSSBiZWxpZXZlIHNvbWUgb2YgdGhlIG9sZGVyIGJvYXJkcyBjYW4ndCBzdXBwb3J0DQppdCB0 aG91Z2guDQoNCi1EZW5ueQ==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 10/28 IB/hfi1: Modify the default number of kernel receive conexts
In reply to a message not in the archiveFrom: Harish Chegondi <[email protected]>
Currently, the default number of kernel receive contexts is set to the number of NUMA nodes on the system plus one for control context. However, the systems that have a single socket and/or have NUMA disabled in the BIOS will have only one receive context by default. This patch would ensure that by default there will be at least two kernel receive contexts plus one for control context regardless of the number of NUMA nodes on the system. The user can override the default number of kernel receive contexts with the krcvqs module parameter.
--- drivers/infiniband/hw/hfi1/chip.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hfi1/chip.c +2 -4
@@ -122,6 +122,7 @@ struct flag_table {#define SEC_SC_HALTED 0x4/* per-context only */ #define SEC_SPC_FREEZE 0x8/* per-HFI only */ +#define DEFAULT_KRCVQS 2#define MIN_KERNEL_KCTXTS 2#define FIRST_KERNEL_KCTXT 1/* sizes for both the QP and RSM map tables */
@@ -12773,7 +12774,6 @@ static int set_up_context_variables(struct hfi1_devdata *dd)/* * Kernel receive contexts: -* - min of 2 or 1 context/numa (excluding control context) * - Context 0 - control context (VL15/multicast/error) * - Context 1 - first kernel context * - Context 2 - second kernel context
@@ -12787,9 +12787,7 @@ static int set_up_context_variables(struct hfi1_devdata *dd)*/ num_kernel_contexts = n_krcvqs +1 ; else - num_kernel_contexts =num_online_nodes () +1 ; - num_kernel_contexts = -max_t (int,MIN_KERNEL_KCTXTS , num_kernel_contexts); + num_kernel_contexts =DEFAULT_KRCVQS +1 ;/* * Every kernel receive context needs an ACK send context. * one send context is allocated for each VL{0-7} and VL15
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 11/28 IB/hfi1: Explain state complete frame details
In reply to a message not in the archiveFrom: Dean Luick <[email protected]>
When link up fails in LNI, the local and peer state complete frames are reported as numbers. Explain what the values mean so the operator can better diagnose the problem.
--- drivers/infiniband/hw/hfi1/chip.c | 134 +++++++++++++++++++++++++++++++++++-- 1 files changed, 126 insertions(+), 8 deletions(-)
drivers/infiniband/hw/hfi1/chip.c +126 -8
@@ -9918,6 +9918,131 @@ static int wait_phy_linkstate(struct hfi1_devdata *dd, u32 state, u32 msecs)return 0 ; } +static const char *state_completed_string (u32 completed) +{ +static const char *const state_completed[] = { +"EstablishComm" , +"OptimizeEQ" , +"VerifyCap" + }; + +if (completed <ARRAY_SIZE (state_completed)) +return state_completed[completed]; + +return "unknown" ; +} + +static const char all_lanes_dead_timeout_expired[] = +"All lanes were inactive – was the interconnect media removed?" ; +static const char tx_out_of_policy[] = +"Passing lanes on local port do not meet the local link width policy" ; +static const char no_state_complete[] = +"State timeout occurred before link partner completed the state" ; +static const char *const state_complete_reasons[] = { + [0x00 ] ="Reason unknown" , + [0x01 ] ="Link was halted by driver, refer to LinkDownReason" , + [0x02 ] ="Link partner reported failure" , + [0x10 ] ="Unable to achieve frame sync on any lane" , + [0x11 ] = +"Unable to find a common bit rate with the link partner" , + [0x12 ] = +"Unable to achieve frame sync on sufficient lanes to meet the local link width policy" , + [0x13 ] = +"Unable to identify preset equalization on sufficient lanes to meet the local link width policy" , + [0x14 ] = no_state_complete, + [0x15 ] = +"State timeout occurred before link partner identified equalization presets" , + [0x16 ] = +"Link partner completed the EstablishComm state, but the passing lanes do not meet the local link width policy" , + [0x17 ] = tx_out_of_policy, + [0x20 ] = all_lanes_dead_timeout_expired, + [0x21 ] = +"Unable to achieve acceptable BER on sufficient lanes to meet the local link width policy" , + [0x22 ] = no_state_complete, + [0x23 ] = +"Link partner completed the OptimizeEq state, but the passing lanes do not meet the local link width policy" , + [0x24 ] = tx_out_of_policy, + [0x30 ] = all_lanes_dead_timeout_expired, + [0x31 ] = +"State timeout occurred waiting for host to process received frames" , + [0x32 ] = no_state_complete, + [0x33 ] = +"Link partner completed the VerifyCap state, but the passing lanes do not meet the local link width policy" , + [0x34 ] = tx_out_of_policy, +}; + +static const char *state_complete_reason_code_string (struct hfi1_pportdata *ppd, +u32 code) +{ +const char *str =NULL ; + +if (code <ARRAY_SIZE (state_complete_reasons)) + str = state_complete_reasons[code]; + +if (str) +return str; +return "Reserved" ; +} + +/* describe the given last state complete frame */ +static void decode_state_complete (struct hfi1_pportdata *ppd,u32 frame, +const char *prefix) +{ +struct hfi1_devdata *dd = ppd->dd; +u32 success; +u32 state; +u32 reason; +u32 lanes; + +/* +* Decode frame: +* [ 0: 0] - success +* [ 3: 1] - state +* [ 7: 4] - next state timeout +* [15: 8] - reason code +* [31:16] - lanes +*/ + success = frame &0x1 ; + state = (frame >>1 ) &0x7 ; + reason = (frame >>8 ) &0xff ; + lanes = (frame >>16 ) &0xffff ; + +dd_dev_err (dd,"Last %s LNI state complete frame 0x%08x:\n" , + prefix, frame); +dd_dev_err (dd," last reported state state: %s (0x%x)\n" , +state_completed_string (state), state); +dd_dev_err (dd," state successfully completed: %s\n" , + success ?"yes" :"no" ); +dd_dev_err (dd," fail reason 0x%x: %s\n" , + reason,state_complete_reason_code_string (ppd, reason)); +dd_dev_err (dd," passing lane mask: 0x%x" , lanes); +} + +/* +* Read the last state complete frames and explain them. This routine +* expects to be called if the link went down during link negotiation +* and initialization (LNI). That is, anywhere between polling and link up. +*/ +static void check_lni_states (struct hfi1_pportdata *ppd) +{ +u32 last_local_state; +u32 last_remote_state; + +read_last_local_state (ppd->dd, &last_local_state); +read_last_remote_state (ppd->dd, &last_remote_state); + +/* +* Don't report anything if there is nothing to report. A value of +* 0 means the link was taken down while polling and there was no +* training in-process. +*/ +if (last_local_state ==0 && last_remote_state ==0 ) +return ; + +decode_state_complete (ppd, last_local_state,"transmitted" ); +decode_state_complete (ppd, last_remote_state,"received" ); +} +/* * Helper for set_link_state(). Do not call except from that routine. * Expects ppd->hls_mutex to be held.
@@ -9930,8 +10055,6 @@ static int goto_offline(struct hfi1_pportdata *ppd, u8 rem_reason) {struct hfi1_devdata *dd = ppd->dd;u32 pstate, previous_state; -u32 last_local_state; -u32 last_remote_state;int ret;int do_transition;int do_wait;
@@ -10031,12 +10154,7 @@ static int goto_offline(struct hfi1_pportdata *ppd, u8 rem_reason) }else if (previous_state & (HLS_DN_POLL |HLS_VERIFY_CAP |HLS_GOING_UP )) {/* went down while attempting link up */ -/* byte 1 of last_*_state is the failure reason */ -read_last_local_state (dd, &last_local_state); -read_last_remote_state (dd, &last_remote_state); -dd_dev_err (dd, -"LNI failure last states: local 0x%08x, remote 0x%08x\n" , - last_local_state, last_remote_state); +check_lni_states (ppd); }/* the active link width (downgrade) is 0 on link down */
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 12/28 IB/hfi1: Read all firmware versions
In reply to a message not in the archiveFrom: Dean Luick <[email protected]>
Read the version of the SBus, PCIe SerDes, and Fabric Serdes firmwares at driver load time.
--- drivers/infiniband/hw/hfi1/chip.c | 25 ----- drivers/infiniband/hw/hfi1/chip.h | 1 drivers/infiniband/hw/hfi1/chip_registers.h | 4 + drivers/infiniband/hw/hfi1/firmware.c | 125 +++++++++++++++++++++++++++ 4 files changed, 130 insertions(+), 25 deletions(-)
drivers/infiniband/hw/hfi1/chip.c +0 -25
@@ -8826,30 +8826,6 @@ static int write_tx_settings(struct hfi1_devdata *dd,return load_8051_config (dd,TX_SETTINGS ,GENERAL_CONFIG , frame); } -static void check_fabric_firmware_versions (struct hfi1_devdata *dd) -{ -u32 frame, version, prod_id; -int ret, lane; - -/* 4 lanes */ -for (lane =0 ; lane <4 ; lane++) { - ret =read_8051_config (dd,SPICO_FW_VERSION , lane, &frame); -if (ret) { -dd_dev_err (dd, -"Unable to read lane %d firmware details\n" , - lane); -continue ; - } - version = (frame >>SPICO_ROM_VERSION_SHIFT ) - &SPICO_ROM_VERSION_MASK ; - prod_id = (frame >>SPICO_ROM_PROD_ID_SHIFT ) - &SPICO_ROM_PROD_ID_MASK ; -dd_dev_info (dd, -"Lane %d firmware: version 0x%04x, prod_id 0x%04x\n" , - lane, version, prod_id); - } -} -/* * Read an idle LCB message. *
@@ -14621,7 +14597,6 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev, ret =load_firmware (dd);/* asymmetric with dispose_firmware() */ if (ret) goto bail_clear_intr; -check_fabric_firmware_versions (dd);thermal_init (dd);
drivers/infiniband/hw/hfi1/chip.h +1 -0
@@ -640,6 +640,7 @@ extern uint platform_config_load;/* SBus commands */ #define RESET_SBUS_RECEIVER 0x20#define WRITE_SBUS_RECEIVER 0x21 +#define READ_SBUS_RECEIVER 0x22void sbus_request (struct hfi1_devdata *dd,u8 receiver_addr,u8 data_addr,u8 command,u32 data_in); int sbus_request_slow(struct hfi1_devdata *dd,
drivers/infiniband/hw/hfi1/chip_registers.h +4 -0
@@ -471,6 +471,10 @@#define ASIC_STS_SBUS_RESULT (ASIC + 0x000000000010)#define ASIC_STS_SBUS_RESULT_DONE_SMASK 0x1ull#define ASIC_STS_SBUS_RESULT_RCV_DATA_VALID_SMASK 0x2ull +#define ASIC_STS_SBUS_RESULT_RESULT_CODE_SHIFT 2 +#define ASIC_STS_SBUS_RESULT_RESULT_CODE_MASK 0x7ull +#define ASIC_STS_SBUS_RESULT_DATA_OUT_SHIFT 32 +#define ASIC_STS_SBUS_RESULT_DATA_OUT_MASK 0xFFFFFFFFull#define ASIC_STS_THERM (ASIC + 0x000000000058)#define ASIC_STS_THERM_CRIT_TEMP_MASK 0x7FFull#define ASIC_STS_THERM_CRIT_TEMP_SHIFT 18
drivers/infiniband/hw/hfi1/firmware.c +125 -0
152 lines not on this page · raw message
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 14/28 IB/hfi1: Fix "suspicious rcu_dereference_check() usage" warnings
In reply to a message not in the archiveFrom: Jianxin Xiong <[email protected]>
This fixes the following warnings with PROVE_LOCKING and PROVE_RCU enabled in the kernel:
case (1):
[ INFO: suspicious RCU usage. ]drivers/infiniband/hw/hfi1/init.c:532
suspicious rcu_dereference_check() usage!
case (2):
[ INFO: suspicious RCU usage. ]drivers/infiniband/hw/hfi1/hfi.h:1624
suspicious rcu_dereference_check() usage!
--- drivers/infiniband/hw/hfi1/hfi.h | 13 +++++++++++-- drivers/infiniband/hw/hfi1/init.c | 11 ++++++----- drivers/infiniband/hw/hfi1/mad.c | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-)
drivers/infiniband/hw/hfi1/hfi.h +11 -2
@@ -1616,8 +1616,7 @@ static inline u16 hfi1_get_pkey(struct hfi1_ibport *ibp, unsigned index) }/* -* Readers of cc_state must call get_cc_state() under rcu_read_lock(). -* Writers of cc_state must call get_cc_state() under cc_state_lock. +* Called by readers of cc_state only, must call under rcu_read_lock(). */ static inline struct cc_state *get_cc_state (struct hfi1_pportdata *ppd) {
@@ -1625,6 +1624,16 @@ static inline struct cc_state *get_cc_state(struct hfi1_pportdata *ppd) }/* +* Called by writers of cc_state only, must call under cc_state_lock. +*/ +static inline +struct cc_state *get_cc_state_protected (struct hfi1_pportdata *ppd) +{ +return rcu_dereference_protected (ppd->cc_state, +lockdep_is_held (&ppd->cc_state_lock)); +} + +/* * values for dd->flags (_device_ related flags) */ #define HFI1_INITTED 0x1/* chip and driver up and initted */
drivers/infiniband/hw/hfi1/init.c +6 -5
@@ -475,8 +475,9 @@ static enum hrtimer_restart cca_timer_fn(struct hrtimer *t)void hfi1_init_pportdata (struct pci_dev *pdev,struct hfi1_pportdata *ppd,struct hfi1_devdata *dd,u8 hw_pidx,u8 port) { -int i, size; +int i;uint default_pkey_idx; +struct cc_state *cc_state; ppd->dd = dd; ppd->hw_pidx = hw_pidx;
@@ -527,9 +528,9 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd,spin_lock_init (&ppd->cc_state_lock);spin_lock_init (&ppd->cc_log_lock); - size =sizeof (struct cc_state ); -RCU_INIT_POINTER (ppd->cc_state,kzalloc (size,GFP_KERNEL )); -if (!rcu_dereference (ppd->cc_state)) + cc_state =kzalloc (sizeof (*cc_state),GFP_KERNEL ); +RCU_INIT_POINTER (ppd->cc_state, cc_state); +if (!cc_state) goto bail;return ;
@@ -1327,7 +1328,7 @@ static void cleanup_device_data(struct hfi1_devdata *dd)hrtimer_cancel (&ppd->cca_timer[i].hrtimer);spin_lock (&ppd->cc_state_lock); - cc_state =get_cc_state (ppd); + cc_state =get_cc_state_protected (ppd);RCU_INIT_POINTER (ppd->cc_state,NULL );spin_unlock (&ppd->cc_state_lock);
drivers/infiniband/hw/hfi1/mad.c +1 -1
@@ -3375,7 +3375,7 @@ static void apply_cc_state(struct hfi1_pportdata *ppd)*/ spin_lock (&ppd->cc_state_lock); - old_cc_state =get_cc_state (ppd); + old_cc_state =get_cc_state_protected (ppd);if (!old_cc_state) {/* never active, or shutting down */ spin_unlock (&ppd->cc_state_lock);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 15/28 IB/hfi1: Add static PCIe Gen3 CTLE tuning
In reply to a message not in the archiveFrom: Dean Luick <[email protected]>
Enhance the PCIe Gen3 recipe to support static CTLE tuning, and add a switch to choose between static and dynamic approaches. Make discrete chips default to static CTLE tuning.
--- drivers/infiniband/hw/hfi1/pcie.c | 68 +++++++++++++++++++++++++++++++++++-- 1 files changed, 64 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hfi1/pcie.c +64 -4
@@ -679,6 +679,10 @@ static uint pcie_pset = UNSET_PSET;module_param (pcie_pset, uint,S_IRUGO );MODULE_PARM_DESC (pcie_pset,"PCIe Eq Pset value to use, range is 0-10" ); +static uint pcie_ctle =1 ;/* discrete on, integrated off */ +module_param (pcie_ctle, uint,S_IRUGO ); +MODULE_PARM_DESC (pcie_ctle,"PCIe static CTLE mode, bit 0 - discrete on/off, bit 1 - integrated on/off" ); +/* equalization columns */ #define PREC 0#define ATTN 1
@@ -716,6 +720,36 @@ static const u8 integrated_preliminary_eq[11][3] = { { 0x00, 0x1e, 0x0a }, /* p10 */ }; +static const u8 discrete_ctle_tunings[11 ][4 ] = { +/* DC LF HF BW */ + {0x48 ,0x0b ,0x04 ,0x04 },/* p0 */ + {0x60 ,0x05 ,0x0f ,0x0a },/* p1 */ + {0x50 ,0x09 ,0x06 ,0x06 },/* p2 */ + {0x68 ,0x05 ,0x0f ,0x0a },/* p3 */ + {0x80 ,0x05 ,0x0f ,0x0a },/* p4 */ + {0x70 ,0x05 ,0x0f ,0x0a },/* p5 */ + {0x68 ,0x05 ,0x0f ,0x0a },/* p6 */ + {0x38 ,0x0f ,0x00 ,0x00 },/* p7 */ + {0x48 ,0x09 ,0x06 ,0x06 },/* p8 */ + {0x60 ,0x05 ,0x0f ,0x0a },/* p9 */ + {0x38 ,0x0f ,0x00 ,0x00 },/* p10 */ +}; + +static const u8 integrated_ctle_tunings[11 ][4 ] = { +/* DC LF HF BW */ + {0x38 ,0x0f ,0x00 ,0x00 },/* p0 */ + {0x38 ,0x0f ,0x00 ,0x00 },/* p1 */ + {0x38 ,0x0f ,0x00 ,0x00 },/* p2 */ + {0x38 ,0x0f ,0x00 ,0x00 },/* p3 */ + {0x58 ,0x0a ,0x05 ,0x05 },/* p4 */ + {0x48 ,0x0a ,0x05 ,0x05 },/* p5 */ + {0x40 ,0x0a ,0x05 ,0x05 },/* p6 */ + {0x38 ,0x0f ,0x00 ,0x00 },/* p7 */ + {0x38 ,0x0f ,0x00 ,0x00 },/* p8 */ + {0x38 ,0x09 ,0x06 ,0x06 },/* p9 */ + {0x38 ,0x0e ,0x01 ,0x01 },/* p10 */ +}; +/* helper to format the value to write to hardware */ #define eq_value (pre, curr, post) \ ((((u32)(pre)) << \
@@ -951,11 +985,14 @@ int do_pcie_gen3_transition(struct hfi1_devdata *dd)u32 status, err;int ret;int do_retry, retry_count =0 ; +int intnum =0 ;uint default_pset;u16 target_vector, target_speed;u16 lnkctl2, vendor;u8 div;const u8 (*eq)[3 ]; +const u8 (*ctle_tunings)[4 ]; +uint static_ctle_mode;int return_error =0 ;/* PCIe Gen3 is for the ASIC only */
@@ -1089,6 +1126,9 @@ retry: div =3 ; eq = discrete_preliminary_eq; default_pset =DEFAULT_DISCRETE_PSET ; + ctle_tunings = discrete_ctle_tunings; +/* bit 0 - discrete on/off */ + static_ctle_mode = pcie_ctle &0x1 ; }else {/* 400mV, FS=29, LF = 9 */ fs =29 ;
@@ -1096,6 +1136,9 @@ retry: div =1 ; eq = integrated_preliminary_eq; default_pset =DEFAULT_MCP_PSET ; + ctle_tunings = integrated_ctle_tunings; +/* bit 1 - integrated on/off */ + static_ctle_mode = (pcie_ctle >>1 ) &0x1 ; } pci_write_config_dword(dd->pcidev, PCIE_CFG_REG_PL101, (fs <<
@@ -1135,16 +1178,33 @@ retry:* step 5c: Program gasket interrupts */ /* set the Rx Bit Rate to REFCLK ratio */ -write_gasket_interrupt (dd,0 ,0x0006 ,0x0050 ); +write_gasket_interrupt (dd, intnum++,0x0006 ,0x0050 );/* disable pCal for PCIe Gen3 RX equalization */ -write_gasket_interrupt (dd,1 ,0x0026 ,0x5b01 ); +/* select adaptive or static CTLE */ +write_gasket_interrupt (dd, intnum++,0x0026 , +0x5b01 | (static_ctle_mode <<3 ));/* * Enable iCal for PCIe Gen3 RX equalization, and set which * evaluation of RX_EQ_EVAL will launch the iCal procedure. */ -write_gasket_interrupt (dd,2 ,0x0026 ,0x5202 ); +write_gasket_interrupt (dd, intnum++,0x0026 ,0x5202 ); + +if (static_ctle_mode) { +/* apply static CTLE tunings */ +u8 pcie_dc, pcie_lf, pcie_hf, pcie_bw; + + pcie_dc = ctle_tunings[pcie_pset][0 ]; + pcie_lf = ctle_tunings[pcie_pset][1 ]; + pcie_hf = ctle_tunings[pcie_pset][2 ]; + pcie_bw = ctle_tunings[pcie_pset][3 ]; +write_gasket_interrupt (dd, intnum++,0x0026 ,0x0200 | pcie_dc); +write_gasket_interrupt (dd, intnum++,0x0026 ,0x0100 | pcie_lf); +write_gasket_interrupt (dd, intnum++,0x0026 ,0x0000 | pcie_hf); +write_gasket_interrupt (dd, intnum++,0x0026 ,0x5500 | pcie_bw); + } +/* terminate list */ -write_gasket_interrupt (dd,3 ,0x0000 ,0x0000 ); +write_gasket_interrupt (dd, intnum++,0x0000 ,0x0000 );/* * step 5d: program XMT margin
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 16/28 IB/hfi1: Add sysfs entry to override SDMA interrupt affinity
In reply to a message not in the archiveFrom: Tadeusz Struk <[email protected]>
Add sysfs entry to allow user to override affinity for SDMA engine interrupts.
--- drivers/infiniband/hw/hfi1/affinity.c | 68 +++++++++++++++++++++++++++++++++ drivers/infiniband/hw/hfi1/affinity.h | 4 ++ drivers/infiniband/hw/hfi1/sysfs.c | 25 ++++++++++++ 3 files changed, 97 insertions(+), 0 deletions(-)
drivers/infiniband/hw/hfi1/affinity.c +68 -0
@@ -47,6 +47,7 @@#include <linux/topology.h> #include <linux/cpumask.h> #include <linux/module.h> +#include <linux/cpumask.h> #include "hfi.h" #include "affinity.h"
@@ -673,3 +674,70 @@ void hfi1_put_proc_affinity(int cpu) }spin_unlock (&affinity->lock); } + +/* Prevents concurrent reads and writes of the sdma_affinity attrib */ +static DEFINE_MUTEX (sdma_affinity_mutex); + +int hfi1_set_sdma_affinity (struct hfi1_devdata *dd,const char *buf, +size_t count) +{ +struct hfi1_affinity_node *entry; +struct cpumask mask; +int ret, i; + +spin_lock (&node_affinity.lock); + entry =node_affinity_lookup (dd->node); +spin_unlock (&node_affinity.lock); + +if (!entry) +return -EINVAL ; + + ret =cpulist_parse (buf, &mask); +if (ret) +return ret; + +if (!cpumask_subset (&mask, cpu_online_mask) ||cpumask_empty (&mask)) { +dd_dev_warn (dd,"Invalid CPU mask\n" ); +return -EINVAL ; + } + +mutex_lock (&sdma_affinity_mutex); +/* reset the SDMA interrupt affinity details */ +init_cpu_mask_set (&entry->def_intr); +cpumask_copy (&entry->def_intr.mask, &mask); +/* +* Reassign the affinity for each SDMA interrupt. +*/ +for (i =0 ; i < dd->num_msix_entries; i++) { +struct hfi1_msix_entry *msix; + + msix = &dd->msix_entries[i]; +if (msix->type !=IRQ_SDMA ) +continue ; + + ret =hfi1_get_irq_affinity (dd, msix); + +if (ret) +break ; + } + +mutex_unlock (&sdma_affinity_mutex); +return ret ? ret :strnlen (buf,PAGE_SIZE ); +} + +int hfi1_get_sdma_affinity (struct hfi1_devdata *dd,char *buf) +{ +struct hfi1_affinity_node *entry; + +spin_lock (&node_affinity.lock); + entry =node_affinity_lookup (dd->node); +spin_unlock (&node_affinity.lock); + +if (!entry) +return -EINVAL ; + +mutex_lock (&sdma_affinity_mutex); +cpumap_print_to_pagebuf (true, buf, &entry->def_intr.mask); +mutex_unlock (&sdma_affinity_mutex); +return strnlen (buf,PAGE_SIZE ); +}
drivers/infiniband/hw/hfi1/affinity.h +4 -0
@@ -102,6 +102,10 @@ int hfi1_get_proc_affinity(int);/* Release a CPU used by a user process. */ void hfi1_put_proc_affinity (int ); +int hfi1_get_sdma_affinity (struct hfi1_devdata *dd,char *buf); +int hfi1_set_sdma_affinity (struct hfi1_devdata *dd,const char *buf, +size_t count); +struct hfi1_affinity_node {int node;struct cpu_mask_set def_intr;
drivers/infiniband/hw/hfi1/sysfs.c +25 -0
@@ -49,6 +49,7 @@#include "hfi.h" #include "mad.h" #include "trace.h" +#include "affinity.h" /* * Start of per-port congestion control structures and support code
@@ -622,6 +623,27 @@ static ssize_t show_tempsense(struct device *device,return ret; } +static ssize_t show_sdma_affinity (struct device *device, +struct device_attribute *attr,char *buf) +{ +struct hfi1_ibdev *dev = + container_of(device, struct hfi1_ibdev, rdi.ibdev.dev); +struct hfi1_devdata *dd =dd_from_dev (dev); + +return hfi1_get_sdma_affinity (dd, buf); +} + +static ssize_t store_sdma_affinity (struct device *device, +struct device_attribute *attr, +const char *buf,size_t count) +{ +struct hfi1_ibdev *dev = + container_of(device, struct hfi1_ibdev, rdi.ibdev.dev); +struct hfi1_devdata *dd =dd_from_dev (dev); + +return hfi1_set_sdma_affinity (dd, buf, count); +} +/* * end of per-unit (or driver, in some cases, but replicated * per unit) functions
@@ -636,6 +658,8 @@ static DEVICE_ATTR(serial, S_IRUGO, show_serial, NULL); static DEVICE_ATTR(boardversion, S_IRUGO, show_boardversion, NULL); static DEVICE_ATTR(tempsense, S_IRUGO, show_tempsense, NULL); static DEVICE_ATTR(chip_reset, S_IWUSR, NULL, store_chip_reset); +static DEVICE_ATTR(sdma_affinity, S_IWUSR | S_IRUGO, show_sdma_affinity, + store_sdma_affinity);static struct device_attribute *hfi1_attributes[] = { &dev_attr_hw_rev,
@@ -646,6 +670,7 @@ static struct device_attribute *hfi1_attributes[] = { &dev_attr_boardversion, &dev_attr_tempsense, &dev_attr_chip_reset, + &dev_attr_sdma_affinity, }; int hfi1_create_port_files(struct ib_device *ibdev, u8 port_num,
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 17/28 IB/hfi1: Fix trace message units
In reply to a message not in the archiveFrom: Grzegorz Heldt <[email protected]>
Trace shows incorrect amount of allocated memory.
Fix trace to display memory in KB.
--- drivers/infiniband/hw/hfi1/init.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/init.c +2 -2
@@ -1777,8 +1777,8 @@ int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *rcd)hfi1_cdbg (PROC ,"ctxt%u: Alloced %u rcv tid entries @ %uKB, total %zuKB\n" , - rcd->ctxt, rcd->egrbufs.alloced, rcd->egrbufs.rcvtid_size, - rcd->egrbufs.size); + rcd->ctxt, rcd->egrbufs.alloced, + rcd->egrbufs.rcvtid_size /1024 , rcd->egrbufs.size /1024 );/* * Set the contexts rcv array head update threshold to the closest
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 18/28 IB/hfi1: Add the capability for reserved operations
In reply to a message not in the archiveFrom: Mike Marciniszyn <[email protected]>
This fix allows for support of in-kernel reserved operations without impacting the ULP user.
The low level driver can register a non-zero value which will be transparently added to the send queue size and hidden from the ULP in every respect.
ULP post sends will never see a full queue due to a reserved post send and reserved operations will never exceed that registered value.
The s_avail will continue to track the ULP swqe availability and the difference between the reserved value and the reserved in use will track reserved availabity.
--- drivers/infiniband/sw/rdmavt/qp.c | 85 +++++++++++++++++++++++++++---------- include/rdma/rdma_vt.h | 1 include/rdma/rdmavt_qp.h | 50 ++++++++++++++++++++++ 3 files changed, 113 insertions(+), 23 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +62 -23
@@ -584,6 +584,7 @@ static void rvt_reset_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp, qp->r_rq.wq->tail =0 ; } qp->r_sge.num_sge =0 ; +atomic_set (&qp->s_reserved_used,0 ); }/**
@@ -645,7 +646,8 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,return ERR_PTR (-EINVAL ); } sqsize = - init_attr->cap.max_send_wr +1 ; + init_attr->cap.max_send_wr +1 + + rdi->dparms.reserved_operations;switch (init_attr->qp_type) {case IB_QPT_SMI :case IB_QPT_GSI :
@@ -1335,7 +1337,8 @@ int rvt_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, attr->sq_psn = qp->s_next_psn & rdi->dparms.psn_mask; attr->dest_qp_num = qp->remote_qpn; attr->qp_access_flags = qp->qp_access_flags; - attr->cap.max_send_wr = qp->s_size -1 ; + attr->cap.max_send_wr = qp->s_size -1 - + rdi->dparms.reserved_operations; attr->cap.max_recv_wr = qp->ibqp.srq ?0 : qp->r_rq.size -1 ; attr->cap.max_send_sge = qp->s_max_sge; attr->cap.max_recv_sge = qp->r_rq.max_sge;
@@ -1494,27 +1497,65 @@ static inline int rvt_qp_valid_operation( }/** -* qp_get_savail - return number of avail send entries +* rvt_qp_is_avail - determine queue capacity * @qp - the qp +* @rdi - the rdmavt device +* @reserved_op - is reserved operation * * This assumes the s_hlock is held but the s_last * qp variable is uncontrolled. * -* The return is adjusted to not count device specific -* reserved operations. +* For non reserved operations, the qp->s_avail +* may be changed. +* +* The return value is zero or a -ENOMEM. */ -static inline u32 qp_get_savail (struct rvt_qp *qp) +static inline int rvt_qp_is_avail ( +struct rvt_qp *qp, +struct rvt_dev_info *rdi, +bool reserved_op) {u32 slast; -u32 ret; - +u32 avail; +u32 reserved_used; + +/* see rvt_qp_wqe_unreserve() */ +smp_mb__before_atomic (); + reserved_used =atomic_read (&qp->s_reserved_used); +if (unlikely (reserved_op)) { +/* see rvt_qp_wqe_unreserve() */ +smp_mb__before_atomic (); +if (reserved_used >= rdi->dparms.reserved_operations) +return -ENOMEM ; +return 0 ; + } +/* non-reserved operations */ +if (likely (qp->s_avail)) +return 0 ;smp_read_barrier_depends ();/* see rc.c */ slast =ACCESS_ONCE (qp->s_last);if (qp->s_head >= slast) - ret = qp->s_size - (qp->s_head - slast); + avail = qp->s_size - (qp->s_head - slast);else - ret = slast - qp->s_head; -return ret -1 ; + avail = slast - qp->s_head; + +/* see rvt_qp_wqe_unreserve() */ +smp_mb__before_atomic (); + reserved_used =atomic_read (&qp->s_reserved_used); + avail = avail -1 - + (rdi->dparms.reserved_operations - reserved_used); +/* insure we don't assign a negative s_avail */ +if ((s32 )avail <=0 ) +return -ENOMEM ; + qp->s_avail = avail; +if (WARN_ON (qp->s_avail > + (qp->s_size -1 - rdi->dparms.reserved_operations))) +rvt_pr_err (rdi, +"More avail entries than QP RB size.\nQP: %u, size: %u, avail: %u\nhead: %u, tail: %u, cur: %u, acked: %u, last: %u" , + qp->ibqp.qp_num, qp->s_size, qp->s_avail, + qp->s_head, qp->s_tail, qp->s_cur, + qp->s_acked, qp->s_last); +return 0 ; }/**
@@ -1537,6 +1578,7 @@ static int rvt_post_one_wr(struct rvt_qp *qp,u8 log_pmtu;int ret;size_t cplen; +bool reserved_op;BUILD_BUG_ON (IB_QPT_MAX >= (sizeof (u32) *BITS_PER_BYTE ));
@@ -1574,18 +1616,12 @@ static int rvt_post_one_wr(struct rvt_qp *qp, } } + reserved_op = rdi->post_parms[wr->opcode].flags & +RVT_OPERATION_USE_RESERVE ;/* check for avail */ -if (unlikely (!qp->s_avail)) { - qp->s_avail =qp_get_savail (qp); -if (WARN_ON (qp->s_avail > (qp->s_size -1 ))) -rvt_pr_err (rdi, -"More avail entries than QP RB size.\nQP: %u, size: %u, avail: %u\nhead: %u, tail: %u, cur: %u, acked: %u, last: %u" , - qp->ibqp.qp_num, qp->s_size, qp->s_avail, - qp->s_head, qp->s_tail, qp->s_cur, - qp->s_acked, qp->s_last); -if (!qp->s_avail) -return -ENOMEM ; - } + ret =rvt_qp_is_avail (qp, rdi, reserved_op); +if (ret) +return ret; next = qp->s_head +1 ;if (next >= qp->s_size) next =0 ;
@@ -1653,8 +1689,11 @@ static int rvt_post_one_wr(struct rvt_qp *qp, qp->s_next_psn = wqe->lpsn +1 ; }trace_rvt_post_one_wr (qp, wqe); +if (unlikely (reserved_op)) +rvt_qp_wqe_reserve (qp, wqe); +else + qp->s_avail--;smp_wmb ();/* see request builders */ - qp->s_avail--; qp->s_head = next;return 0 ;
include/rdma/rdma_vt.h +1 -0
@@ -158,6 +158,7 @@ struct rvt_driver_params {u32 max_mad_size;u8 qos_shift;u8 max_rdma_atomic; +u8 reserved_operations; };/* Protection domain */
include/rdma/rdmavt_qp.h +50 -0
74 lines not on this page · raw message
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 19/28 IB/rdmavt, hfi1: Fix NFSoRDMA failure with FRMR enabled
In reply to a message not in the archiveFrom: Jianxin Xiong <[email protected]>
Hanging has been observed while writing a file over NFSoRDMA. Dmesg on the server contains messages like these:
[ 931.992501] svcrdma: Error -22 posting RDMA_READ [ 952.076879] svcrdma: Error -22 posting RDMA_READ [ 982.154127] svcrdma: Error -22 posting RDMA_READ [ 1012.235884] svcrdma: Error -22 posting RDMA_READ [ 1042.319194] svcrdma: Error -22 posting RDMA_READ
Here is why:
With the base memory management extension enabled, FRMR is used instead of FMR. The xprtrdma server issues each RDMA read request as the following bundle:
(1)IB_WR_REG_MR, signaled;
(2)IB_WR_RDMA_READ, signaled;
(3)IB_WR_LOCAL_INV, signaled & fencing.
These requests are signaled. In order to generate completion, the fast register work request is processed by the hfi1 send engine after being posted to the work queue, and the corresponding lkey is not valid until the request is processed. However, the rdmavt driver validates lkey when the RDMA read request is posted and thus it fails immediately with error -EINVAL (-22).
This patch changes the work flow of local operations (fast register and local invalidate) so that fast register work requests are always processed immediately to ensure that the corresponding lkey is valid when subsequent work requests are posted. Local invalidate requests are processed immediately if fencing is not required and no previous local invalidate request is pending.
To allow completion generation for signaled local operations that have been processed before posting to the work queue, an internal send flag RVT_SEND_COMPLETION_ONLY is added. The hfi1 send engine checks this flag and only generates completion for such requests.
--- drivers/infiniband/hw/hfi1/rc.c | 17 +++++++------ drivers/infiniband/hw/hfi1/ruc.c | 13 +++++----- drivers/infiniband/hw/hfi1/uc.c | 15 ++++++------ drivers/infiniband/sw/rdmavt/qp.c | 48 +++++++++++++++++++++++++------------ include/rdma/rdmavt_qp.h | 1 + 5 files changed, 56 insertions(+), 38 deletions(-)
drivers/infiniband/hw/hfi1/rc.c +9 -8
@@ -402,7 +402,6 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)char newreq;int middle =0 ;int delta; -int err; ps->s_txreq =get_txreq (ps->dev, qp);if (IS_ERR (ps->s_txreq))
@@ -484,25 +483,27 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)*/ if (wqe->wr.opcode ==IB_WR_REG_MR || wqe->wr.opcode ==IB_WR_LOCAL_INV ) { +int local_ops =0 ; +int err =0 ; +if (qp->s_last != qp->s_cur) goto bail;if (++qp->s_cur == qp->s_size) qp->s_cur =0 ;if (++qp->s_tail == qp->s_size) qp->s_tail =0 ; -if (wqe->wr.opcode ==IB_WR_REG_MR ) - err =rvt_fast_reg_mr ( - qp, wqe->reg_wr.mr, - wqe->reg_wr.key, - wqe->reg_wr.access); -else +if (!(wqe->wr.send_flags & +RVT_SEND_COMPLETION_ONLY )) { err =rvt_invalidate_rkey ( qp, wqe->wr.ex.invalidate_rkey); + local_ops =1 ; + }hfi1_send_complete (qp, wqe, err ?IB_WC_LOC_PROT_ERR :IB_WC_SUCCESS ); -atomic_dec (&qp->local_ops_pending); +if (local_ops) +atomic_dec (&qp->local_ops_pending); qp->s_hdrwords =0 ; goto done_free_tx; }
drivers/infiniband/hw/hfi1/ruc.c +6 -7
@@ -442,16 +442,15 @@ again: sqp->s_len = wqe->length;switch (wqe->wr.opcode) {case IB_WR_REG_MR : -if (rvt_fast_reg_mr (sqp, wqe->reg_wr.mr, wqe->reg_wr.key, - wqe->reg_wr.access)) - send_status =IB_WC_LOC_PROT_ERR ; - local_ops =1 ; goto send_comp;case IB_WR_LOCAL_INV : -if (rvt_invalidate_rkey (sqp, wqe->wr.ex.invalidate_rkey)) - send_status =IB_WC_LOC_PROT_ERR ; - local_ops =1 ; +if (!(wqe->wr.send_flags &RVT_SEND_COMPLETION_ONLY )) { +if (rvt_invalidate_rkey (sqp, + wqe->wr.ex.invalidate_rkey)) + send_status =IB_WC_LOC_PROT_ERR ; + local_ops =1 ; + } goto send_comp;case IB_WR_SEND_WITH_INV :
drivers/infiniband/hw/hfi1/uc.c +8 -7
@@ -77,7 +77,6 @@ int hfi1_make_uc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)u32 len;u32 pmtu = qp->pmtu;int middle =0 ; -int err; ps->s_txreq =get_txreq (ps->dev, qp);if (IS_ERR (ps->s_txreq))
@@ -125,20 +124,22 @@ int hfi1_make_uc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)*/ if (wqe->wr.opcode ==IB_WR_REG_MR || wqe->wr.opcode ==IB_WR_LOCAL_INV ) { +int local_ops =0 ; +int err =0 ; +if (qp->s_last != qp->s_cur) goto bail;if (++qp->s_cur == qp->s_size) qp->s_cur =0 ; -if (wqe->wr.opcode ==IB_WR_REG_MR ) - err =rvt_fast_reg_mr (qp, wqe->reg_wr.mr, - wqe->reg_wr.key, - wqe->reg_wr.access); -else +if (!(wqe->wr.send_flags &RVT_SEND_COMPLETION_ONLY )) { err =rvt_invalidate_rkey ( qp, wqe->wr.ex.invalidate_rkey); + local_ops =1 ; + }hfi1_send_complete (qp, wqe, err ?IB_WC_LOC_PROT_ERR :IB_WC_SUCCESS ); -atomic_dec (&qp->local_ops_pending); +if (local_ops) +atomic_dec (&qp->local_ops_pending); qp->s_hdrwords =0 ; goto done_free_tx; }
drivers/infiniband/sw/rdmavt/qp.c +32 -16
70 lines not on this page · raw message
include/rdma/rdmavt_qp.h +1 -0
@@ -148,6 +148,7 @@* Internal send flags */ #define RVT_SEND_RESERVE_USED IB_SEND_RESERVED_START +#define RVT_SEND_COMPLETION_ONLY (IB_SEND_RESERVED_START << 1)/* * Send work request queue entry.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 20/28 IB/hfi1: Disable external device configuration requests
In reply to a message not in the archiveFrom: Easwar Hariharan <[email protected]>
QSFP CDR enablement is now controlled by determining power class and the configuration file. We disable the DC 8051 from requesting enablement or disabling of TX and RX CDRs by removing the code that allowed the DC 8051 to request changes.
--- drivers/infiniband/hw/hfi1/platform.c | 14 -------------- 1 files changed, 0 insertions(+), 14 deletions(-)
drivers/infiniband/hw/hfi1/platform.c +0 -14
@@ -537,20 +537,6 @@ static void apply_tunings(u8 precur =0 , attn =0 , postcur =0 , external_device_config =0 ;u8 *cache = ppd->qsfp_info.cache; -/* Enable external device config if channel is limiting active */ -read_8051_config (ppd->dd,LINK_OPTIMIZATION_SETTINGS , -GENERAL_CONFIG , &config_data); - config_data &= ~(0xff <<ENABLE_EXT_DEV_CONFIG_SHIFT ); - config_data |= ((u32 )limiting_active <<ENABLE_EXT_DEV_CONFIG_SHIFT ); - ret =load_8051_config (ppd->dd,LINK_OPTIMIZATION_SETTINGS , -GENERAL_CONFIG , config_data); -if (ret !=HCMD_SUCCESS ) -dd_dev_err ( - ppd->dd, -"%s: Failed to set enable external device config\n" , - __func__); - - config_data =0 ;/* re-init */ /* Pass tuning method to 8051 */ read_8051_config (ppd->dd,LINK_TUNING_PARAMETERS ,GENERAL_CONFIG , &config_data);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 21/28 IB/hfi1: Ignore QSFP interrupts until power stabilizes
In reply to a message not in the archiveFrom: Easwar Hariharan <[email protected]>
Some QSFP cables assert the interrupt line as a side effect of module plug-in and power up. This causes the SerDes and QSFP tuning algorithm to begin cable initialization by reading the QSFP memory map over I2C, which fails. This patch ignores any interrupt line assertion until the module has completed power up and voltage rails have stabilized, which can take a maximum of 500 ms per the SFF-8679 specification.
--- drivers/infiniband/hw/hfi1/chip.c | 28 +++++++++++++++++++++------- 1 files changed, 21 insertions(+), 7 deletions(-)
drivers/infiniband/hw/hfi1/chip.c +21 -7
@@ -9191,17 +9191,24 @@ static void wait_for_qsfp_init(struct hfi1_pportdata *ppd)unsigned long timeout;/* -* Check for QSFP interrupt for t_init (SFF 8679) +* Some QSFP cables have a quirk that asserts the IntN line as a side +* effect of power up on plug-in. We ignore this false positive +* interrupt until the module has finished powering up by waiting for +* a minimum timeout of the module inrush initialization time of +* 500 ms (SFF 8679 Table 5-6) to ensure the voltage rails in the +* module have stabilized. +*/ +msleep (500 ); + +/* +* Check for QSFP interrupt for t_init (SFF 8679 Table 8-1) */ timeout = jiffies +msecs_to_jiffies (2000 );while (1 ) { mask =read_csr (dd, dd->hfi1_id ?ASIC_QSFP2_IN :ASIC_QSFP1_IN ); -if (!(mask &QSFP_HFI0_INT_N )) { -write_csr (dd, dd->hfi1_id ?ASIC_QSFP2_CLEAR : -ASIC_QSFP1_CLEAR ,QSFP_HFI0_INT_N ); +if (!(mask &QSFP_HFI0_INT_N ))break ; - }if (time_after (jiffies, timeout)) {dd_dev_info (dd,"%s: No IntN detected, reset complete\n" , __func__);
@@ -9217,10 +9224,17 @@ static void set_qsfp_int_n(struct hfi1_pportdata *ppd, u8 enable)u64 mask; mask =read_csr (dd, dd->hfi1_id ?ASIC_QSFP2_MASK :ASIC_QSFP1_MASK ); -if (enable) +if (enable) { +/* +* Clear the status register to avoid an immediate interrupt +* when we re-enable the IntN pin +*/ +write_csr (dd, dd->hfi1_id ?ASIC_QSFP2_CLEAR :ASIC_QSFP1_CLEAR , +QSFP_HFI0_INT_N ); mask |= (u64 )QSFP_HFI0_INT_N ; -else + }else { mask &= ~(u64 )QSFP_HFI0_INT_N ; + }write_csr (dd, dd->hfi1_id ?ASIC_QSFP2_MASK :ASIC_QSFP1_MASK , mask); }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 22/28 IB/hfi1: Reset QSFP on every run through channel tuning
In reply to a message not in the archiveFrom: Easwar Hariharan <[email protected]>
Active QSFP cables were reset only every alternate iteration of the channel tuning algorithm instead of every iteration due to incorrect reset of the flag that controlled QSFP reset, resulting in using stale QSFP status in the channel tuning algorithm.
--- drivers/infiniband/hw/hfi1/platform.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/infiniband/hw/hfi1/platform.c +5 -1
@@ -624,9 +624,13 @@ static int tune_active_qsfp(struct hfi1_pportdata *ppd, u32 *ptr_tx_preset,if (ret)return ret; +/* +* We'll change the QSFP memory contents from here on out, thus we set a +* flag here to remind ourselves to reset the QSFP module. This prevents +* reuse of stale settings established in our previous pass through. +*/ if (ppd->qsfp_info.reset_needed) {reset_qsfp (ppd); - ppd->qsfp_info.reset_needed =0 ;refresh_qsfp_cache (ppd, &ppd->qsfp_info); }else { ppd->qsfp_info.reset_needed =1 ;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 23/28 IB/hfi1: Remove unused elements from struct ahg_ib_header
In reply to a message not in the archiveFrom: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
sde and hfi1_ib_header are not used anymore.
--- drivers/infiniband/hw/hfi1/ruc.c | 2 -- drivers/infiniband/hw/hfi1/ud.c | 1 - drivers/infiniband/hw/hfi1/verbs.h | 2 -- 3 files changed, 0 insertions(+), 5 deletions(-)
drivers/infiniband/hw/hfi1/ruc.c +0 -2
@@ -735,7 +735,6 @@ static inline void build_ahg(struct rvt_qp *qp, u32 npsn) qp->s_ahgpsn = npsn; priv->s_hdr->tx_flags |=SDMA_TXREQ_F_AHG_COPY ;/* save to protect a change in another thread */ - priv->s_hdr->sde = priv->s_sde; priv->s_hdr->ahgidx = qp->s_ahgidx; qp->s_flags |=RVT_S_AHG_VALID ; }
@@ -804,7 +803,6 @@ void hfi1_make_ruc_header(struct rvt_qp *qp, struct hfi1_other_headers *ohdr, priv->s_hdr->tx_flags =0 ; priv->s_hdr->ahgcount =0 ; priv->s_hdr->ahgidx =0 ; - priv->s_hdr->sde =NULL ;if (qp->s_mig_state ==IB_MIG_MIGRATED ) bth0 |=IB_BTH_MIG_REQ ;else
drivers/infiniband/hw/hfi1/ud.c +0 -1
@@ -433,7 +433,6 @@ int hfi1_make_ud_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) priv->s_hdr->ahgcount =0 ; priv->s_hdr->ahgidx =0 ; priv->s_hdr->tx_flags =0 ; - priv->s_hdr->sde =NULL ;/* pbc */ ps->s_txreq->hdr_dwords = qp->s_hdrwords +2 ;
drivers/infiniband/hw/hfi1/verbs.h +0 -2
@@ -179,12 +179,10 @@ struct hfi1_ib_header { } __packed;struct ahg_ib_header { -struct sdma_engine *sde;u32 ahgdesc[2 ];u16 tx_flags;u8 ahgcount;u8 ahgidx; -struct hfi1_ib_header ibh; };struct hfi1_pio_header {
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 24/28 IB/hfi1: Rename struct ahg_ib_header to struct hfi1_ahg_info
In reply to a message not in the archiveFrom: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
struct ahg_ib_header has no header specific information. Rename it to struct hfi1_ahg_info
--- drivers/infiniband/hw/hfi1/qp.c | 7 ++++--- drivers/infiniband/hw/hfi1/qp.h | 2 +- drivers/infiniband/hw/hfi1/ruc.c | 28 ++++++++++++++-------------- drivers/infiniband/hw/hfi1/ud.c | 6 +++--- drivers/infiniband/hw/hfi1/verbs.c | 20 ++++++++++---------- drivers/infiniband/hw/hfi1/verbs.h | 4 ++-- 6 files changed, 34 insertions(+), 33 deletions(-)
drivers/infiniband/hw/hfi1/qp.c +4 -3
@@ -806,8 +806,9 @@ void *qp_priv_alloc(struct rvt_dev_info *rdi, struct rvt_qp *qp, priv->owner = qp; - priv->s_hdr =kzalloc_node (sizeof (*priv->s_hdr), gfp, rdi->dparms.node); -if (!priv->s_hdr) { + priv->s_ahg =kzalloc_node (sizeof (*priv->s_ahg), gfp, + rdi->dparms.node); +if (!priv->s_ahg) {kfree (priv);return ERR_PTR (-ENOMEM ); }
@@ -820,7 +821,7 @@ void qp_priv_free(struct rvt_dev_info *rdi, struct rvt_qp *qp) {struct hfi1_qp_priv *priv = qp->priv; -kfree (priv->s_hdr); +kfree (priv->s_ahg);kfree (priv); }
drivers/infiniband/hw/hfi1/qp.h +1 -1
@@ -63,7 +63,7 @@ static inline void clear_ahg(struct rvt_qp *qp) {struct hfi1_qp_priv *priv = qp->priv; - priv->s_hdr->ahgcount =0 ; + priv->s_ahg->ahgcount =0 ; qp->s_flags &= ~(RVT_S_AHG_VALID |RVT_S_AHG_CLEAR );if (priv->s_sde && qp->s_ahgidx >=0 )sdma_ahg_free (priv->s_sde, qp->s_ahgidx);
drivers/infiniband/hw/hfi1/ruc.c +14 -14
@@ -711,7 +711,7 @@ u32 hfi1_make_grh(struct hfi1_ibport *ibp, struct ib_grh *hdr,#define BTH2_OFFSET (offsetof(struct hfi1_pio_header, hdr.u.oth.bth[2]) / 4)/** -* build_ahg - create ahg in s_hdr +* build_ahg - create ahg in s_ahg * @qp: a pointer to QP * @npsn: the next PSN for the request/response *
@@ -733,18 +733,18 @@ static inline void build_ahg(struct rvt_qp *qp, u32 npsn) qp->s_ahgidx =sdma_ahg_alloc (priv->s_sde);if (qp->s_ahgidx >=0 ) { qp->s_ahgpsn = npsn; - priv->s_hdr->tx_flags |=SDMA_TXREQ_F_AHG_COPY ; + priv->s_ahg->tx_flags |=SDMA_TXREQ_F_AHG_COPY ;/* save to protect a change in another thread */ - priv->s_hdr->ahgidx = qp->s_ahgidx; + priv->s_ahg->ahgidx = qp->s_ahgidx; qp->s_flags |=RVT_S_AHG_VALID ; } }else {/* subsequent middle after valid */ if (qp->s_ahgidx >=0 ) { - priv->s_hdr->tx_flags |=SDMA_TXREQ_F_USE_AHG ; - priv->s_hdr->ahgidx = qp->s_ahgidx; - priv->s_hdr->ahgcount++; - priv->s_hdr->ahgdesc[0 ] = + priv->s_ahg->tx_flags |=SDMA_TXREQ_F_USE_AHG ; + priv->s_ahg->ahgidx = qp->s_ahgidx; + priv->s_ahg->ahgcount++; + priv->s_ahg->ahgdesc[0 ] = sdma_build_ahg_descriptor( (__force u16)cpu_to_be16((u16)npsn), BTH2_OFFSET,
@@ -752,8 +752,8 @@ static inline void build_ahg(struct rvt_qp *qp, u32 npsn) 16);if ((npsn &0xffff0000 ) != (qp->s_ahgpsn &0xffff0000 )) { - priv->s_hdr->ahgcount++; - priv->s_hdr->ahgdesc[1 ] = + priv->s_ahg->ahgcount++; + priv->s_ahg->ahgdesc[1 ] = sdma_build_ahg_descriptor( (__force u16)cpu_to_be16( (u16)(npsn >> 16)),
@@ -790,7 +790,7 @@ void hfi1_make_ruc_header(struct rvt_qp *qp, struct hfi1_other_headers *ohdr, } lrh0 |= (priv->s_sc &0xf ) <<12 | (qp->remote_ah_attr.sl &0xf ) <<4 ;/* -* reset s_hdr/AHG fields +* reset s_ahg/AHG fields * * This insures that the ahgentry/ahgcount * are at a non-AHG default to protect
@@ -800,9 +800,9 @@ void hfi1_make_ruc_header(struct rvt_qp *qp, struct hfi1_other_headers *ohdr,* build_ahg() will modify as appropriate * to use the AHG feature. */ - priv->s_hdr->tx_flags =0 ; - priv->s_hdr->ahgcount =0 ; - priv->s_hdr->ahgidx =0 ; + priv->s_ahg->tx_flags =0 ; + priv->s_ahg->ahgcount =0 ; + priv->s_ahg->ahgidx =0 ;if (qp->s_mig_state ==IB_MIG_MIGRATED ) bth0 |=IB_BTH_MIG_REQ ;else
@@ -913,7 +913,7 @@ void hfi1_do_send(struct rvt_qp *qp)*/ if (hfi1_verbs_send (qp, &ps))return ; -/* Record that s_hdr is empty. */ +/* Record that s_ahg is empty. */ qp->s_hdrwords =0 ;/* allow other tasks to run */ if (unlikely (time_after (jiffies, timeout))) {
drivers/infiniband/hw/hfi1/ud.c +3 -3
@@ -430,9 +430,9 @@ int hfi1_make_ud_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) qp->qkey : wqe->ud_wr.remote_qkey); ohdr->u.ud.deth[1 ] =cpu_to_be32 (qp->ibqp.qp_num);/* disarm any ahg */ - priv->s_hdr->ahgcount =0 ; - priv->s_hdr->ahgidx =0 ; - priv->s_hdr->tx_flags =0 ; + priv->s_ahg->ahgcount =0 ; + priv->s_ahg->ahgidx =0 ; + priv->s_ahg->tx_flags =0 ;/* pbc */ ps->s_txreq->hdr_dwords = qp->s_hdrwords +2 ;
drivers/infiniband/hw/hfi1/verbs.c +10 -10
@@ -816,19 +816,19 @@ static int build_verbs_tx_desc(struct rvt_sge_state *ss, u32 length, struct verbs_txreq *tx, - struct ahg_ib_header *ahdr, + struct hfi1_ahg_info *ahg_info, u64 pbc) { int ret = 0;struct hfi1_pio_header *phdr = &tx->phdr;u16 hdrbytes = tx->hdr_dwords <<2 ; - if (!ahdr->ahgcount) { + if (!ahg_info->ahgcount) { ret = sdma_txinit_ahg( &tx->txreq, - ahdr->tx_flags, + ahg_info->tx_flags, hdrbytes + length, - ahdr->ahgidx, + ahg_info->ahgidx, 0, NULL, 0,
@@ -846,11 +846,11 @@ static int build_verbs_tx_desc( }else { ret =sdma_txinit_ahg ( &tx->txreq, - ahdr->tx_flags, + ahg_info->tx_flags, length, - ahdr->ahgidx, - ahdr->ahgcount, - ahdr->ahgdesc, + ahg_info->ahgidx, + ahg_info->ahgcount, + ahg_info->ahgdesc, hdrbytes, verbs_sdma_complete);if (ret)
@@ -868,7 +868,7 @@ int hfi1_verbs_send_dma(struct rvt_qp *qp, struct hfi1_pkt_state *ps, u64 pbc) {struct hfi1_qp_priv *priv = qp->priv; -struct ahg_ib_header *ahdr = priv->s_hdr; +struct hfi1_ahg_info *ahg_info = priv->s_ahg;u32 hdrwords = qp->s_hdrwords;struct rvt_sge_state *ss = qp->s_cur_sge;u32 len = qp->s_cur_size;
@@ -896,7 +896,7 @@ int hfi1_verbs_send_dma(struct rvt_qp *qp, struct hfi1_pkt_state *ps, plen); } tx->wqe = qp->s_wqe; - ret =build_verbs_tx_desc (tx->sde, ss, len, tx, ahdr, pbc); + ret =build_verbs_tx_desc (tx->sde, ss, len, tx, ahg_info, pbc);if (unlikely (ret)) goto bail_build; }
drivers/infiniband/hw/hfi1/verbs.h +2 -2
@@ -178,7 +178,7 @@ struct hfi1_ib_header { } u; } __packed; -struct ahg_ib_header { +struct hfi1_ahg_info {u32 ahgdesc[2 ];u16 tx_flags;u8 ahgcount;
@@ -195,7 +195,7 @@ struct hfi1_pio_header {* pair is made common */ struct hfi1_qp_priv { -struct ahg_ib_header *s_hdr;/* next header to send */ +struct hfi1_ahg_info *s_ahg;/* ahg info for next header */ struct sdma_engine *s_sde;/* current sde */ struct send_context *s_sendcontext;/* current sendcontext */ u8 s_sc;/* SC[0..4] for next packet */
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 25/28 IB/hfi1: Rename hfi1_pio_header to hfi1_sdma_header.
In reply to a message not in the archiveFrom: Don Hiatt <[email protected]>
hfi1_pio_header should really be called hfi1_sdma_header as it is only used for sdma transmits.
--- drivers/infiniband/hw/hfi1/ruc.c | 2 +- drivers/infiniband/hw/hfi1/verbs.c | 2 +- drivers/infiniband/hw/hfi1/verbs.h | 2 +- drivers/infiniband/hw/hfi1/verbs_txreq.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hfi1/ruc.c +1 -1
@@ -708,7 +708,7 @@ u32 hfi1_make_grh(struct hfi1_ibport *ibp, struct ib_grh *hdr,return sizeof (struct ib_grh ) /sizeof (u32); } -#define BTH2_OFFSET (offsetof(struct hfi1_pio_header, hdr.u.oth.bth[2]) / 4) +#define BTH2_OFFSET (offsetof(struct hfi1_sdma_header, hdr.u.oth.bth[2]) / 4)/** * build_ahg - create ahg in s_ahg
drivers/infiniband/hw/hfi1/verbs.c +1 -1
@@ -820,7 +820,7 @@ static int build_verbs_tx_desc( u64 pbc) {int ret =0 ; -struct hfi1_pio_header *phdr = &tx->phdr; +struct hfi1_sdma_header *phdr = &tx->phdr;u16 hdrbytes = tx->hdr_dwords <<2 ;if (!ahg_info->ahgcount) {
drivers/infiniband/hw/hfi1/verbs.h +1 -1
@@ -185,7 +185,7 @@ struct hfi1_ahg_info {u8 ahgidx; }; -struct hfi1_pio_header { +struct hfi1_sdma_header {__le64 pbc;struct hfi1_ib_header hdr; } __packed;
drivers/infiniband/hw/hfi1/verbs_txreq.h +1 -1
@@ -56,7 +56,7 @@#include "iowait.h" struct verbs_txreq { -struct hfi1_pio_header phdr; +struct hfi1_sdma_header phdr;struct sdma_txreq txreq;struct rvt_qp *qp;struct rvt_swqe *wqe;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 26/28 IB/hfi1: Cleanup UD packet handler.
In reply to a message not in the archiveFrom: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cleanup hfi1_ud_rcv to not have to look at the packet header fields multiple times. The fields are looked up once and used throughout the function. Also fix sc computation when validating MAD packets.
--- drivers/infiniband/hw/hfi1/ud.c | 51 ++++++++++++++++----------------------- 1 files changed, 21 insertions(+), 30 deletions(-)
drivers/infiniband/hw/hfi1/ud.c +21 -30
@@ -664,13 +664,13 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)struct hfi1_other_headers *ohdr = packet->ohdr;int opcode;u32 hdrsize = packet->hlen; -u32 pad;struct ib_wc wc;u32 qkey;u32 src_qp;u16 dlid, pkey;int mgmt_pkey_idx =-1 ;struct hfi1_ibport *ibp = &packet->rcd->ppd->ibport_data; +struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);struct hfi1_ib_header *hdr = packet->hdr;u32 rcv_flags = packet->rcv_flags;void *data = packet->ebuf;
@@ -678,31 +678,34 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)struct rvt_qp *qp = packet->qp;bool has_grh = rcv_flags &HFI1_HAS_GRH ;u8 sc5 =hdr2sc ((struct hfi1_message_header *)hdr, packet->rhf); +u32 bth1; +u8 sl_from_sc, sl; +u16 slid; +u8 extra_bytes; qkey =be32_to_cpu (ohdr->u.ud.deth[0 ]); src_qp =be32_to_cpu (ohdr->u.ud.deth[1 ]) &RVT_QPN_MASK ; dlid =be16_to_cpu (hdr->lrh[1 ]); + bth1 =be32_to_cpu (ohdr->bth[1 ]); + slid =be16_to_cpu (hdr->lrh[3 ]); + pkey = (u16 )be32_to_cpu (ohdr->bth[0 ]); + sl = (be16_to_cpu (hdr->lrh[0 ]) >>4 ) &0xf ; + extra_bytes = (be32_to_cpu (ohdr->bth[0 ]) >>20 ) &3 ; + extra_bytes += (SIZE_OF_CRC <<2 ); + sl_from_sc = ibp->sc_to_sl[sc5]; -/* -* The opcode is in the low byte when its in network order -* (top byte when in host order). -*/ opcode =be32_to_cpu (ohdr->bth[0 ]) >>24 ; opcode &=0xff ; - pkey = (u16 )be32_to_cpu (ohdr->bth[0 ]); -process_ecn (qp, packet, (opcode !=IB_OPCODE_CNP )); -/* * Get the number of bytes the message was padded by * and drop incomplete packets. */ - pad = (be32_to_cpu (ohdr->bth[0 ]) >>20 ) &3 ; -if (unlikely (tlen < (hdrsize + pad +4 ))) +if (unlikely (tlen < (hdrsize + extra_bytes))) goto drop; - tlen -= hdrsize + pad +4 ; + tlen -= hdrsize + extra_bytes;/* * Check that the permissive LID is only used on QP0
@@ -713,10 +716,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) hdr->lrh[3] == IB_LID_PERMISSIVE)) goto drop;if (qp->ibqp.qp_num >1 ) { -struct hfi1_pportdata *ppd =ppd_from_ibp (ibp); -u16 slid; - - slid =be16_to_cpu (hdr->lrh[3 ]);if (unlikely (rcv_pkey_check (ppd, pkey, sc5, slid))) {/* * Traps will not be sent for packets dropped
@@ -725,12 +724,9 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)* IB spec (release 1.3, section 10.9.4) */ hfi1_bad_pqkey (ibp,OPA_TRAP_BAD_P_KEY , - pkey, - (be16_to_cpu (hdr->lrh[0 ]) >>4 ) & -0xF , + pkey, sl, src_qp, qp->ibqp.qp_num, -be16_to_cpu (hdr->lrh[3 ]), -be16_to_cpu (hdr->lrh[1 ])); + slid, dlid);return ; } }else {
@@ -740,22 +736,18 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) goto drop; }if (unlikely (qkey != qp->qkey)) { -hfi1_bad_pqkey (ibp,OPA_TRAP_BAD_Q_KEY , qkey, - (be16_to_cpu (hdr->lrh[0 ]) >>4 ) &0xF , +hfi1_bad_pqkey (ibp,OPA_TRAP_BAD_Q_KEY , qkey, sl, src_qp, qp->ibqp.qp_num, -be16_to_cpu (hdr->lrh[3 ]), -be16_to_cpu (hdr->lrh[1 ])); + slid, dlid);return ; }/* Drop invalid MAD packets (see 13.5.3.1). */ if (unlikely (qp->ibqp.qp_num ==1 && - (tlen >2048 || - (be16_to_cpu (hdr->lrh[0 ]) >>12 ) ==15 ))) + (tlen >2048 || (sc5 ==0xF )))) goto drop; }else {/* Received on QP0, and so by definition, this is an SMP */ struct opa_smp *smp = (struct opa_smp *)data; -u16 slid =be16_to_cpu (hdr->lrh[3 ]);if (opa_smp_check (ibp, pkey, sc5, qp, slid, smp)) goto drop;
@@ -838,7 +830,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) qp->ibqp.qp_type == IB_QPT_SMI) {if (mgmt_pkey_idx <0 ) {if (net_ratelimit ()) { -struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);struct hfi1_devdata *dd = ppd->dd; dd_dev_err(dd, "QP type %d mgmt_pkey_idx < 0 and packet not dropped???\n",
@@ -851,8 +842,8 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) wc.pkey_index =0 ; } - wc.slid =be16_to_cpu (hdr->lrh[3 ]); - wc.sl = ibp->sc_to_sl[sc5]; + wc.slid = slid; + wc.sl = sl_from_sc;/* * Save the LMC lower bits if the destination LID is a unicast LID.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 27/28 IB/hfi1: Use hdr2sc function to calculate 5-bit SC
In reply to a message not in the archiveFrom: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
The interface is used to compute the 5-bit SC field from the LRH and the RHF bits. Modify code to use the interface instead.
--- drivers/infiniband/hw/hfi1/driver.c | 4 +--- drivers/infiniband/hw/hfi1/hfi.h | 7 +------ drivers/infiniband/hw/hfi1/verbs.c | 7 ++----- 3 files changed, 4 insertions(+), 14 deletions(-)
drivers/infiniband/hw/hfi1/driver.c +1 -3
@@ -392,9 +392,7 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,u16 rlid;u8 svc_type, sl, sc5; - sc5 = (be16_to_cpu (rhdr->lrh[0 ]) >>12 ) &0xf ; -if (rhf_dc_info (packet->rhf)) - sc5 |=0x10 ; + sc5 =hdr2sc (rhdr, packet->rhf); sl = ibp->sc_to_sl[sc5]; lqpn =be32_to_cpu (bth[1 ]) &RVT_QPN_MASK ;
drivers/infiniband/hw/hfi1/hfi.h +1 -6
@@ -368,11 +368,6 @@ struct hfi1_packet {u8 etype; }; -static inline bool has_sc4_bit (struct hfi1_packet *p) -{ -return !!rhf_dc_info (p->rhf); -} -/* * Private data for snoop/capture support. */
@@ -1273,7 +1268,7 @@ void receive_interrupt_work(struct work_struct *work);static inline int hdr2sc (struct hfi1_message_header *hdr,u64 rhf) {return ((be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ) | - ((!!(rhf &RHF_DC_INFO_SMASK )) <<4 ); + ((!!(rhf_dc_info (rhf))) <<4 ); }static inline u16 generate_jkey (kuid_t uid)
drivers/infiniband/hw/hfi1/verbs.c +2 -5
@@ -1743,8 +1743,7 @@ void hfi1_cnp_rcv(struct hfi1_packet *packet)struct rvt_qp *qp = packet->qp;u32 lqpn, rqpn =0 ;u16 rlid =0 ; -u8 sl, sc5, sc4_bit, svc_type; -bool sc4_set =has_sc4_bit (packet); +u8 sl, sc5, svc_type;switch (packet->qp->ibqp.qp_type) {case IB_QPT_UC :
@@ -1767,9 +1766,7 @@ void hfi1_cnp_rcv(struct hfi1_packet *packet)return ; } - sc4_bit = sc4_set <<4 ; - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc5 |= sc4_bit; + sc5 =hdr2sc ((struct hfi1_message_header *)hdr, packet->rhf); sl = ibp->sc_to_sl[sc5]; lqpn = qp->ibqp.qp_num;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 28/28 IB/qib, IB/hfi1: Fix grh creation in ud loopback
In reply to a message not in the archiveFrom: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Instead of copying the actual GRH of type struct ib_grh, existing code copies the struct ib_global_route into the sge. This patch fixes that and constructs the actual GRH from ib_global_route and copies the GRH into the sge.
--- drivers/infiniband/hw/hfi1/ud.c | 8 ++++++-- drivers/infiniband/hw/qib/qib_ud.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hfi1/ud.c +6 -2
@@ -184,8 +184,12 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe) }if (ah_attr->ah_flags &IB_AH_GRH ) { -hfi1_copy_sge (&qp->r_sge, &ah_attr->grh, -sizeof (struct ib_grh ),1 ,0 ); +struct ib_grh grh; +struct ib_global_route grd = ah_attr->grh; + +hfi1_make_grh (ibp, &grh, &grd,0 ,0 ); +hfi1_copy_sge (&qp->r_sge, &grh, +sizeof (grh),1 ,0 ); wc.wc_flags |=IB_WC_GRH ; }else {hfi1_skip_sge (&qp->r_sge,sizeof (struct ib_grh ),1 );
drivers/infiniband/hw/qib/qib_ud.c +6 -2
@@ -169,8 +169,12 @@ static void qib_ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe) }if (ah_attr->ah_flags &IB_AH_GRH ) { -qib_copy_sge (&qp->r_sge, &ah_attr->grh, -sizeof (struct ib_grh ),1 ); +struct ib_grh grh; +struct ib_global_route grd = ah_attr->grh; + +qib_make_grh (ibp, &grh, &grd,0 ,0 ); +qib_copy_sge (&qp->r_sge, &grh, +sizeof (grh),1 ); wc.wc_flags |=IB_WC_GRH ; }else qib_skip_sge (&qp->r_sge,sizeof (struct ib_grh ),1 );
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Dennis Dalessandro
Doug,
Here are the next set of fixes for 4.8. There is one marked as stable but it
should filter through the process and require no special handling. This is
mostly bug fixes but there are some clean ups as well.
Quoted 7 lines
This does bring in a new feature, that is to support fast register memory region
(FRMR) in rdmavt and hfi1.Patches can also be viewed in my repo at:
https://github.com/ddalessa/kernel/tree/for-4.8
Thanks Denny, series applied and duly noted that a fix to 02/28 comes in a later patch from Ira.
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD
PATCH 13/28 IB/rdmavt: Add missing spin_lock_init call for rdi->n_cqs_lock
In reply to Dennis DalessandroFrom: Jianxin Xiong <[email protected]>
This fixes the following warning with PROV_LOCKING enabled kernel:
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 15 PID: 12286 Comm: modprobe Not tainted 4.7.0-rc5.prove_rcu+ #1 Hardware name: Intel Corporation S2600WT2R/S2600WT2R, ...... Call Trace: [<ffffffff8139ec0d>] dump_stack+0x85/0xc8 [<ffffffff810eb765>] register_lock_class+0x415/0x4b0 [<ffffffff810ede1c>] ? __lock_acquire+0x40c/0x1960 [<ffffffff810edaa9>] __lock_acquire+0x99/0x1960 [<ffffffff8120ab62>] ? find_vmap_area+0x42/0x60 [<ffffffff8120ab39>] ? find_vmap_area+0x19/0x60 [<ffffffff810ef9d3>] lock_acquire+0xd3/0x200 [<ffffffffa049d598>] ? rvt_create_cq+0xc8/0x250 [rdmavt] [<ffffffff81763391>] _raw_spin_lock+0x31/0x40 [<ffffffffa049d598>] ? rvt_create_cq+0xc8/0x250 [rdmavt] [<ffffffffa049d598>] rvt_create_cq+0xc8/0x250 [rdmavt] [<ffffffff810ead46>] ? static_obj+0x36/0x50 [<ffffffffa0469e39>] ib_alloc_cq+0x49/0x180 [ib_core] [<ffffffffa047bed4>] ib_mad_init_device+0x204/0x6d0 [ib_core] [<ffffffff810e968f>] ? up_write+0x1f/0x40 [<ffffffffa046e2c0>] ib_register_device+0x3d0/0x510 [ib_core] [<ffffffffa0752410>] ? read_cc_setting_bin+0x200/0x200 [hfi1] [<ffffffff810ead46>] ? static_obj+0x36/0x50 [<ffffffff810eb888>] ? lockdep_init_map+0x88/0x200 [<ffffffffa049cbff>] rvt_register_device+0x17f/0x320 [rdmavt] [<ffffffffa0766caa>] hfi1_register_ib_device+0x6ca/0x7c0 [hfi1] [<ffffffffa0733de4>] init_one+0x2b4/0x430 [hfi1] [<ffffffff813e40a5>] local_pci_probe+0x45/0xa0 [<ffffffff813e5110>] ? pci_match_device+0xe0/0x110 [<ffffffff813e550c>] pci_device_probe+0xfc/0x140 [<ffffffff814daee9>] driver_probe_device+0x239/0x460 [<ffffffff814db1dd>] __driver_attach+0xcd/0xf0 [<ffffffff814db110>] ? driver_probe_device+0x460/0x460 [<ffffffff814d89b3>] bus_for_each_dev+0x73/0xc0 [<ffffffff814da74e>] driver_attach+0x1e/0x20 [<ffffffff814da1b3>] bus_add_driver+0x1d3/0x290 [<ffffffffa04cc114>] ? dev_init+0x114/0x114 [hfi1] [<ffffffff814dbf60>] driver_register+0x60/0xe0 [<ffffffffa04cc114>] ? dev_init+0x114/0x114 [hfi1] [<ffffffff813e39d0>] __pci_register_driver+0x60/0x70 [<ffffffffa04cc2aa>] hfi1_mod_init+0x196/0x1fe [hfi1] [<ffffffff81002190>] do_one_initcall+0x50/0x190 [<ffffffff8110be72>] ? rcu_read_lock_sched_held+0x62/0x70 [<ffffffff8122d4aa>] ? kmem_cache_alloc_trace+0x23a/0x2a0 [<ffffffff811c1881>] ? do_init_module+0x27/0x1dc [<ffffffff811c18ba>] do_init_module+0x60/0x1dc [<ffffffff811360cc>] load_module+0x132c/0x1ac0 [<ffffffff81132c40>] ? __symbol_put+0x60/0x60 [<ffffffff8133e50d>] ? ima_post_read_file+0x3d/0x80
--- drivers/infiniband/sw/rdmavt/cq.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/infiniband/sw/rdmavt/cq.c +1 -0
@@ -510,6 +510,7 @@ int rvt_driver_cq_init(struct rvt_dev_info *rdi)if (rdi->worker)return 0 ; +spin_lock_init (&rdi->n_cqs_lock); rdi->worker =kzalloc (sizeof (*rdi->worker),GFP_KERNEL );if (!rdi->worker)return -ENOMEM ;