summaryrefslogtreecommitdiffstats
path: root/net/smc/smc_core.c
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.vnet.ibm.com>2018-01-25 11:15:35 +0100
committerDavid S. Miller <davem@davemloft.net>2018-01-25 16:10:42 -0500
commit732720fafdb04ad8daec36ba7f09b44641ebc13f (patch)
tree0b4f8d0b1e745bd79b929852c5353dc34326bd38 /net/smc/smc_core.c
parent610db66f377cf99aa07a2b1990727238f2e2d6d3 (diff)
downloadlinux-732720fafdb04ad8daec36ba7f09b44641ebc13f.tar.gz
linux-732720fafdb04ad8daec36ba7f09b44641ebc13f.tar.bz2
linux-732720fafdb04ad8daec36ba7f09b44641ebc13f.zip
net/smc: wake up wr_reg_wait when terminating a link group
If a new connection with a new rmb is added to a link group, its memory region is registered. If a link group is terminated, a pending registration requires a wake up. And consolidate setting of tx_flag peer_conn_abort in smc_lgr_terminate(). Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_core.c')
-rw-r--r--net/smc/smc_core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index 7406cbb41856..ed5b46d1fe41 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -234,9 +234,7 @@ static void smc_buf_unuse(struct smc_connection *conn)
/* remove a finished connection from its link group */
void smc_conn_free(struct smc_connection *conn)
{
- struct smc_link_group *lgr = conn->lgr;
-
- if (!lgr)
+ if (!conn->lgr)
return;
smc_cdc_tx_dismiss_slots(conn);
smc_lgr_unregister_conn(conn);
@@ -331,12 +329,16 @@ void smc_lgr_terminate(struct smc_link_group *lgr)
conn = rb_entry(node, struct smc_connection, alert_node);
smc = container_of(conn, struct smc_sock, conn);
sock_hold(&smc->sk);
+ conn->local_tx_ctrl.conn_state_flags.peer_conn_abort = 1;
__smc_lgr_unregister_conn(conn);
+ write_unlock_bh(&lgr->conns_lock);
schedule_work(&conn->close_work);
+ write_lock_bh(&lgr->conns_lock);
sock_put(&smc->sk);
node = rb_first(&lgr->conns_all);
}
write_unlock_bh(&lgr->conns_lock);
+ wake_up(&lgr->lnk[SMC_SINGLE_LINK].wr_reg_wait);
}
/* Determine vlan of internal TCP socket.