Skip to content

Commit

Permalink
net/smc: fix handling of delete link requests
Browse files Browse the repository at this point in the history
As smc client the delete link requests are assigned to the flow when
_any_ flow is active. This may break other flows that do not expect
delete link requests during their handling. Fix that by assigning the
request only when an add link flow is active. With that fix the code
for smc client and smc server is the same, so remove the separate
handling.

Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Fixes: 9ec6bf1 ("net/smc: llc_del_link_work and use the LLC flow for delete link")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Karsten Graul authored and David S. Miller committed Jul 19, 2020
1 parent c48254f commit b9979c2
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions net/smc/smc_llc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1544,28 +1544,13 @@ static void smc_llc_event_handler(struct smc_llc_qentry *qentry)
}
break;
case SMC_LLC_DELETE_LINK:
if (lgr->role == SMC_CLNT) {
/* server requests to delete this link, send response */
if (lgr->llc_flow_lcl.type != SMC_LLC_FLOW_NONE) {
/* DEL LINK REQ during ADD LINK SEQ */
smc_llc_flow_qentry_set(&lgr->llc_flow_lcl,
qentry);
wake_up(&lgr->llc_msg_waiter);
} else if (smc_llc_flow_start(&lgr->llc_flow_lcl,
qentry)) {
schedule_work(&lgr->llc_del_link_work);
}
} else {
if (lgr->llc_flow_lcl.type == SMC_LLC_FLOW_ADD_LINK &&
!lgr->llc_flow_lcl.qentry) {
/* DEL LINK REQ during ADD LINK SEQ */
smc_llc_flow_qentry_set(&lgr->llc_flow_lcl,
qentry);
wake_up(&lgr->llc_msg_waiter);
} else if (smc_llc_flow_start(&lgr->llc_flow_lcl,
qentry)) {
schedule_work(&lgr->llc_del_link_work);
}
if (lgr->llc_flow_lcl.type == SMC_LLC_FLOW_ADD_LINK &&
!lgr->llc_flow_lcl.qentry) {
/* DEL LINK REQ during ADD LINK SEQ */
smc_llc_flow_qentry_set(&lgr->llc_flow_lcl, qentry);
wake_up(&lgr->llc_msg_waiter);
} else if (smc_llc_flow_start(&lgr->llc_flow_lcl, qentry)) {
schedule_work(&lgr->llc_del_link_work);
}
return;
case SMC_LLC_CONFIRM_RKEY:
Expand Down

0 comments on commit b9979c2

Please sign in to comment.