public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] iw_cxgb4: limit IRD/ORD advertised to ULP by device max.
       [not found] ` <cover.1471617103.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
@ 2016-08-19 14:29   ` Steve Wise
  2016-08-19 14:29   ` [PATCH v2 2/2] iw_cxgb4: use the MPA initiator's IRD if < our ORD Steve Wise
  2016-08-22 18:44   ` [PATCH v2 0/2] cxgb4/i40iw interoperability fixes Doug Ledford
  2 siblings, 0 replies; 4+ messages in thread
From: Steve Wise @ 2016-08-19 14:29 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w

The i40iw initiator sends an MPA-request with ird = 63, ord = 63. The
cxgb4 responder sends a RST.  Since the inbound ord=63 and it exceeds
the max_ird/c4iw_max_read_depth (=32 default), chelsio decides to abort.

Instead, cxgb4 should adjust the ord/ird down before presenting it to
the ULP.

Reported-by: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/infiniband/hw/cxgb4/cm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 3aca7f6..a698efc 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1827,8 +1827,12 @@ static int process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb)
 				(ep->mpa_pkt + sizeof(*mpa));
 			ep->ird = ntohs(mpa_v2_params->ird) &
 				MPA_V2_IRD_ORD_MASK;
+			ep->ird = min_t(u32, ep->ird,
+					cur_max_read_depth(ep->com.dev));
 			ep->ord = ntohs(mpa_v2_params->ord) &
 				MPA_V2_IRD_ORD_MASK;
+			ep->ord = min_t(u32, ep->ord,
+					cur_max_read_depth(ep->com.dev));
 			PDBG("%s initiator ird %u ord %u\n", __func__, ep->ird,
 			     ep->ord);
 			if (ntohs(mpa_v2_params->ird) & MPA_V2_PEER2PEER_MODEL)
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] iw_cxgb4: use the MPA initiator's IRD if < our ORD
       [not found] ` <cover.1471617103.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
  2016-08-19 14:29   ` [PATCH v2 1/2] iw_cxgb4: limit IRD/ORD advertised to ULP by device max Steve Wise
@ 2016-08-19 14:29   ` Steve Wise
  2016-08-22 18:44   ` [PATCH v2 0/2] cxgb4/i40iw interoperability fixes Doug Ledford
  2 siblings, 0 replies; 4+ messages in thread
From: Steve Wise @ 2016-08-19 14:29 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w

The i40iw initiator sends an MPA-request with ird=16 and ord=16. The cxgb4
responder sends an MPA-reply with ord = 32 causing i40iw to terminate
due to insufficient resources.

The logic to reduce the ORD to <= peer's IRD was wrong.

Reported-by: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/infiniband/hw/cxgb4/cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index a698efc..b6a953a 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -3140,7 +3140,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
 	if (ep->mpa_attr.version == 2 && ep->mpa_attr.enhanced_rdma_conn) {
 		if (conn_param->ord > ep->ird) {
 			if (RELAXED_IRD_NEGOTIATION) {
-				ep->ord = ep->ird;
+				conn_param->ord = ep->ird;
 			} else {
 				ep->ird = conn_param->ird;
 				ep->ord = conn_param->ord;
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 0/2] cxgb4/i40iw interoperability fixes
@ 2016-08-19 14:31 Steve Wise
       [not found] ` <cover.1471617103.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Wise @ 2016-08-19 14:31 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w

Doug, these would be good for 4.8-rc.  They fix some interoperability
problems between Intel and Chelsio iWARP devices.

Changes since v1:

- cleaned up commit comments.

Steve Wise (2):
  iw_cxgb4: limit IRD/ORD advertised to ULP by device max.
  iw_cxgb4: use the MPA initiator's IRD if < our ORD

 drivers/infiniband/hw/cxgb4/cm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] cxgb4/i40iw interoperability fixes
       [not found] ` <cover.1471617103.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
  2016-08-19 14:29   ` [PATCH v2 1/2] iw_cxgb4: limit IRD/ORD advertised to ULP by device max Steve Wise
  2016-08-19 14:29   ` [PATCH v2 2/2] iw_cxgb4: use the MPA initiator's IRD if < our ORD Steve Wise
@ 2016-08-22 18:44   ` Doug Ledford
  2 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2016-08-22 18:44 UTC (permalink / raw)
  To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w


[-- Attachment #1.1: Type: text/plain, Size: 605 bytes --]

On 8/19/2016 10:31 AM, Steve Wise wrote:
> Doug, these would be good for 4.8-rc.  They fix some interoperability
> problems between Intel and Chelsio iWARP devices.
> 
> Changes since v1:
> 
> - cleaned up commit comments.
> 
> Steve Wise (2):
>   iw_cxgb4: limit IRD/ORD advertised to ULP by device max.
>   iw_cxgb4: use the MPA initiator's IRD if < our ORD
> 
>  drivers/infiniband/hw/cxgb4/cm.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 

Thanks, series applied.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-22 18:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-19 14:31 [PATCH v2 0/2] cxgb4/i40iw interoperability fixes Steve Wise
     [not found] ` <cover.1471617103.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2016-08-19 14:29   ` [PATCH v2 1/2] iw_cxgb4: limit IRD/ORD advertised to ULP by device max Steve Wise
2016-08-19 14:29   ` [PATCH v2 2/2] iw_cxgb4: use the MPA initiator's IRD if < our ORD Steve Wise
2016-08-22 18:44   ` [PATCH v2 0/2] cxgb4/i40iw interoperability fixes Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox