Test that a veth device advertises ndo-xmit when GRO is enabled on its
peer while both are down and only the device is brought up.

Commit 7a6102aa6df0 ("veth: Update XDP feature set when bringing up
device") made veth_open() set the flag in this case, and selftests were
requested in its review [1].

The block now ends with GRO enabled while the peer is down, so the
aggregation check that follows covers NAPI enabled by veth_open() again.
Commit c017800af5c7 ("selftests: net: veth: test peer ndo-xmit after GRO
toggle while down") had moved it to veth_set_features() [2].

Link: 
https://lore.kernel.org/all/[email protected]/
 [1]
Link: 
https://lore.kernel.org/all/[email protected]/ 
[2]
Signed-off-by: Tianyi Gao <[email protected]>
---
The new check fails with veth_set_xdp_features(dev) removed from
veth_open().

 tools/testing/selftests/net/veth.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/selftests/net/veth.sh 
b/tools/testing/selftests/net/veth.sh
index 8b867e0675a7..60d0754928bf 100755
--- a/tools/testing/selftests/net/veth.sh
+++ b/tools/testing/selftests/net/veth.sh
@@ -327,7 +327,12 @@ if [ -f "$YNL" ]; then
        ip netns exec $NS_DST ethtool -K veth$DST gro off
        ip -n $NS_DST link set dev veth$DST up
        chk_xdp_feature "        - peer ndo-xmit cleared" $SRC 0 ndo-xmit
+       ip -n $NS_SRC link set dev veth$SRC down
+       ip -n $NS_DST link set dev veth$DST down
        ip netns exec $NS_DST ethtool -K veth$DST gro on
+       ip -n $NS_SRC link set dev veth$SRC up
+       chk_xdp_feature "        - own ndo-xmit" $SRC 1 ndo-xmit
+       ip -n $NS_DST link set dev veth$DST up
 fi
 ip netns exec $NS_SRC ethtool -K veth$SRC tx-udp-segmentation off
 ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on

base-commit: d8674294aefef02266c4d47ad10131f1bffbe534
-- 
2.55.0


Reply via email to