Re: [PATCH net-next v2 3/3] selftests: net: add coverage for fdb nexthop dst port
From: Ido Schimmel <idosch@nvidia.com>
Date: 2026-07-21 15:21:15
Also in:
linux-kselftest, lkml
On Fri, Jul 17, 2026 at 06:45:18AM +0000, Jack Ma wrote:
Add fib_nexthops_fdb_port.sh, which exercises the NHA_FDB_PORT rules: accept a port on an fdb nexthop that has a gateway and echo it back on dump, reject it on non-fdb or gateway-less nexthops, allow a group whose legs differ only in UDP port, and confirm a portless fdb nexthop omits the attribute. The test SKIPs cleanly on kernels or iproute2 without NHA_FDB_PORT support.
We already have control plane test for FDB nexthops in fib_nexthops.sh, can you add the new test cases there instead? Probably fit in ipv4_fdb_grp_fcnal() and ipv6_fdb_grp_fcnal()
quoted hunk ↗ jump to hunk
Signed-off-by: Jack Ma <redacted> --- tools/testing/selftests/net/Makefile | 1 + .../testing/selftests/net/fib_nexthops_fdb_port.sh | 78 ++++++++++++++++++++++ 2 files changed, 79 insertions(+)diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index 708d960ae..c06eb4927 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile@@ -36,6 +36,7 @@ TEST_PROGS := \ fib_nexthop_multiprefix.sh \ fib_nexthop_nongw.sh \ fib_nexthops.sh \ + fib_nexthops_fdb_port.sh \ fib_rule_tests.sh \ fib_tests.sh \ fin_ack_lat.sh \diff --git a/tools/testing/selftests/net/fib_nexthops_fdb_port.sh b/tools/testing/selftests/net/fib_nexthops_fdb_port.sh new file mode 100755 index 000000000..8b401c6d2 --- /dev/null +++ b/tools/testing/selftests/net/fib_nexthops_fdb_port.sh@@ -0,0 +1,78 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Control-plane selftest for per-nexthop VXLAN fdb destination port +# (NHA_FDB_PORT). Verifies the accept/reject rules and the dump roundtrip. +# No datapath traffic here -- see tests/integ/vxlan-fdb-port-integ.sh for the +# real forwarding test.
vxlan-fdb-port-integ.sh doesn't exist. We have test_vxlan_nh.sh. Can you extend basic_tx_common() to test the new attribute? Don't change the existing configuration (we want to test the configuration where user space doesn't pass a port) and instead add a new: 1. FDB nexthop and a group that contains it 2. Flower filter that also matches on the destination port (not 4789) 3. FDB entry that points to the new group Run shellcheck (preferably via ingest_mdir.py [1]) to make sure you're not adding new warnings / errors. [1] https://github.com/linux-netdev/nipa#running-locally