Re: [PATCH net-next v2 3/3] selftests: net: add coverage for fdb nexthop dst port
From: Jack Ma
Date: Tue Jul 21 2026 - 18:30:16 EST
On Tue, Jul 21, 2026 at 06:20:59PM +0300, Ido Schimmel wrote:
> 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()
Done for v3. Dropped the standalone fib_nexthops_fdb_port.sh and
folded the cases into ipv4_fdb_grp_fcnal() and ipv6_fdb_grp_fcnal()
in fib_nexthops.sh: accept a port on an fdb nexthop that has a
gateway and echo it back on dump, reject it without a gateway,
reject a zero port, allow a group whose legs differ only in UDP
port, and confirm that a portless fdb nexthop omits the attribute.
A check_nexthop_fdb_port_support() helper SKIPs the cases when
iproute2 lacks the "port" keyword.
> 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.
Done for v3. The stale vxlan-fdb-port-integ.sh reference is gone;
basic_tx_common() in test_vxlan_nh.sh is extended in place instead.
The existing portless configuration is left exactly as-is, with the
new coverage added alongside it and guarded so it SKIPs on older
iproute2:
1. a new fdb nexthop "id 2 via $remote_addr fdb port 4790" plus a
group "id 20 group 2 fdb" that contains it;
2. a flower filter matching udp dst_port 4790 (the vxlan device
default in this test is 4789);
3. an fdb entry 00:11:22:33:44:66 -> nhid 20 that points at the
new group.
The test then sends a frame to that MAC and waits on both the
nexthop group stats and the port-4790 flower counter, so it only
passes when the per-nexthop port actually lands on the wire.
On shellcheck: I ran it on both touched scripts, comparing the base
tree against the patched tree. test_vxlan_nh.sh adds no new
warnings. In fib_nexthops.sh the added code only reproduces idioms
the rest of the file already uses -- check_nexthop_fdb_port_support()
mirrors the adjacent check_nexthop_res_support() helper, and the new
cases use the same run_cmd / "log_test $?" pattern -- so no new
warning categories appear (the SC2086 / SC2181 notes, and the
SC2317 "unreachable ... or ignore if invoked indirectly" notes, are
already present throughout the file).
Thanks,
Jack