| From 3cb7341d2e748ffa04a1ebf9e1350866f74e3fdb Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Thu, 23 Dec 2021 22:24:41 +0000 |
| Subject: selftests: Calculate udpgso segment count without header adjustment |
| |
| From: Coco Li <lixiaoyan@google.com> |
| |
| [ Upstream commit 5471d5226c3b39b3d2f7011c082d5715795bd65c ] |
| |
| The below referenced commit correctly updated the computation of number |
| of segments (gso_size) by using only the gso payload size and |
| removing the header lengths. |
| |
| With this change the regression test started failing. Update |
| the tests to match this new behavior. |
| |
| Both IPv4 and IPv6 tests are updated, as a separate patch in this series |
| will update udp_v6_send_skb to match this change in udp_send_skb. |
| |
| Fixes: 158390e45612 ("udp: using datalen to cap max gso segments") |
| Signed-off-by: Coco Li <lixiaoyan@google.com> |
| Reviewed-by: Willem de Bruijn <willemb@google.com> |
| Link: https://lore.kernel.org/r/20211223222441.2975883-2-lixiaoyan@google.com |
| Signed-off-by: Jakub Kicinski <kuba@kernel.org> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| tools/testing/selftests/net/udpgso.c | 12 ++++++------ |
| 1 file changed, 6 insertions(+), 6 deletions(-) |
| |
| diff --git a/tools/testing/selftests/net/udpgso.c b/tools/testing/selftests/net/udpgso.c |
| index 270c17ab071e4..23177b6436067 100644 |
| --- a/tools/testing/selftests/net/udpgso.c |
| +++ b/tools/testing/selftests/net/udpgso.c |
| @@ -157,13 +157,13 @@ struct testcase testcases_v4[] = { |
| }, |
| { |
| /* send max number of min sized segments */ |
| - .tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V4, |
| + .tlen = UDP_MAX_SEGMENTS, |
| .gso_len = 1, |
| - .r_num_mss = UDP_MAX_SEGMENTS - CONST_HDRLEN_V4, |
| + .r_num_mss = UDP_MAX_SEGMENTS, |
| }, |
| { |
| /* send max number + 1 of min sized segments: fail */ |
| - .tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V4 + 1, |
| + .tlen = UDP_MAX_SEGMENTS + 1, |
| .gso_len = 1, |
| .tfail = true, |
| }, |
| @@ -260,13 +260,13 @@ struct testcase testcases_v6[] = { |
| }, |
| { |
| /* send max number of min sized segments */ |
| - .tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V6, |
| + .tlen = UDP_MAX_SEGMENTS, |
| .gso_len = 1, |
| - .r_num_mss = UDP_MAX_SEGMENTS - CONST_HDRLEN_V6, |
| + .r_num_mss = UDP_MAX_SEGMENTS, |
| }, |
| { |
| /* send max number + 1 of min sized segments: fail */ |
| - .tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V6 + 1, |
| + .tlen = UDP_MAX_SEGMENTS + 1, |
| .gso_len = 1, |
| .tfail = true, |
| }, |
| -- |
| 2.34.1 |
| |