aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorVipul Pandya <vipul@chelsio.com>2013-01-07 08:11:58 -0500
committerRoland Dreier <roland@purestorage.com>2013-02-14 18:51:57 -0500
commit7c0a33d61187a413f29f63d106b503b9c91680e8 (patch)
treeefb14ae0f425ea51df5c62a8fd3bd34069df12a5 /drivers/infiniband
parentfe7e0a4dd0304745b57e08827fde13e1c2376e66 (diff)
RDMA/cxgb4: Don't wakeup threads for MPAv2
Don't wakeup threads blocked in rdma_init/rdma_fini if we are on MPAv2, and want to retry connection with MPAv1. Stop ep-timer on getting MPA version mismatch, before doing the abort_connection - in process_mpa_request. Take care to stop ep-timer in error paths for process_mpa_request. Signed-off-by: Vipul Pandya <vipul@chelsio.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 88933af05c5c..06c3a527d6f8 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1300,11 +1300,13 @@ static void process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb)
1300 if (mpa->revision > mpa_rev) { 1300 if (mpa->revision > mpa_rev) {
1301 printk(KERN_ERR MOD "%s MPA version mismatch. Local = %d," 1301 printk(KERN_ERR MOD "%s MPA version mismatch. Local = %d,"
1302 " Received = %d\n", __func__, mpa_rev, mpa->revision); 1302 " Received = %d\n", __func__, mpa_rev, mpa->revision);
1303 stop_ep_timer(ep);
1303 abort_connection(ep, skb, GFP_KERNEL); 1304 abort_connection(ep, skb, GFP_KERNEL);
1304 return; 1305 return;
1305 } 1306 }
1306 1307
1307 if (memcmp(mpa->key, MPA_KEY_REQ, sizeof(mpa->key))) { 1308 if (memcmp(mpa->key, MPA_KEY_REQ, sizeof(mpa->key))) {
1309 stop_ep_timer(ep);
1308 abort_connection(ep, skb, GFP_KERNEL); 1310 abort_connection(ep, skb, GFP_KERNEL);
1309 return; 1311 return;
1310 } 1312 }
@@ -1315,6 +1317,7 @@ static void process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb)
1315 * Fail if there's too much private data. 1317 * Fail if there's too much private data.
1316 */ 1318 */
1317 if (plen > MPA_MAX_PRIVATE_DATA) { 1319 if (plen > MPA_MAX_PRIVATE_DATA) {
1320 stop_ep_timer(ep);
1318 abort_connection(ep, skb, GFP_KERNEL); 1321 abort_connection(ep, skb, GFP_KERNEL);
1319 return; 1322 return;
1320 } 1323 }
@@ -1323,6 +1326,7 @@ static void process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb)
1323 * If plen does not account for pkt size 1326 * If plen does not account for pkt size
1324 */ 1327 */
1325 if (ep->mpa_pkt_len > (sizeof(*mpa) + plen)) { 1328 if (ep->mpa_pkt_len > (sizeof(*mpa) + plen)) {
1329 stop_ep_timer(ep);
1326 abort_connection(ep, skb, GFP_KERNEL); 1330 abort_connection(ep, skb, GFP_KERNEL);
1327 return; 1331 return;
1328 } 1332 }
@@ -3286,8 +3290,14 @@ static int peer_abort_intr(struct c4iw_dev *dev, struct sk_buff *skb)
3286 3290
3287 /* 3291 /*
3288 * Wake up any threads in rdma_init() or rdma_fini(). 3292 * Wake up any threads in rdma_init() or rdma_fini().
3293 * However, if we are on MPAv2 and want to retry with MPAv1
3294 * then, don't wake up yet.
3289 */ 3295 */
3290 c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET); 3296 if (mpa_rev == 2 && !ep->tried_with_mpa_v1) {
3297 if (ep->com.state != MPA_REQ_SENT)
3298 c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET);
3299 } else
3300 c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET);
3291 sched(dev, skb); 3301 sched(dev, skb);
3292 return 0; 3302 return 0;
3293} 3303}