[Impact]
In udpgro.sh, the exit value is 0 even if there are some failed sub test cases: $ sudo ./udpgro.sh ipv4 no GRO BTF debug data section '.BTF' rejected: Invalid argument (22)! - Length: 568 Verifier analysis: magic: 0xeb9f version: 1 flags: 0x0 hdr_len: 24 type_off: 0 type_len: 256 str_off: 256 str_len: 288 btf_total_size: 568 [1] PTR (anon) type_id=2 [2] STRUCT xdp_md size=20 vlen=5 data type_id=3 bits_offset=0 data_end type_id=3 bits_offset=32 data_meta type_id=3 bits_offset=64 ingress_ifindex type_id=3 bits_offset=96 rx_queue_index type_id=3 bits_offset=128 [3] TYPEDEF __u32 type_id=4 [4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none) [5] FUNC_PROTO (anon) return=6 args=(1 ctx) [6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED [7] FUNC xdp_dummy_prog type_id=5 [8] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED [9] ARRAY (anon) type_id=8 index_type_id=10 nr_elems=4 [10] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none) [11] VAR _license type_id=9 linkage=1 [12] DATASEC license size=0 vlen=1 size == 0 ./udpgso_bench_rx: poll: 0x0 expected 0x1 failed ./udpgso_bench_tx: write: Connection refused ... multiple GRO socks BTF debug data section '.BTF' rejected: Invalid argument (22)! - Length: 568 Verifier analysis: magic: 0xeb9f version: 1 flags: 0x0 hdr_len: 24 type_off: 0 type_len: 256 str_off: 256 str_len: 288 btf_total_size: 568 [1] PTR (anon) type_id=2 [2] STRUCT xdp_md size=20 vlen=5 data type_id=3 bits_offset=0 data_end type_id=3 bits_offset=32 data_meta type_id=3 bits_offset=64 ingress_ifindex type_id=3 bits_offset=96 rx_queue_index type_id=3 bits_offset=128 [3] TYPEDEF __u32 type_id=4 [4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none) [5] FUNC_PROTO (anon) return=6 args=(1 ctx) [6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED [7] FUNC xdp_dummy_prog type_id=5 [8] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED [9] ARRAY (anon) type_id=8 index_type_id=10 nr_elems=4 [10] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none) [11] VAR _license type_id=9 linkage=1 [12] DATASEC license size=0 vlen=1 size == 0 ./udpgso_bench_rx: poll: 0x0 expected 0x1 ./udpgso_bench_rx: poll: 0x0 expected 0x1 failed $ echo $? 0 [Fix] * 3503ee6c0bec5f ("selftests: fix the return value for UDP GRO test") We have this test since Focal. This patch can be cherry-picked into all the affected kernels. [Test] Run this test with: sudo ./udpgro.sh And check its final return value with: echo $? If there is any failure, the return value should not be 0. [Where problems could occur] If this fix is incorrect it might affect the test execution, but it should be fine as this is just affecting the test tool. Also, with this patch, we are expecting to see this test case to fail until bug 1908501 got fixed. Po-Hsu Lin (1): selftests: fix the return value for UDP GRO test tools/testing/selftests/net/udpgro.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) -- 2.7.4 -- kernel-team mailing list [hidden email] https://lists.ubuntu.com/mailman/listinfo/kernel-team |
BugLink: https://bugs.launchpad.net/bugs/1908499
The udpgro.sh will always return 0 (unless the bpf selftest was not build first) even if there are some failed sub test-cases. Therefore the kselftest framework will report this case is OK. Check and return the exit status of each test to make it easier to spot real failures. Signed-off-by: Po-Hsu Lin <[hidden email]> Signed-off-by: David S. Miller <[hidden email]> (cherry picked from commit 3503ee6c0bec5f173d606359e6384a5ef85492fb) Signed-off-by: Po-Hsu Lin <[hidden email]> --- tools/testing/selftests/net/udpgro.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tools/testing/selftests/net/udpgro.sh b/tools/testing/selftests/net/udpgro.sh index ac2a30b..f8a19f5 100755 --- a/tools/testing/selftests/net/udpgro.sh +++ b/tools/testing/selftests/net/udpgro.sh @@ -5,6 +5,14 @@ readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" +# set global exit status, but never reset nonzero one. +check_err() +{ + if [ $ret -eq 0 ]; then + ret=$1 + fi +} + cleanup() { local -r jobs="$(jobs -p)" local -r ns="$(ip netns list|grep $PEER_NS)" @@ -44,7 +52,9 @@ run_one() { # Hack: let bg programs complete the startup sleep 0.1 ./udpgso_bench_tx ${tx_args} + ret=$? wait $(jobs -p) + return $ret } run_test() { @@ -87,8 +97,10 @@ run_one_nat() { sleep 0.1 ./udpgso_bench_tx ${tx_args} + ret=$? kill -INT $pid wait $(jobs -p) + return $ret } run_one_2sock() { @@ -110,7 +122,9 @@ run_one_2sock() { sleep 0.1 # first UDP GSO socket should be closed at this point ./udpgso_bench_tx ${tx_args} + ret=$? wait $(jobs -p) + return $ret } run_nat_test() { @@ -131,36 +145,54 @@ run_all() { local -r core_args="-l 4" local -r ipv4_args="${core_args} -4 -D 192.168.1.1" local -r ipv6_args="${core_args} -6 -D 2001:db8::1" + ret=0 echo "ipv4" run_test "no GRO" "${ipv4_args} -M 10 -s 1400" "-4 -n 10 -l 1400" + check_err $? # explicitly check we are not receiving UDP_SEGMENT cmsg (-S -1) # when GRO does not take place run_test "no GRO chk cmsg" "${ipv4_args} -M 10 -s 1400" "-4 -n 10 -l 1400 -S -1" + check_err $? # the GSO packets are aggregated because: # * veth schedule napi after each xmit # * segmentation happens in BH context, veth napi poll is delayed after # the transmission of the last segment run_test "GRO" "${ipv4_args} -M 1 -s 14720 -S 0 " "-4 -n 1 -l 14720" + check_err $? run_test "GRO chk cmsg" "${ipv4_args} -M 1 -s 14720 -S 0 " "-4 -n 1 -l 14720 -S 1472" + check_err $? run_test "GRO with custom segment size" "${ipv4_args} -M 1 -s 14720 -S 500 " "-4 -n 1 -l 14720" + check_err $? run_test "GRO with custom segment size cmsg" "${ipv4_args} -M 1 -s 14720 -S 500 " "-4 -n 1 -l 14720 -S 500" + check_err $? run_nat_test "bad GRO lookup" "${ipv4_args} -M 1 -s 14720 -S 0" "-n 10 -l 1472" + check_err $? run_2sock_test "multiple GRO socks" "${ipv4_args} -M 1 -s 14720 -S 0 " "-4 -n 1 -l 14720 -S 1472" + check_err $? echo "ipv6" run_test "no GRO" "${ipv6_args} -M 10 -s 1400" "-n 10 -l 1400" + check_err $? run_test "no GRO chk cmsg" "${ipv6_args} -M 10 -s 1400" "-n 10 -l 1400 -S -1" + check_err $? run_test "GRO" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 1 -l 14520" + check_err $? run_test "GRO chk cmsg" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 1 -l 14520 -S 1452" + check_err $? run_test "GRO with custom segment size" "${ipv6_args} -M 1 -s 14520 -S 500" "-n 1 -l 14520" + check_err $? run_test "GRO with custom segment size cmsg" "${ipv6_args} -M 1 -s 14520 -S 500" "-n 1 -l 14520 -S 500" + check_err $? run_nat_test "bad GRO lookup" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 10 -l 1452" + check_err $? run_2sock_test "multiple GRO socks" "${ipv6_args} -M 1 -s 14520 -S 0 " "-n 1 -l 14520 -S 1452" + check_err $? + return $ret } if [ ! -f ../bpf/xdp_dummy.o ]; then @@ -180,3 +212,5 @@ elif [[ $1 == "__subprocess_2sock" ]]; then shift run_one_2sock $@ fi + +exit $? -- 2.7.4 -- kernel-team mailing list [hidden email] https://lists.ubuntu.com/mailman/listinfo/kernel-team |
In reply to this post by Po-Hsu Lin (Sam)
On Wed, Jan 13, 2021 at 05:39:22PM +0800, Po-Hsu Lin wrote:
> [Impact] > In udpgro.sh, the exit value is 0 even if there are some failed sub > test cases: -- bye, p. -- kernel-team mailing list [hidden email] https://lists.ubuntu.com/mailman/listinfo/kernel-team |
In reply to this post by Po-Hsu Lin (Sam)
On Wed, Jan 13, 2021 at 05:39:22PM +0800, Po-Hsu Lin wrote:
> [Impact] > In udpgro.sh, the exit value is 0 even if there are some failed sub > test cases: > > $ sudo ./udpgro.sh > ipv4 > no GRO > BTF debug data section '.BTF' rejected: Invalid argument (22)! > - Length: 568 > Verifier analysis: > > magic: 0xeb9f > version: 1 > flags: 0x0 > hdr_len: 24 > type_off: 0 > type_len: 256 > str_off: 256 > str_len: 288 > btf_total_size: 568 > [1] PTR (anon) type_id=2 > [2] STRUCT xdp_md size=20 vlen=5 > data type_id=3 bits_offset=0 > data_end type_id=3 bits_offset=32 > data_meta type_id=3 bits_offset=64 > ingress_ifindex type_id=3 bits_offset=96 > rx_queue_index type_id=3 bits_offset=128 > [3] TYPEDEF __u32 type_id=4 > [4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none) > [5] FUNC_PROTO (anon) return=6 args=(1 ctx) > [6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED > [7] FUNC xdp_dummy_prog type_id=5 > [8] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED > [9] ARRAY (anon) type_id=8 index_type_id=10 nr_elems=4 > [10] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none) > [11] VAR _license type_id=9 linkage=1 > [12] DATASEC license size=0 vlen=1 size == 0 > > ./udpgso_bench_rx: poll: 0x0 expected 0x1 > > failed > ./udpgso_bench_tx: write: Connection refused > > ... > > multiple GRO socks > BTF debug data section '.BTF' rejected: Invalid argument (22)! > - Length: 568 > Verifier analysis: > > magic: 0xeb9f > version: 1 > flags: 0x0 > hdr_len: 24 > type_off: 0 > type_len: 256 > str_off: 256 > str_len: 288 > btf_total_size: 568 > [1] PTR (anon) type_id=2 > [2] STRUCT xdp_md size=20 vlen=5 > data type_id=3 bits_offset=0 > data_end type_id=3 bits_offset=32 > data_meta type_id=3 bits_offset=64 > ingress_ifindex type_id=3 bits_offset=96 > rx_queue_index type_id=3 bits_offset=128 > [3] TYPEDEF __u32 type_id=4 > [4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none) > [5] FUNC_PROTO (anon) return=6 args=(1 ctx) > [6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED > [7] FUNC xdp_dummy_prog type_id=5 > [8] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED > [9] ARRAY (anon) type_id=8 index_type_id=10 nr_elems=4 > [10] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none) > [11] VAR _license type_id=9 linkage=1 > [12] DATASEC license size=0 vlen=1 size == 0 > > ./udpgso_bench_rx: poll: 0x0 expected 0x1 > > ./udpgso_bench_rx: poll: 0x0 expected 0x1 > > failed > $ echo $? > 0 > > [Fix] > * 3503ee6c0bec5f ("selftests: fix the return value for UDP GRO test") > > We have this test since Focal. > This patch can be cherry-picked into all the affected kernels. > > [Test] > Run this test with: > sudo ./udpgro.sh > > And check its final return value with: > echo $? > > If there is any failure, the return value should not be 0. > > [Where problems could occur] > If this fix is incorrect it might affect the test execution, but it > should be fine as this is just affecting the test tool. Also, with > this patch, we are expecting to see this test case to fail until > bug 1908501 got fixed. > > Po-Hsu Lin (1): > selftests: fix the return value for UDP GRO test > > tools/testing/selftests/net/udpgro.sh | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > > -- > 2.7.4 > > > -- > kernel-team mailing list > [hidden email] > https://lists.ubuntu.com/mailman/listinfo/kernel-team -- kernel-team mailing list [hidden email] https://lists.ubuntu.com/mailman/listinfo/kernel-team |
In reply to this post by Po-Hsu Lin (Sam)
Applied to F/G master-next. Thank you! -Kelsey On 2021-01-13 17:39:22 , Po-Hsu Lin wrote: > [Impact] > In udpgro.sh, the exit value is 0 even if there are some failed sub > test cases: > > $ sudo ./udpgro.sh > ipv4 > no GRO > BTF debug data section '.BTF' rejected: Invalid argument (22)! > - Length: 568 > Verifier analysis: > > magic: 0xeb9f > version: 1 > flags: 0x0 > hdr_len: 24 > type_off: 0 > type_len: 256 > str_off: 256 > str_len: 288 > btf_total_size: 568 > [1] PTR (anon) type_id=2 > [2] STRUCT xdp_md size=20 vlen=5 > data type_id=3 bits_offset=0 > data_end type_id=3 bits_offset=32 > data_meta type_id=3 bits_offset=64 > ingress_ifindex type_id=3 bits_offset=96 > rx_queue_index type_id=3 bits_offset=128 > [3] TYPEDEF __u32 type_id=4 > [4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none) > [5] FUNC_PROTO (anon) return=6 args=(1 ctx) > [6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED > [7] FUNC xdp_dummy_prog type_id=5 > [8] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED > [9] ARRAY (anon) type_id=8 index_type_id=10 nr_elems=4 > [10] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none) > [11] VAR _license type_id=9 linkage=1 > [12] DATASEC license size=0 vlen=1 size == 0 > > ./udpgso_bench_rx: poll: 0x0 expected 0x1 > > failed > ./udpgso_bench_tx: write: Connection refused > > ... > > multiple GRO socks > BTF debug data section '.BTF' rejected: Invalid argument (22)! > - Length: 568 > Verifier analysis: > > magic: 0xeb9f > version: 1 > flags: 0x0 > hdr_len: 24 > type_off: 0 > type_len: 256 > str_off: 256 > str_len: 288 > btf_total_size: 568 > [1] PTR (anon) type_id=2 > [2] STRUCT xdp_md size=20 vlen=5 > data type_id=3 bits_offset=0 > data_end type_id=3 bits_offset=32 > data_meta type_id=3 bits_offset=64 > ingress_ifindex type_id=3 bits_offset=96 > rx_queue_index type_id=3 bits_offset=128 > [3] TYPEDEF __u32 type_id=4 > [4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none) > [5] FUNC_PROTO (anon) return=6 args=(1 ctx) > [6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED > [7] FUNC xdp_dummy_prog type_id=5 > [8] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED > [9] ARRAY (anon) type_id=8 index_type_id=10 nr_elems=4 > [10] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none) > [11] VAR _license type_id=9 linkage=1 > [12] DATASEC license size=0 vlen=1 size == 0 > > ./udpgso_bench_rx: poll: 0x0 expected 0x1 > > ./udpgso_bench_rx: poll: 0x0 expected 0x1 > > failed > $ echo $? > 0 > > [Fix] > * 3503ee6c0bec5f ("selftests: fix the return value for UDP GRO test") > > We have this test since Focal. > This patch can be cherry-picked into all the affected kernels. > > [Test] > Run this test with: > sudo ./udpgro.sh > > And check its final return value with: > echo $? > > If there is any failure, the return value should not be 0. > > [Where problems could occur] > If this fix is incorrect it might affect the test execution, but it > should be fine as this is just affecting the test tool. Also, with > this patch, we are expecting to see this test case to fail until > bug 1908501 got fixed. > > Po-Hsu Lin (1): > selftests: fix the return value for UDP GRO test > > tools/testing/selftests/net/udpgro.sh | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > > -- > 2.7.4 > > > -- > kernel-team mailing list > [hidden email] > https://lists.ubuntu.com/mailman/listinfo/kernel-team -- kernel-team mailing list [hidden email] https://lists.ubuntu.com/mailman/listinfo/kernel-team |
In reply to this post by Po-Hsu Lin (Sam)
On 13.1.2021 11.39, Po-Hsu Lin wrote:
> [Impact] > In udpgro.sh, the exit value is 0 even if there are some failed sub > test cases: > > $ sudo ./udpgro.sh > ipv4 > no GRO > BTF debug data section '.BTF' rejected: Invalid argument (22)! > - Length: 568 > Verifier analysis: > > magic: 0xeb9f > version: 1 > flags: 0x0 > hdr_len: 24 > type_off: 0 > type_len: 256 > str_off: 256 > str_len: 288 > btf_total_size: 568 > [1] PTR (anon) type_id=2 > [2] STRUCT xdp_md size=20 vlen=5 > data type_id=3 bits_offset=0 > data_end type_id=3 bits_offset=32 > data_meta type_id=3 bits_offset=64 > ingress_ifindex type_id=3 bits_offset=96 > rx_queue_index type_id=3 bits_offset=128 > [3] TYPEDEF __u32 type_id=4 > [4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none) > [5] FUNC_PROTO (anon) return=6 args=(1 ctx) > [6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED > [7] FUNC xdp_dummy_prog type_id=5 > [8] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED > [9] ARRAY (anon) type_id=8 index_type_id=10 nr_elems=4 > [10] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none) > [11] VAR _license type_id=9 linkage=1 > [12] DATASEC license size=0 vlen=1 size == 0 > > ./udpgso_bench_rx: poll: 0x0 expected 0x1 > > failed > ./udpgso_bench_tx: write: Connection refused > > ... > > multiple GRO socks > BTF debug data section '.BTF' rejected: Invalid argument (22)! > - Length: 568 > Verifier analysis: > > magic: 0xeb9f > version: 1 > flags: 0x0 > hdr_len: 24 > type_off: 0 > type_len: 256 > str_off: 256 > str_len: 288 > btf_total_size: 568 > [1] PTR (anon) type_id=2 > [2] STRUCT xdp_md size=20 vlen=5 > data type_id=3 bits_offset=0 > data_end type_id=3 bits_offset=32 > data_meta type_id=3 bits_offset=64 > ingress_ifindex type_id=3 bits_offset=96 > rx_queue_index type_id=3 bits_offset=128 > [3] TYPEDEF __u32 type_id=4 > [4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none) > [5] FUNC_PROTO (anon) return=6 args=(1 ctx) > [6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED > [7] FUNC xdp_dummy_prog type_id=5 > [8] INT char size=1 bits_offset=0 nr_bits=8 encoding=SIGNED > [9] ARRAY (anon) type_id=8 index_type_id=10 nr_elems=4 > [10] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none) > [11] VAR _license type_id=9 linkage=1 > [12] DATASEC license size=0 vlen=1 size == 0 > > ./udpgso_bench_rx: poll: 0x0 expected 0x1 > > ./udpgso_bench_rx: poll: 0x0 expected 0x1 > > failed > $ echo $? > 0 > > [Fix] > * 3503ee6c0bec5f ("selftests: fix the return value for UDP GRO test") > > We have this test since Focal. > This patch can be cherry-picked into all the affected kernels. > > [Test] > Run this test with: > sudo ./udpgro.sh > > And check its final return value with: > echo $? > > If there is any failure, the return value should not be 0. > > [Where problems could occur] > If this fix is incorrect it might affect the test execution, but it > should be fine as this is just affecting the test tool. Also, with > this patch, we are expecting to see this test case to fail until > bug 1908501 got fixed. > > Po-Hsu Lin (1): > selftests: fix the return value for UDP GRO test > > tools/testing/selftests/net/udpgro.sh | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > applied to oem-5.6, thanks -- t -- kernel-team mailing list [hidden email] https://lists.ubuntu.com/mailman/listinfo/kernel-team |
Free forum by Nabble | Edit this page |