Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: hexlabsecurity@proton.me
Cc: edumazet@kernel.org, pabeni@redhat.com, davem@davemloft.net,
	kuba@kernel.org, mjambigi@linux.ibm.com, sidraya@linux.ibm.com,
	alibuda@linux.alibaba.com, willemb@google.com,
	dust.li@linux.alibaba.com, guwen@linux.alibaba.com,
	guangguan.wang@linux.alibaba.com, tonylu@linux.alibaba.com,
	ubraun@linux.ibm.com, linux-rdma@vger.kernel.org,
	linux-s390@vger.kernel.org, hidayath@linux.ibm.com,
	horms@kernel.org, wenjia@linux.ibm.com,
	linux-kernel@vger.kernel.org, raspl@linux.ibm.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net v3 7/7] net/smc: skip the urgent byte when it is the next unread byte
Date: Fri, 04 Dec 2026 09:49:32 +0000	[thread overview]
Message-ID: <179637777294.3146.2610356583355852527@kernel.org> (raw)
In-Reply-To: <20261203-b4-disp-ba1ad55e-v3-7-6834ff90c5d0@proton.me>

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 stable backport prerequisites are not stated.
- [Low] The patch changes what urg_rx_skip_pend means but leaves its
  definition comment alone.

--

net/smc: skip the urgent byte when it is the next unread byte

With this patch, smc_rx_recv_urg() sets urg_rx_skip_pend whenever the
reader has not yet passed the urgent byte. Before, it was set only when
regular data was in front of that byte. The patch also calls
smc_rx_update_consumer() for a zero-length recv(MSG_OOB), so the urgent
byte is skipped and the sender does not stall.

> Fixes: de8474eb9d50 ("net/smc: urgent data support")
> Suggested-by: Sidraya Jayagond <sidraya@linux.ibm.com>
> Cc: stable@vger.kernel.org

[Severity: Low]
Should this stable tag name the patches this one depends on?

The hunk in smc_rx_recv_urg() only applies on top of two earlier patches
in this series:

  "net/smc: update the urgent state under the socket spinlock" adds the
  valid and byte locals, the bh_lock_sock() block and the if (len > 0)
  layout that this patch rewrites.

  "net/smc: order the urgent mark across the cursor wrap rollover" adds
  the smc_curs_sdiff(...) > 1 test that this patch changes to > 0.

At the baseline, smc_curs_sdiff() does not exist anywhere in net/smc/.

The cursor wrap patch already marks its own dependencies with
"Cc: stable@vger.kernel.org # depends on 2/7 and 4/7". Could this patch
carry a similar note? Without one, anyone who backports it alone based on
the Fixes: tag will hit a context conflict and won't know which patches
to take first.

> diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
> index 2680b91e882b9..579ee008900ce 100644
> --- a/net/smc/smc_rx.c
> +++ b/net/smc/smc_rx.c
> @@ -342,12 +342,14 @@ static int smc_rx_recv_urg(struct smc_sock *smc, struct msghdr *msg, int len,
>  	valid = conn->urg_state == SMC_URG_VALID;
>  	if (valid) {
>  		byte = conn->urg_rx_byte;
> -		if (len > 0) {
> -			smc_curs_copy(&cons, &conn->local_tx_ctrl.cons, conn);
> -			if (smc_curs_sdiff(conn->rmb_desc->len, &cons,
> -					   &conn->urg_curs) > 1)
> -				conn->urg_rx_skip_pend = true;
> -		}
> +		/* The reader has not passed the urgent byte: have
> +		 * smc_rx_update_consumer() skip it once it is the next
> +		 * unread byte.
> +		 */
> +		smc_curs_copy(&cons, &conn->local_tx_ctrl.cons, conn);
> +		if (smc_curs_sdiff(conn->rmb_desc->len, &cons,
> +				   &conn->urg_curs) > 0)
> +			conn->urg_rx_skip_pend = true;

[Severity: Low]
This isn't a bug, but should the comment on urg_rx_skip_pend in struct
smc_connection in net/smc/smc.h be updated as well? It still reads:

	bool			urg_rx_skip_pend;
					/* indicate urgent oob data
					 * read, but previous regular
					 * data still pending
					 */

With the old > 1 test, the flag meant at least one regular byte was in
front of the urgent byte, which matched that comment.

With the new > 0 test, which no longer depends on len, the flag is also
set when sdiff == 1. In that case the urgent byte is itself the next
unread byte and no regular data is pending, for example after
recv(MSG_OOB|MSG_PEEK) at the mark.

The SIOCATMARK handling in af_smc.c checks urg_rx_skip_pend together with
sdiff == 1, and smc_rx_update_consumer() is gated on the flag. From the
smc.h text, someone could conclude that this combination cannot occur,
but after this patch it happens routinely.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203-b4-disp-ba1ad55e-v3-0-6834ff90c5d0%40proton.me

      reply	other threads:[~2026-12-04  9:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  9:15 [PATCH net v3 0/7] net/smc: fix the failover cursor switch and wrap rollover Bryam Vargas via B4 Relay
2026-12-03  9:15 ` [PATCH net v3 1/7] net/smc: take the socket spinlock across the failover cursor switch Bryam Vargas via B4 Relay
2026-12-03  9:15 ` [PATCH net v3 2/7] net/smc: do not credit stale CDC completions after a link switch Bryam Vargas via B4 Relay
2026-12-04  9:49   ` netdev-bot+sashiko
2026-12-03  9:15 ` [PATCH net v3 3/7] net/smc: store each cursor once in smc_switch_cursor() Bryam Vargas via B4 Relay
2026-12-03  9:15 ` [PATCH net v3 4/7] net/smc: fix the failover catch-up across the cursor wrap rollover Bryam Vargas via B4 Relay
2026-12-03  9:15 ` [PATCH net v3 5/7] net/smc: order the urgent mark " Bryam Vargas via B4 Relay
2026-12-03  9:15 ` [PATCH net v3 6/7] net/smc: update the urgent state under the socket spinlock Bryam Vargas via B4 Relay
2026-12-04  9:49   ` netdev-bot+sashiko
2026-12-03  9:15 ` [PATCH net v3 7/7] net/smc: skip the urgent byte when it is the next unread byte Bryam Vargas via B4 Relay
2026-12-04  9:49   ` netdev-bot+sashiko [this message]

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=179637777294.3146.2610356583355852527@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=edumazet@kernel.org \
    --cc=guangguan.wang@linux.alibaba.com \
    --cc=guwen@linux.alibaba.com \
    --cc=hexlabsecurity@proton.me \
    --cc=hidayath@linux.ibm.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.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=raspl@linux.ibm.com \
    --cc=sidraya@linux.ibm.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=ubraun@linux.ibm.com \
    --cc=wenjia@linux.ibm.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