Netdev List
 help / color / mirror / Atom feed
From: Ermenson Junior <ermenson.sec@gmail.com>
To: alibuda@linux.alibaba.com, dust.li@linux.alibaba.com,
	sidraya@linux.ibm.com, mjambigi@linux.ibm.com
Cc: tonylu@linux.alibaba.com, guwen@linux.alibaba.com,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, willemb@google.com, horms@kernel.org,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: [PATCH net-next v2 2/4] net/smc: check the ADD_LINK_CONT send result in the server rkey exchange
Date: Thu,  3 Dec 2026 12:35:12 -0300	[thread overview]
Message-ID: <20261203153514.1440337-3-ermenson.sec@gmail.com> (raw)
In-Reply-To: <20261203153514.1440337-1-ermenson.sec@gmail.com>

smc_llc_cli_rkey_exchange() checks what smc_llc_add_link_cont() returns
and leaves the loop when the send fails:

	rc = smc_llc_add_link_cont(link, link_new, &num_rkeys_send,
				   &buf_lst, &buf_pos);
	if (rc)
		break;

smc_llc_srv_rkey_exchange() discards it and goes on to wait for a reply
to a message that was never transmitted, so the round can only end in
the wait timing out. Make the server side behave like the client side.

This is independent of the bounding in the previous patch and can be
dropped or deferred without affecting it.

This patch was written with the help of an AI coding assistant (Claude).

Fixes: 57b499242cb8 ("net/smc: rkey processing for a new link as SMC
server")

Signed-off-by: Ermenson Junior <ermenson.sec@gmail.com>
---
 net/smc/smc_llc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
index 818dd84e720f..e41011d19b73 100644
--- a/net/smc/smc_llc.c
+++ b/net/smc/smc_llc.c
@@ -1400,8 +1400,10 @@ static int smc_llc_srv_rkey_exchange(struct smc_link *link,
 		if (timeo > SMC_LLC_WAIT_TIME)
 			timeo = SMC_LLC_WAIT_TIME;
 
-		smc_llc_add_link_cont(link, link_new, &num_rkeys_send,
-				      &buf_lst, &buf_pos);
+		rc = smc_llc_add_link_cont(link, link_new, &num_rkeys_send,
+					   &buf_lst, &buf_pos);
+		if (rc)
+			goto out;
 		qentry = smc_llc_wait(lgr, link, timeo, SMC_LLC_ADD_LINK_CONT);
 		if (!qentry) {
 			rc = -ETIMEDOUT;
-- 
2.43.0


  parent reply	other threads:[~2026-12-03 15:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 15:35 [PATCH net-next v2 0/4] net/smc: stop a silent peer stalling every server handshake Ermenson Junior
2026-12-03 15:35 ` [PATCH net-next v2 1/4] net/smc: bound the SMC-Rv1 add-link rkey exchange Ermenson Junior
2026-12-03 15:35 ` Ermenson Junior [this message]
2026-12-03 15:35 ` [PATCH net-next v2 3/4] net/smc: set a new link's peer gid and mac at creation Ermenson Junior
2026-12-03 15:35 ` [PATCH net-next v2 4/4] net/smc: drop smc_server_lgr_pending across the CLC CONFIRM wait Ermenson Junior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203153514.1440337-3-ermenson.sec@gmail.com \
    --to=ermenson.sec@gmail.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=edumazet@kernel.org \
    --cc=guwen@linux.alibaba.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjambigi@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sidraya@linux.ibm.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox