Subject: Re: [PATCH net v5 4/4] selftests: bonding: add test for lacp_strict mode

From: Breno Leitao <[email-masked]>
Date: Wed, 6 May 2026 09:33:28 -0700

On Wed, May 06, 2026 at 06:11:44PM +0200, Louis Scalbert wrote:
> Add a test for the bonding lacp_strict mode.

Test seems fine, although it seems there is a bunch of copy & paste. Any
chance you can mke it a bit more modular with some helpers that can be
reused?

> diff --git a/tools/testing/selftests/drivers/net/bonding/Makefile b/tools/testing/selftests/drivers/net/bonding/Makefile
> index 9af5f84edd37..91269e7ceb63 100644
> --- a/tools/testing/selftests/drivers/net/bonding/Makefile
> +++ b/tools/testing/selftests/drivers/net/bonding/Makefile
> @@ -7,6 +7,7 @@ TEST_PROGS := \
>  	bond-eth-type-change.sh \
>  	bond-lladdr-target.sh \
>  	bond_ipsec_offload.sh \
> +	bond_lacp_strict.sh \

TEST_PROGS is sorted alphabetically; bond_lacp_strict.sh should sort
after bond_lacp_prio.sh, not before it.

> +COLLECTING_DISTRIBUTING_MASK=48
> +COLLECTING_DISTRIBUTING=48
> +FAILED=0

FAILED is a bit misleading here. 

> +	# Allow LACP trames forwarding on bridge ports

s/trames/frames ?

> +	RET=1
> +
> +}
Remove the extra line above.

> +
> +compare_state() {
> +	local actual_state=$1
> +	local expected_state=$2
> +	local iface=$3
> +	local last_attempt=$4
> +
> +    [ $((actual_state & COLLECTING_DISTRIBUTING_MASK)) -eq "$expected_state" ] \
> +		&& return 0

The line above is hard to read, and idententation is a bit off as well.