From: netdev-bot+sashiko@kernel.org
To: idosch@nvidia.com
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, edumazet@kernel.org, jv@jvosburgh.net,
andrew+netdev@lunn.ch, petrm@nvidia.com,
sridhar.samudrala@intel.com, jiri@resnulli.us, horms@kernel.org,
shuah@kernel.org, linux-kselftest@vger.kernel.org,
razor@blackwall.org
Subject: Re: [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification
Date: Thu, 19 Nov 2026 09:19:43 +0000 [thread overview]
Message-ID: <179507998375.3136.1157162879264282901@kernel.org> (raw)
In-Reply-To: <20261118083442.1061289-7-idosch@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] collecting_advertise() in tools/testing/selftests/drivers/net/
bonding/bond_lacp_independent_control.sh can take the wrong…
--
selftests: bonding: Test that Collecting is advertised after notification
This patch adds a collecting_advertise test to
bond_lacp_independent_control.sh. With coupled control disabled, the test
checks that the Collecting bit is only advertised in a transmitted LACPDU
after the Rx state change notification was emitted. It also switches the
partner to a slow LACP rate so that the port is not rate limited when it
enters COLLECTING state.
> diff --git a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
> index a2b83b581e403..b86f39f31d0c3 100755
> --- a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
> +++ b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
[ ... ]
> @@ -162,6 +167,50 @@ collecting_notify()
> log_test "Notifications in COLLECTING state"
> }
>
> +collecting_advertise()
> +{
> + local lacpdu_ts notify_ts tmp_dir
> +
> + RET=0
> +
> + partner_state_clear 0x18
> + defer tc filter del dev "$h1" ingress pref 1 handle 101 flower
> + lacp_state_wait "$h1" 0x0f
> + check_err $? "Port did not reach ATTACHED state"
> +
> + tmp_dir=$(mktemp -d)
> + defer rm -rf "$tmp_dir"
> + ip -ts -o -d monitor link dev "$h1" > "$tmp_dir"/notify &
> + defer kill_process $!
[ ... ]
> + notify_ts=$(grep -m1 -w "ad_actor_oper_port_state $((0x1f))" \
> + "$tmp_dir"/notify | sed 's/^\[\([^]]*\)\].*/\1/')
> + notify_ts=$(date -d "$notify_ts" +%s%6N)
> + lacpdu_ts=$(head -n1 "$tmp_dir"/lacpdu | cut -d' ' -f1 | tr -d .)
> + ((lacpdu_ts > notify_ts))
> + check_err $? "Collecting bit advertised before notification"
[Severity: Medium]
Can notify_ts in collecting_advertise() pick up the timestamp of an
unrelated link notification instead of the $h1 one?
The monitor runs as "ip -ts -o -d monitor link dev $h1". In iproute2,
accept_msg() in ipmonitor calls print_headers() for every RTM_NEWLINK.
With -ts, that prints "[<time>] " with no newline.
print_linkinfo() then returns early and prints nothing when
filter.ifindex is set and ifi->ifi_index != filter.ifindex, which is the
case for any device other than $h1. The timestamp of the filtered message
is therefore left at the start of the next printed line.
With -o, the matching line can then look like this:
[ts_other] [ts_h1] N: $h1: ... ad_actor_oper_port_state 31 ...
The sed above takes the first bracket, ts_other. That timestamp is older
than the real $h1 notification.
Without "bonding: 3ad: Advertise Collecting only after collection is
enabled", the Collecting LACPDU goes out only a short time (at most about
one tick) before the notification. So any RTM_NEWLINK for another device
between the monitor start and the $h1 0x1f notification would make
notify_ts smaller than lacpdu_ts. In that case the check below passes even
though the bug is present:
((lacpdu_ts > notify_ts))
That window covers the sleep 1 plus the wait for the partner's next
LACPDU.
The test runs in the init netns, so link events on other host interfaces
can land in that window. Examples are NetworkManager or docker veths,
carrier changes, and IPv6 ifinfo notifications.
One option is to drop the dev filter and grep for the "$h1:" line, so
every printed line has its own timestamp. Another is to take the last
bracketed timestamp on the line instead of the first. Would either of
these make the check more robust?
> +
> + log_test "Collecting advertised after notification"
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118083442.1061289-1-idosch%40nvidia.com
next prev parent reply other threads:[~2026-11-19 9:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 8:34 [PATCH net-next 0/6] bonding: 3ad: Support independent control with LAG offload Ido Schimmel
2026-11-18 8:34 ` [PATCH net-next 1/6] net: Add Rx enabled state to LAG lower state information Ido Schimmel
2026-11-18 8:34 ` [PATCH net-next 2/6] bonding: 3ad: Notify Rx state changes Ido Schimmel
2026-11-18 20:00 ` Jay Vosburgh
2026-11-19 9:03 ` Ido Schimmel
2026-11-18 8:34 ` [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor Ido Schimmel
2026-11-19 9:19 ` netdev-bot+sashiko
2026-11-19 10:28 ` Ido Schimmel
2026-11-18 8:34 ` [PATCH net-next 4/6] selftests: bonding: Test notifications in COLLECTING state Ido Schimmel
2026-11-18 8:34 ` [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled Ido Schimmel
2026-11-19 9:19 ` netdev-bot+sashiko
2026-11-19 11:36 ` Ido Schimmel
2026-11-18 8:34 ` [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification Ido Schimmel
2026-11-19 9:19 ` netdev-bot+sashiko [this message]
2026-11-19 10:01 ` Ido Schimmel
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=179507998375.3136.1157162879264282901@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=jiri@resnulli.us \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=razor@blackwall.org \
--cc=shuah@kernel.org \
--cc=sridhar.samudrala@intel.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