Skip to content

Commit dec6b33

Browse files
RajuRangojudavem330
authored andcommitted
cxgb4: notify uP to route ctrlq compl to rdma rspq
During the module initialisation there is a possible race (basically race between uld and lld) where neither the uld nor lld notifies the uP about where to route the ctrl queue completions. LLD skips notifying uP as the rdma queues were not created by then (will leave it to ULD to notify the uP). As the ULD comes up, it also skips notifying the uP as the flag FULL_INIT_DONE is not set yet (ULD assumes that the interface is not up yet). Consequently, this race between uld and lld leaves uP unnotified about where to send the ctrl queue completions to, leading to iwarp RI_RES WR failure. Here is the race: CPU 0 CPU1 - allocates nic rx queus - t4_sge_alloc_ctrl_txq() (if rdma rsp queues exists, tell uP to route ctrl queue compl to rdma rspq) - acquires the mutex_lock - allocates rdma response queues - if FULL_INIT_DONE set, tell uP to route ctrl queue compl to rdma rspq - relinquishes mutex_lock - acquires the mutex_lock - enable_rx() - set FULL_INIT_DONE - relinquishes mutex_lock This patch fixes the above issue. Fixes: e7519f9('cxgb4: avoid enabling napi twice to the same queue') Signed-off-by: Raju Rangoju <[email protected]> Acked-by: Steve Wise <[email protected]> CC: Stable <[email protected]> # 4.9+ Signed-off-by: Ganesh Goudar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4b153ca commit dec6b33

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,9 +2171,10 @@ static int cxgb_up(struct adapter *adap)
21712171
{
21722172
int err;
21732173

2174+
mutex_lock(&uld_mutex);
21742175
err = setup_sge_queues(adap);
21752176
if (err)
2176-
goto out;
2177+
goto rel_lock;
21772178
err = setup_rss(adap);
21782179
if (err)
21792180
goto freeq;
@@ -2197,7 +2198,6 @@ static int cxgb_up(struct adapter *adap)
21972198
goto irq_err;
21982199
}
21992200

2200-
mutex_lock(&uld_mutex);
22012201
enable_rx(adap);
22022202
t4_sge_start(adap);
22032203
t4_intr_enable(adap);
@@ -2210,13 +2210,15 @@ static int cxgb_up(struct adapter *adap)
22102210
#endif
22112211
/* Initialize hash mac addr list*/
22122212
INIT_LIST_HEAD(&adap->mac_hlist);
2213-
out:
22142213
return err;
2214+
22152215
irq_err:
22162216
dev_err(adap->pdev_dev, "request_irq failed, err %d\n", err);
22172217
freeq:
22182218
t4_free_sge_resources(adap);
2219-
goto out;
2219+
rel_lock:
2220+
mutex_unlock(&uld_mutex);
2221+
return err;
22202222
}
22212223

22222224
static void cxgb_down(struct adapter *adapter)

0 commit comments

Comments
 (0)