From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796398914; b=NtLDReToVOW4vizrZayV+3+ETDk6ox9+PqlZHE2dSIB2+BOU8x5g0PpgBY+cuY17hdl8 lAeiWGdx3OcJZTE+hgVMshrkV8h3qZ4V16HGyJYwpghxPOH3pKZZUXN0GYh62KdSkyHQR r9ZfJzWI73YXq82a2YFQEPw40vjYyr0g5HumLV8bUkq21orJqpLQPjuREUBK/VeeaBpgZ igta4tKtxLbWWIiw5usMMH8Eytfcd07FguJdrLWpJcysABbDZWw4DRI0zf0DgXJWQB+r0 WoJxbozpjAZOViJ9moqHnWBptyJjjuJhIlzd5DKa9Y5u6iRBYd7+d9+350zK6UMg0vw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796398914; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=4O2nTA4WZ4kYXmLt5KF3Bn56pFxI8XrFB2t5EvxcwFw=; b=udbF5v3IVNnh6uRF87dLpeUUJu7PT59M6VJREj8+1eHC4wgMGKPwyI/6vs9uEPqqrnv7 lVky5daVyTNAql3Q3szemh/txhUaHZ7y3sqM8I9w3FxiSZRb1eSlY1My48RB5XTA8iyMR 8l1iyDoudm2zldzr9olkb06+ZJQftYFbm/5SUIAFvM1pGfbsdPw1bdKUDAhs9CwLaAH5w Mh3B6+cxoTpOOE5nn+35xP0aGc1vXHlNCq7xfMSMUcG4+5iO8gNoAPsLofEnoBXrEgHxs +3dBRgVRvnUtoV9PYcV6rU1O7Z8l7l3D9/aLnHlHZVP8T2uwC+ijAEq5n4ZecowJwtg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UWW3XHma; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39CBD606A33C; Fri, 4 Dec 2026 15:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UWW3XHma Received: by smtp.kernel.org (Postfix) with ESMTPSA id 341B71F000C2; Fri, 4 Dec 2026 15:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796398914; bh=4O2nTA4WZ4kYXmLt5KF3Bn56pFxI8XrFB2t5EvxcwFw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=UWW3XHmaukhowzHPP19f9yls75oGu+Vkx7MrGYeDs2++hfkUbkb0hEoUp9vbbS5Q+ Jir2GTOWcVVcnF3R4CLTxtJ9hdUK+7zdyCWGySNKcAH9Beq9TZjuIgdrmE8RcsXSdl C7qHHRsGX2T/ncv4Klq/Of47ndwb1mm5mVLsiyeS+YtZTj5ZNdYFjxWcocAAxIqbN5 M6eYOZzFZfjf6gAXko3+df3BhCFAN0AOcjLjQ0wREe+yxnuOZFZYHRA7NJJCWobU3P d6O0hVjsQF77kOLOzUkFaqtFEDmqqGY4zt95lPgdWqzKdlQLr3tUYUHmAeYdjTr3zr z+t4K8TYscGKA== Subject: Re: [PATCH net-next v2 2/4] net/smc: check the ADD_LINK_CONT send result in the server rkey exchange From: netdev-bot+sashiko@kernel.org To: ermenson.sec@gmail.com Cc: alibuda@linux.alibaba.com, dust.li@linux.alibaba.com, sidraya@linux.ibm.com, mjambigi@linux.ibm.com, 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 Date: Fri, 04 Dec 2026 15:41:52 +0000 Message-ID: <179639891276.3146.3933202468528297356@kernel.org> In-Reply-To: <20261203153514.1440337-3-ermenson.sec@gmail.com> References: <20261203153514.1440337-3-ermenson.sec@gmail.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The commit message for "net/smc: check the ADD_LINK_CONT send result in the server rkey exchange" overstates the bug. -- net/smc: check the ADD_LINK_CONT send result in the server rkey exchange This patch makes smc_llc_srv_rkey_exchange() check the return value of smc_llc_add_link_cont() and leave the loop when the send fails, which matches smc_llc_cli_rkey_exchange(). Before the patch, the server side ignored the send result and called smc_llc_wait() anyway. > 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. [Severity: Low] Is "can only end in the wait timing out" accurate for most send failures? smc_llc_wait() is called with a non-NULL link. wait_event_timeout() checks its wake condition before it sleeps: net/smc/smc_llc.c:smc_llc_wait() { wait_event_timeout(lgr->llc_msg_waiter, (flow->qentry || (lnk && !smc_link_usable(lnk)) || list_empty(&lgr->list)), time_out); ... } If smc_wr_tx_link_hold() fails, smc_llc_add_link_cont() returns -ENOLINK. In that case the link is not sendable (INACTIVE or UNUSED), so smc_link_usable() is already false and the wait returns immediately. There are two other failure paths: ib_post_send() failing in smc_wr_tx_send(), and the free slot wait in smc_wr_tx_get_free_slot() timing out with -EPIPE. Both call smcr_link_down_cond_sched() synchronously: net/smc/smc_core.c:smcr_link_down_cond_sched() { if (smc_link_downing(&lnk->state)) { ... } smc_link_downing() does cmpxchg(state, SMC_LNK_ACTIVE, SMC_LNK_INACTIVE). The link is therefore already INACTIVE when smc_llc_wait() is entered, so the wait again returns without sleeping. A full SMC_LLC_WAIT_TIME wait seems to happen only in narrower cases: - the link is still ACTIVE but its QP is not in RTS (-ENOLINK or -EPIPE) - the lgr is terminating but still on the list (-EBUSY) The only caller, smc_llc_srv_add_link(), handles every non-zero rc the same way: rc = smc_llc_srv_rkey_exchange(link, link_new); if (rc) goto out_err; So the patch seems to have two visible effects. The errno changes from -ETIMEDOUT to the send error, and the narrow cases above fail sooner. No exchange that used to succeed now fails, and none that used to fail now succeeds. The code change looks correct and matches smc_llc_cli_rkey_exchange(). Since the patch carries a Fixes: tag, could the commit message say that the effect is limited to the errno and the shorter failure time in those cases? -- Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203153514.1440337-1-ermenson.sec%40gmail.com