From: Hangbin Liu <liuhangbin@gmail.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, Jay Vosburgh <jv@jvosburgh.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Nikolay Aleksandrov <razor@blackwall.org>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
Jonathan Corbet <corbet@lwn.net>, Petr Machata <petrm@nvidia.com>,
Amit Cohen <amcohen@nvidia.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Stephen Hemminger <stephen@networkplumber.org>,
David Ahern <dsahern@gmail.com>,
Jonas Gorski <jonas.gorski@gmail.com>,
linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCHv3 net-next 3/3] selftests: bonding: add test for LACP actor port priority
Date: Thu, 21 Aug 2025 14:12:46 +0000 [thread overview]
Message-ID: <aKcpXt_OLrvf4XDN@fedora> (raw)
In-Reply-To: <ea44c100-34fc-4dec-a749-454d224fa84e@redhat.com>
On Thu, Aug 21, 2025 at 11:14:34AM +0200, Paolo Abeni wrote:
> On 8/18/25 11:23 AM, Hangbin Liu wrote:
> > +# Trigger link state change to reselect the aggregator
> > +ip -n "${c_ns}" link set eth1 down
> > +sleep 1
> > +ip -n "${c_ns}" link set eth1 up
> > +# the active agg should be connect to switch
> > +bond_agg_id=$(cmd_jq "ip -n ${c_ns} -d -j link show bond0" ".[].linkinfo.info_data.ad_info.aggregator")
> > +eth0_agg_id=$(cmd_jq "ip -n ${c_ns} -d -j link show eth0" ".[].linkinfo.info_slave_data.ad_aggregator_id")
> > +[ "${bond_agg_id}" -ne "${eth0_agg_id}" ] && RET=1
>
> A few lines above exceed 100 chars, it would be better to wrap them
>
> > +log_test "bond 802.3ad" "actor_port_prio select"
> > +
> > +# Change the actor port prio and re-test
> > +ip -n "${c_ns}" link set eth0 type bond_slave actor_port_prio 10
> > +ip -n "${c_ns}" link set eth2 type bond_slave actor_port_prio 1000
> > +# Trigger link state change to reselect the aggregator
> > +ip -n "${c_ns}" link set eth1 down
> > +sleep 1
> > +ip -n "${c_ns}" link set eth1 up
> > +# now the active agg should be connect to backup switch
> > +bond_agg_id=$(cmd_jq "ip -n ${c_ns} -d -j link show bond0" ".[].linkinfo.info_data.ad_info.aggregator")
> > +eth2_agg_id=$(cmd_jq "ip -n ${c_ns} -d -j link show eth2" ".[].linkinfo.info_slave_data.ad_aggregator_id")
> > +# shellcheck disable=SC2034
> > +if [ "${bond_agg_id}" -ne "${eth2_agg_id}" ]; then
> > + RET=1
> > +fi
> > +log_test "bond 802.3ad" "actor_port_prio switch"
>
> The test above is basically the same of the previous one, with a
> slightly different style, it would be better to factor the whole
> status cycling, data fetching and comparison in an helper to avoid code
> duplication and the mentioned confusing difference.
>
OK, I will fix it.
Regards
Hangbin
prev parent reply other threads:[~2025-08-21 14:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 9:23 [PATCHv3 net-next 0/3] bonding: support aggregator selection based on port priority Hangbin Liu
2025-08-18 9:23 ` [PATCHv3 net-next 1/3] bonding: add support for per-port LACP actor priority Hangbin Liu
2025-08-23 0:33 ` Jay Vosburgh
2025-08-25 2:48 ` Hangbin Liu
2025-08-18 9:23 ` [PATCHv3 net-next 2/3] bonding: support aggregator selection based on port priority Hangbin Liu
2025-08-21 9:16 ` Paolo Abeni
2025-08-18 9:23 ` [PATCHv3 net-next 3/3] selftests: bonding: add test for LACP actor " Hangbin Liu
2025-08-21 9:14 ` Paolo Abeni
2025-08-21 14:12 ` Hangbin Liu [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=aKcpXt_OLrvf4XDN@fedora \
--to=liuhangbin@gmail.com \
--cc=amcohen@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jonas.gorski@gmail.com \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.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=stephen@networkplumber.org \
--cc=vladimir.oltean@nxp.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;
as well as URLs for NNTP newsgroup(s).