diff options
author | Karsten Graul <kgraul@linux.ibm.com> | 2020-05-01 12:48:05 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-02 01:20:04 +0200 |
commit | d550066776aae3bb31e0240cab24f62e33c47fd3 (patch) | |
tree | 00ec1288640766d1124baa26c72ec2f0a16638aa /net/smc/smc_llc.c | |
parent | net/smc: extend smc_llc_send_add_link() and smc_llc_send_delete_link() (diff) | |
download | linux-d550066776aae3bb31e0240cab24f62e33c47fd3.tar.xz linux-d550066776aae3bb31e0240cab24f62e33c47fd3.zip |
net/smc: mutex to protect the lgr against parallel reconfigurations
Introduce llc_conf_mutex in the link group which is used to protect the
buffers and lgr states against parallel link reconfiguration.
This ensures that new connections do not start to register buffers with
the links of a link group when link creation or termination is running.
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_llc.c')
-rw-r--r-- | net/smc/smc_llc.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c index 171835926db6..ceed3c89926f 100644 --- a/net/smc/smc_llc.c +++ b/net/smc/smc_llc.c @@ -848,6 +848,7 @@ void smc_llc_lgr_init(struct smc_link_group *lgr, struct smc_sock *smc) spin_lock_init(&lgr->llc_event_q_lock); spin_lock_init(&lgr->llc_flow_lock); init_waitqueue_head(&lgr->llc_waiter); + mutex_init(&lgr->llc_conf_mutex); lgr->llc_testlink_time = net->ipv4.sysctl_tcp_keepalive_time; } @@ -897,9 +898,6 @@ int smc_llc_do_confirm_rkey(struct smc_link *send_link, struct smc_llc_qentry *qentry = NULL; int rc = 0; - rc = smc_llc_flow_initiate(lgr, SMC_LLC_FLOW_RKEY); - if (rc) - return rc; rc = smc_llc_send_confirm_rkey(send_link, rmb_desc); if (rc) goto out; @@ -911,7 +909,6 @@ int smc_llc_do_confirm_rkey(struct smc_link *send_link, out: if (qentry) smc_llc_flow_qentry_del(&lgr->llc_flow_lcl); - smc_llc_flow_stop(lgr, &lgr->llc_flow_lcl); return rc; } @@ -927,9 +924,6 @@ int smc_llc_do_delete_rkey(struct smc_link_group *lgr, if (!send_link) return -ENOLINK; - rc = smc_llc_flow_initiate(lgr, SMC_LLC_FLOW_RKEY); - if (rc) - return rc; /* protected by llc_flow control */ rc = smc_llc_send_delete_rkey(send_link, rmb_desc); if (rc) @@ -942,7 +936,6 @@ int smc_llc_do_delete_rkey(struct smc_link_group *lgr, out: if (qentry) smc_llc_flow_qentry_del(&lgr->llc_flow_lcl); - smc_llc_flow_stop(lgr, &lgr->llc_flow_lcl); return rc; } |