aboutsummaryrefslogtreecommitdiff
path: root/net/smc
diff options
context:
space:
mode:
authorDust Li2021-12-31 14:08:53 +0800
committerDavid S. Miller2022-01-02 16:08:38 +0000
commit1f52a9380ff19b6fc00c1614488d5940773ba3ab (patch)
treec16273c298548134fac3831d82f4433dd3eae4a3 /net/smc
parentc95e078069bf9bfcb66272fac162c79be6c9170b (diff)
net/smc: add comments for smc_link_{usable|sendable}
Add comments for both smc_link_sendable() and smc_link_usable() to help better distinguish and use them. No function changes. Signed-off-by: Dust Li <dust.li@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc')
-rw-r--r--net/smc/smc_core.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h
index 1e4e90faf657..e778f97da700 100644
--- a/net/smc/smc_core.h
+++ b/net/smc/smc_core.h
@@ -409,7 +409,13 @@ static inline struct smc_connection *smc_lgr_find_conn(
return res;
}
-/* returns true if the specified link is usable */
+/*
+ * Returns true if the specified link is usable.
+ *
+ * usable means the link is ready to receive RDMA messages, map memory
+ * on the link, etc. This doesn't ensure we are able to send RDMA messages
+ * on this link, if sending RDMA messages is needed, use smc_link_sendable()
+ */
static inline bool smc_link_usable(struct smc_link *lnk)
{
if (lnk->state == SMC_LNK_UNUSED || lnk->state == SMC_LNK_INACTIVE)
@@ -417,6 +423,15 @@ static inline bool smc_link_usable(struct smc_link *lnk)
return true;
}
+/*
+ * Returns true if the specified link is ready to receive AND send RDMA
+ * messages.
+ *
+ * For the client side in first contact, the underlying QP may still in
+ * RESET or RTR when the link state is ACTIVATING, checks in smc_link_usable()
+ * is not strong enough. For those places that need to send any CDC or LLC
+ * messages, use smc_link_sendable(), otherwise, use smc_link_usable() instead
+ */
static inline bool smc_link_sendable(struct smc_link *lnk)
{
return smc_link_usable(lnk) &&