Re: [PATCH RFC/RFT net-next v2 3/5] selftests: no_forwarding: test VLAN uppers on VLAN aware bridged ports

Jonas Gorski
2025-12-01T19:47:11Z

Hi,

On Mon, Dec 1, 2025 at 3:19 PM Simon Horman <horms@kernel.org> wrote:
>
> On Mon, Dec 01, 2025 at 11:28:15AM +0100, Jonas Gorski wrote:
> > Add a test (mainly for switchdev implementors) to test that multiple
> > VLAN uppers on a VLAN aware bridge for the same VLAN do not enable
> > forwarding of that VLAN between those ports.
> >
> > Since we are testing VLAN uppers, skip checking untagged traffic in
> > those cases.
> >
> > Disallowing VLAN uppers on bridge ports is a valid choice for switchdev
> > drivers, so test if we can create them first and skip the tests if not.
> >
> > Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> > ---
> > v1 -> v2:
> > * new patch
> >
> > .../selftests/net/forwarding/no_forwarding.sh | 89 ++++++++++++++-----
> > 1 file changed, 67 insertions(+), 22 deletions(-)
> >
> > diff --git a/tools/testing/selftests/net/forwarding/no_forwarding.sh b/tools/testing/selftests/net/forwarding/no_forwarding.sh
> > index 694ece9ba3a7..c8adf04e1328 100755
> > --- a/tools/testing/selftests/net/forwarding/no_forwarding.sh
> > +++ b/tools/testing/selftests/net/forwarding/no_forwarding.sh
> > @@ -1,7 +1,7 @@
> > #!/bin/bash
> > # SPDX-License-Identifier: GPL-2.0
> >
> > -ALL_TESTS="standalone two_bridges one_bridge_two_pvids"
> > +ALL_TESTS="standalone two_bridges one_bridge_two_pvids bridge_aware_vlan_uppers"
> > NUM_NETIFS=4
> >
> > source lib.sh
> > @@ -90,6 +90,7 @@ check_rcv()
> > run_test()
> > {
> > local test_name="$1"
> > + local swp_uppers=${2:0}
>
> Hi Jonas,
>
> Should this be as follows?
>
> local swp_uppers=${2:-0}
>
>
> I.e. default to 0 if $2 is not set,
> rather than take a substring of $2 at index 0 (which is all of $2)

Yes it is, I fat fingered that (or cold fingered?). But since bash has
no abort on error enabled, it just chucks along and works by accident
anyway (there may be some complaints on stderr).

Best regards,
Jonas