lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 17 Apr 2023 20:24:28 +0800
From:   Yang Yang <yang.yang29@....com.cn>
To:     davem@...emloft.net, edumazet@...gle.com,
        willemdebruijn.kernel@...il.com
Cc:     yang.yang29@....com.cn, kuba@...nel.org,
        linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        netdev@...r.kernel.org, pabeni@...hat.com, shuah@...nel.org,
        zhang.yunkai@....com.cn, xu.xin16@....com.cn,
        Xuexin Jiang <jiang.xuexin@....com.cn>
Subject: [PATCH linux-next 2/3] selftests: net: udpgso_bench_rx: Fix gsosize exceptions

From: Zhang Yunkai (CGEL ZTE) <zhang.yunkai@....com.cn>

The -S parameter of the receiving terminal will most likely cause the
following error.

Executing the following command fails:
bash# udpgso_bench_tx -l 4 -4 -D "$DST"
bash# udpgso_bench_tx -l 4 -4 -D "$DST" -S 0
bash# udpgso_bench_rx -4 -G -S 1472
udp rx:     15 MB/s      256 calls/s
udp rx:     30 MB/s      512 calls/s
udpgso_bench_rx: recv: bad gso size, got -1, expected 1472
(-1 == no gso cmsg))

The actual message on the receiving end is as follows:
 IP 192.168.2.199.55238 > 192.168.2.203.8000: UDP, length 7360
 IP 192.168.2.199.55238 > 192.168.2.203.8000: UDP, length 1472
 IP 192.168.2.199.55238 > 192.168.2.203.8000: UDP, length 1472
 IP 192.168.2.199.55238 > 192.168.2.203.8000: UDP, length 4416
 IP 192.168.2.199.55238 > 192.168.2.203.8000: UDP, length 11776
 IP 192.168.2.199.55238 > 192.168.2.203.8000: UDP, length 20608
recv: got one message len:1472, probably not an error.
recv: got one message len:1472, probably not an error.

This is due to network, NAPI, timer, etc., only one message being received.
We believe that this situation should be normal. We add judgment to filter
out packets that are less than gso_size and do not contain CMSG
information.

Signed-off-by: Zhang Yunkai (CGEL ZTE) <zhang.yunkai@....com.cn>
Reviewed-by: xu xin (CGEL ZTE) <xu.xin16@....com.cn>
Reviewed-by: Yang Yang (CGEL ZTE) <yang.yang29@....com.cn>
Cc: Xuexin Jiang (CGEL ZTE) <jiang.xuexin@....com.cn>
---
 tools/testing/selftests/net/udpgso_bench_rx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/udpgso_bench_rx.c b/tools/testing/selftests/net/udpgso_bench_rx.c
index a5b7f30659a5..784e88b31f7d 100644
--- a/tools/testing/selftests/net/udpgso_bench_rx.c
+++ b/tools/testing/selftests/net/udpgso_bench_rx.c
@@ -282,7 +282,9 @@ static void do_flush_udp(int fd)
 		if (cfg_expected_pkt_len && ret != cfg_expected_pkt_len)
 			error(1, 0, "recv: bad packet len, got %d,"
 			      " expected %d\n", ret, cfg_expected_pkt_len);
-		if (cfg_expected_gso_size && cfg_expected_gso_size != gso_size)
+		/* For some network reasons, ret less than gso_size is not an error */
+		if (cfg_expected_gso_size && cfg_expected_gso_size != gso_size &&
+				ret > cfg_expected_gso_size)
 			error(1, 0, "recv: bad gso size, got %d, expected %d %s",
 				gso_size, cfg_expected_gso_size, "(-1 == no gso cmsg))\n");
 		if (len && cfg_verify) {
-- 
2.15.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ