Skip to content

Commit b4772b3

Browse files
Ursula Braundavem330
authored andcommitted
net/smc: terminate link group for ib_post_send problems
If ib_post_send() fails, terminate all connections of this link group. Signed-off-by: Ursula Braun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5ac92a0 commit b4772b3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

net/smc/smc_tx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ static int smc_tx_rdma_write(struct smc_connection *conn, int peer_rmbe_offset,
248248
peer_rmbe_offset;
249249
rdma_wr.rkey = lgr->rtokens[conn->rtoken_idx][SMC_SINGLE_LINK].rkey;
250250
rc = ib_post_send(link->roce_qp, &rdma_wr.wr, &failed_wr);
251-
if (rc)
251+
if (rc) {
252252
conn->local_tx_ctrl.conn_state_flags.peer_conn_abort = 1;
253+
smc_lgr_terminate(lgr);
254+
}
253255
return rc;
254256
}
255257

net/smc/smc_wr.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,14 @@ int smc_wr_tx_send(struct smc_link *link, struct smc_wr_tx_pend_priv *priv)
248248
pend = container_of(priv, struct smc_wr_tx_pend, priv);
249249
rc = ib_post_send(link->roce_qp, &link->wr_tx_ibs[pend->idx],
250250
&failed_wr);
251-
if (rc)
251+
if (rc) {
252+
struct smc_link_group *lgr =
253+
container_of(link, struct smc_link_group,
254+
lnk[SMC_SINGLE_LINK]);
255+
252256
smc_wr_tx_put_slot(link, priv);
257+
smc_lgr_terminate(lgr);
258+
}
253259
return rc;
254260
}
255261

0 commit comments

Comments
 (0)