From: David Ahern <dsahern@kernel.org>
To: Ido Schimmel <idosch@nvidia.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, horms@kernel.org, petrm@nvidia.com,
aroulin@nvidia.com
Subject: Re: [PATCH net 2/3] selftests: fib_nexthops: Fix creation of non-FDB nexthops
Date: Sun, 21 Sep 2025 09:36:54 -0600 [thread overview]
Message-ID: <4d304e61-cdfa-45d9-b5ee-ac756bd4923b@kernel.org> (raw)
In-Reply-To: <20250921150824.149157-3-idosch@nvidia.com>
On 9/21/25 9:08 AM, Ido Schimmel wrote:
> The test creates non-FDB nexthops without a nexthop device which leads
> to the expected failure, but for the wrong reason:
>
> # ./fib_nexthops.sh -t "ipv6_fdb_grp_fcnal ipv4_fdb_grp_fcnal" -v
>
> IPv6 fdb groups functional
> --------------------------
> [...]
> COMMAND: ip -netns me-nRsN3E nexthop add id 63 via 2001:db8:91::4
> Error: Device attribute required for non-blackhole and non-fdb nexthops.
> COMMAND: ip -netns me-nRsN3E nexthop add id 64 via 2001:db8:91::5
> Error: Device attribute required for non-blackhole and non-fdb nexthops.
> COMMAND: ip -netns me-nRsN3E nexthop add id 103 group 63/64 fdb
> Error: Invalid nexthop id.
> TEST: Fdb Nexthop group with non-fdb nexthops [ OK ]
> [...]
>
> IPv4 fdb groups functional
> --------------------------
> [...]
> COMMAND: ip -netns me-nRsN3E nexthop add id 14 via 172.16.1.2
> Error: Device attribute required for non-blackhole and non-fdb nexthops.
> COMMAND: ip -netns me-nRsN3E nexthop add id 15 via 172.16.1.3
> Error: Device attribute required for non-blackhole and non-fdb nexthops.
> COMMAND: ip -netns me-nRsN3E nexthop add id 103 group 14/15 fdb
> Error: Invalid nexthop id.
> TEST: Fdb Nexthop group with non-fdb nexthops [ OK ]
>
> COMMAND: ip -netns me-nRsN3E nexthop add id 16 via 172.16.1.2 fdb
> COMMAND: ip -netns me-nRsN3E nexthop add id 17 via 172.16.1.3 fdb
> COMMAND: ip -netns me-nRsN3E nexthop add id 104 group 14/15
> Error: Invalid nexthop id.
> TEST: Non-Fdb Nexthop group with fdb nexthops [ OK ]
> [...]
> COMMAND: ip -netns me-0dlhyd ro add 172.16.0.0/22 nhid 15
> Error: Nexthop id does not exist.
> TEST: Route add with fdb nexthop [ OK ]
>
> In addition, as can be seen in the above output, a couple of IPv4 test
> cases used the non-FDB nexthops (14 and 15) when they intended to use
> the FDB nexthops (16 and 17). These test cases only passed because
> failure was expected, but they failed for the wrong reason.
>
> Fix the test to create the non-FDB nexthops with a nexthop device and
> adjust the IPv4 test cases to use the FDB nexthops instead of the
> non-FDB nexthops.
>
> Output after the fix:
>
> # ./fib_nexthops.sh -t "ipv6_fdb_grp_fcnal ipv4_fdb_grp_fcnal" -v
>
> IPv6 fdb groups functional
> --------------------------
> [...]
> COMMAND: ip -netns me-lNzfHP nexthop add id 63 via 2001:db8:91::4 dev veth1
> COMMAND: ip -netns me-lNzfHP nexthop add id 64 via 2001:db8:91::5 dev veth1
> COMMAND: ip -netns me-lNzfHP nexthop add id 103 group 63/64 fdb
> Error: FDB nexthop group can only have fdb nexthops.
> TEST: Fdb Nexthop group with non-fdb nexthops [ OK ]
> [...]
>
> IPv4 fdb groups functional
> --------------------------
> [...]
> COMMAND: ip -netns me-lNzfHP nexthop add id 14 via 172.16.1.2 dev veth1
> COMMAND: ip -netns me-lNzfHP nexthop add id 15 via 172.16.1.3 dev veth1
> COMMAND: ip -netns me-lNzfHP nexthop add id 103 group 14/15 fdb
> Error: FDB nexthop group can only have fdb nexthops.
> TEST: Fdb Nexthop group with non-fdb nexthops [ OK ]
>
> COMMAND: ip -netns me-lNzfHP nexthop add id 16 via 172.16.1.2 fdb
> COMMAND: ip -netns me-lNzfHP nexthop add id 17 via 172.16.1.3 fdb
> COMMAND: ip -netns me-lNzfHP nexthop add id 104 group 16/17
> Error: Non FDB nexthop group cannot have fdb nexthops.
> TEST: Non-Fdb Nexthop group with fdb nexthops [ OK ]
> [...]
> COMMAND: ip -netns me-lNzfHP ro add 172.16.0.0/22 nhid 16
> Error: Route cannot point to a fdb nexthop.
> TEST: Route add with fdb nexthop [ OK ]
> [...]
> Tests passed: 30
> Tests failed: 0
> Tests skipped: 0
>
> Fixes: 0534c5489c11 ("selftests: net: add fdb nexthop tests")
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
> tools/testing/selftests/net/fib_nexthops.sh | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
next prev parent reply other threads:[~2025-09-21 15:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-21 15:08 [PATCH net 0/3] nexthop: Various fixes Ido Schimmel
2025-09-21 15:08 ` [PATCH net 1/3] nexthop: Forbid FDB status change while nexthop is in a group Ido Schimmel
2025-09-21 15:35 ` David Ahern
2025-09-21 15:08 ` [PATCH net 2/3] selftests: fib_nexthops: Fix creation of non-FDB nexthops Ido Schimmel
2025-09-21 15:36 ` David Ahern [this message]
2025-09-21 15:08 ` [PATCH net 3/3] selftests: fib_nexthops: Add test cases for FDB status change Ido Schimmel
2025-09-21 15:39 ` David Ahern
2025-09-24 0:20 ` [PATCH net 0/3] nexthop: Various fixes patchwork-bot+netdevbpf
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=4d304e61-cdfa-45d9-b5ee-ac756bd4923b@kernel.org \
--to=dsahern@kernel.org \
--cc=aroulin@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.