Skip to content

Commit

Permalink
net/smc: handle unexpected response types for confirm link
Browse files Browse the repository at this point in the history
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: Ursula Braun <[email protected]>
Fixes: 1551c95 ("net/smc: final part of add link processing as SMC server")
Signed-off-by: Karsten Graul <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
karstengr authored and davem330 committed Jul 19, 2020
1 parent 9b87377 commit a35fffb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/smc/smc_llc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,12 +1051,14 @@ static int smc_llc_srv_conf_link(struct smc_link *link,
if (rc)
return -ENOLINK;
/* receive CONFIRM LINK response over the RoCE fabric */
qentry = smc_llc_wait(lgr, link, SMC_LLC_WAIT_FIRST_TIME,
SMC_LLC_CONFIRM_LINK);
if (!qentry) {
qentry = smc_llc_wait(lgr, link, SMC_LLC_WAIT_FIRST_TIME, 0);
if (!qentry ||
qentry->msg.raw.hdr.common.type != SMC_LLC_CONFIRM_LINK) {
/* send DELETE LINK */
smc_llc_send_delete_link(link, link_new->link_id, SMC_LLC_REQ,
false, SMC_LLC_DEL_LOST_PATH);
if (qentry)
smc_llc_flow_qentry_del(&lgr->llc_flow_lcl);
return -ENOLINK;
}
smc_llc_save_peer_uid(qentry);
Expand Down

0 comments on commit a35fffb

Please sign in to comment.