Commit a35fffbf authored by Karsten Graul's avatar Karsten Graul Committed by David S. Miller

net/smc: handle unexpected response types for confirm link

A delete link could arrive during confirm link processing. Handle this
situation directly in smc_llc_srv_conf_link() rather than using the
logic in smc_llc_wait() to avoid the unexpected message handling there.
Reviewed-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Fixes: 1551c95b ("net/smc: final part of add link processing as SMC server")
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9b873778
...@@ -1051,12 +1051,14 @@ static int smc_llc_srv_conf_link(struct smc_link *link, ...@@ -1051,12 +1051,14 @@ static int smc_llc_srv_conf_link(struct smc_link *link,
if (rc) if (rc)
return -ENOLINK; return -ENOLINK;
/* receive CONFIRM LINK response over the RoCE fabric */ /* receive CONFIRM LINK response over the RoCE fabric */
qentry = smc_llc_wait(lgr, link, SMC_LLC_WAIT_FIRST_TIME, qentry = smc_llc_wait(lgr, link, SMC_LLC_WAIT_FIRST_TIME, 0);
SMC_LLC_CONFIRM_LINK); if (!qentry ||
if (!qentry) { qentry->msg.raw.hdr.common.type != SMC_LLC_CONFIRM_LINK) {
/* send DELETE LINK */ /* send DELETE LINK */
smc_llc_send_delete_link(link, link_new->link_id, SMC_LLC_REQ, smc_llc_send_delete_link(link, link_new->link_id, SMC_LLC_REQ,
false, SMC_LLC_DEL_LOST_PATH); false, SMC_LLC_DEL_LOST_PATH);
if (qentry)
smc_llc_flow_qentry_del(&lgr->llc_flow_lcl);
return -ENOLINK; return -ENOLINK;
} }
smc_llc_save_peer_uid(qentry); smc_llc_save_peer_uid(qentry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment