]> git.openfabrics.org - ~emulex/compat-rdma_3.12.git/commitdiff
RDMA/cxgb4: abort connections that receive unexpected streaming mode data
authorVipul Pandya <vipul@chelsio.com>
Tue, 6 Nov 2012 15:49:47 +0000 (07:49 -0800)
committerVipul Pandya <vipul@chelsio.com>
Tue, 6 Nov 2012 15:49:47 +0000 (07:49 -0800)
This patch fixes bug 2397 in OFED bugzilla

Signed-off-by: Vipul Pandya <vipul@chelsio.com>
linux-next-pending/0018-RDMA-cxgb4-abort-connections-that-receive-unexpected.patch [new file with mode: 0644]

diff --git a/linux-next-pending/0018-RDMA-cxgb4-abort-connections-that-receive-unexpected.patch b/linux-next-pending/0018-RDMA-cxgb4-abort-connections-that-receive-unexpected.patch
new file mode 100644 (file)
index 0000000..f7c60ba
--- /dev/null
@@ -0,0 +1,58 @@
+From 7aa73de5dfc0f005c50e5c635cc08377a6c71048 Mon Sep 17 00:00:00 2001
+From: Vipul Pandya <vipul@chelsio.com>
+Date: Tue, 6 Nov 2012 20:51:23 +0530
+Subject: [PATCH] RDMA/cxgb4: abort connections that receive unexpected streaming mode data
+
+Signed-off-by: Vipul Pandya <vipul@chelsio.com>
+---
+ drivers/infiniband/hw/cxgb4/cm.c |   19 ++++++++++---------
+ 1 files changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
+index 08854b4..9b57720 100644
+--- a/drivers/infiniband/hw/cxgb4/cm.c
++++ b/drivers/infiniband/hw/cxgb4/cm.c
+@@ -1413,30 +1413,31 @@ static int rx_data(struct c4iw_dev *dev, struct sk_buff *skb)
+       skb_pull(skb, sizeof(*hdr));
+       skb_trim(skb, dlen);
+-      ep->rcv_seq += dlen;
+-      BUG_ON(ep->rcv_seq != (ntohl(hdr->seq) + dlen));
+-
+       /* update RX credits */
+       update_rx_credits(ep, dlen);
+       switch (state_read(&ep->com)) {
+       case MPA_REQ_SENT:
++              ep->rcv_seq += dlen;
+               process_mpa_reply(ep, skb);
+               break;
+       case MPA_REQ_WAIT:
++              ep->rcv_seq += dlen;
+               process_mpa_request(ep, skb);
+               break;
+-      case MPA_REP_SENT:
+-              break;
+       default:
+               pr_err("%s Unexpected streaming data." \
+                      " ep %p state %d tid %u status %d\n",
+                      __func__, ep, state_read(&ep->com), ep->hwtid, status);
+-              /*
+-               * The ep will timeout and inform the ULP of the failure.
+-               * See ep_timeout().
+-               */
++                if (ep->com.qp) {
++                        struct c4iw_qp_attributes attrs;
++
++                        attrs.next_state = C4IW_QP_STATE_ERROR;
++                        c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
++                                     C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
++                }
++                c4iw_ep_disconnect (ep, 1, GFP_KERNEL);
+               break;
+       }
+       return 0;
+-- 
+1.7.1
+