diff mbox series

[net,v2,2/2] selftests: net: veth: test the ability to independently manipulate GRO and XDP

Message ID 20240312160551.73184-3-ignat@cloudflare.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: veth: ability to toggle GRO and XDP independently | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 7 maintainers not CCed: bpf@vger.kernel.org hawk@kernel.org shuah@kernel.org ast@kernel.org john.fastabend@gmail.com daniel@iogearbox.net linux-kselftest@vger.kernel.org
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 47 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2024-03-12--18-00 (tests: 889)

Commit Message

Ignat Korchagin March 12, 2024, 4:05 p.m. UTC
We should be able to independently flip either XDP or GRO states and toggling
one should not affect the other.

Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
---
 tools/testing/selftests/net/veth.sh | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

Comments

Michal Kubiak March 13, 2024, 11:28 a.m. UTC | #1
On Tue, Mar 12, 2024 at 04:05:52PM +0000, Ignat Korchagin wrote:
> We should be able to independently flip either XDP or GRO states and toggling
> one should not affect the other.
> 
> Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>

Missing "Fixes" tag for the patch targeted to the "net" tree.

Thanks,
Michal
Jakub Kicinski March 13, 2024, 1:57 p.m. UTC | #2
On Wed, 13 Mar 2024 12:28:41 +0100 Michal Kubiak wrote:
> On Tue, Mar 12, 2024 at 04:05:52PM +0000, Ignat Korchagin wrote:
> > We should be able to independently flip either XDP or GRO states and toggling
> > one should not affect the other.
> > 
> > Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>  
> 
> Missing "Fixes" tag for the patch targeted to the "net" tree.

it's adjusting a selftest, I don't think we need a Fixes tag for that
Michal Kubiak March 13, 2024, 2:03 p.m. UTC | #3
On Wed, Mar 13, 2024 at 06:57:25AM -0700, Jakub Kicinski wrote:
> On Wed, 13 Mar 2024 12:28:41 +0100 Michal Kubiak wrote:
> > On Tue, Mar 12, 2024 at 04:05:52PM +0000, Ignat Korchagin wrote:
> > > We should be able to independently flip either XDP or GRO states and toggling
> > > one should not affect the other.
> > > 
> > > Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>  
> > 
> > Missing "Fixes" tag for the patch targeted to the "net" tree.
> 
> it's adjusting a selftest, I don't think we need a Fixes tag for that

OK, sorry! My mistake, then.

Michal
Jakub Kicinski March 13, 2024, 2:09 p.m. UTC | #4
On Wed, 13 Mar 2024 15:03:16 +0100 Michal Kubiak wrote:
> > > Missing "Fixes" tag for the patch targeted to the "net" tree.  
> > 
> > it's adjusting a selftest, I don't think we need a Fixes tag for that  
> 
> OK, sorry! My mistake, then.

No worries, it's pretty subjective. And the patchwork check for
the Fixes tag doesn't do a great job on the corner cases either :(
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
index 5ae85def0739..3a394b43e274 100755
--- a/tools/testing/selftests/net/veth.sh
+++ b/tools/testing/selftests/net/veth.sh
@@ -249,9 +249,9 @@  cleanup
 create_ns
 ip -n $NS_DST link set dev veth$DST up
 ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} section xdp
-chk_gro_flag "gro vs xdp while down - gro flag on" $DST on
+chk_gro_flag "gro vs xdp while down - gro flag off" $DST off
 ip -n $NS_DST link set dev veth$DST down
-chk_gro_flag "                      - after down" $DST on
+chk_gro_flag "                      - after down" $DST off
 ip -n $NS_DST link set dev veth$DST xdp off
 chk_gro_flag "                      - after xdp off" $DST off
 ip -n $NS_DST link set dev veth$DST up
@@ -260,6 +260,21 @@  ip -n $NS_SRC link set dev veth$SRC xdp object ${BPF_FILE} section xdp
 chk_gro_flag "                      - after peer xdp" $DST off
 cleanup
 
+create_ns
+ip -n $NS_DST link set dev veth$DST up
+ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} section xdp
+ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
+chk_gro_flag "gro vs xdp while down - gro flag on" $DST on
+ip -n $NS_DST link set dev veth$DST down
+chk_gro_flag "                      - after down" $DST on
+ip -n $NS_DST link set dev veth$DST xdp off
+chk_gro_flag "                      - after xdp off" $DST on
+ip -n $NS_DST link set dev veth$DST up
+chk_gro_flag "                      - after up" $DST on
+ip -n $NS_SRC link set dev veth$SRC xdp object ${BPF_FILE} section xdp
+chk_gro_flag "                      - after peer xdp" $DST on
+cleanup
+
 create_ns
 chk_channels "default channels" $DST 1 1
 
@@ -327,11 +342,14 @@  if [ $CPUS -gt 2 ]; then
 fi
 
 ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} section xdp 2>/dev/null
-chk_gro_flag "with xdp attached - gro flag" $DST on
+chk_gro_flag "with xdp attached - gro flag" $DST off
 chk_gro_flag "        - peer gro flag" $SRC off
 chk_tso_flag "        - tso flag" $SRC off
 chk_tso_flag "        - peer tso flag" $DST on
 ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
+chk_gro "        - no aggregation" 10
+ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
+chk_gro_flag "        - gro flag with GRO on" $DST on
 chk_gro "        - aggregation" 1