diff options
author | Karsten Graul <kgraul@linux.ibm.com> | 2020-04-29 17:10:43 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-29 12:26:32 -0700 |
commit | d854fcbfaeda9748c85de296fbe07b7763a1939c (patch) | |
tree | c056b8e27021556cc3b69dae521c3b1ef5ccfc63 /net/smc/smc_wr.c | |
parent | e07d31dc16b0d77ff6b3f71cafe3a825fb80bed4 (diff) |
net/smc: add new link state and related helpers
Before a link can be reused it must have been cleared. Lowest current
link state is INACTIVE, which does not mean that the link is already
cleared.
Add a new state UNUSED that is set when the link is cleared and can be
reused.
Add helper smc_llc_usable_link() to find an active link in a link group,
and smc_link_usable() to determine if a link is usable.
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_wr.c')
-rw-r--r-- | net/smc/smc_wr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/smc/smc_wr.c b/net/smc/smc_wr.c index 337ee52ad3d3..93223628c002 100644 --- a/net/smc/smc_wr.c +++ b/net/smc/smc_wr.c @@ -207,7 +207,7 @@ int smc_wr_tx_get_free_slot(struct smc_link *link, } else { rc = wait_event_interruptible_timeout( link->wr_tx_wait, - link->state == SMC_LNK_INACTIVE || + !smc_link_usable(link) || lgr->terminating || (smc_wr_tx_get_free_slot_index(link, &idx) != -EBUSY), SMC_WR_TX_WAIT_FREE_SLOT_TIME); |