Skip to content

Commit 13c1bf4

Browse files
xli98gregkh
authored andcommitted
selftests: Calculate udpgso segment count without header adjustment
[ Upstream commit 5471d52 ] 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: 158390e ("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>
1 parent abe74fb commit 13c1bf4

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎tools/testing/selftests/net/udpgso.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ struct testcase testcases_v4[] = {
156156
},
157157
{
158158
/* send max number of min sized segments */
159-
.tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V4,
159+
.tlen = UDP_MAX_SEGMENTS,
160160
.gso_len = 1,
161-
.r_num_mss = UDP_MAX_SEGMENTS - CONST_HDRLEN_V4,
161+
.r_num_mss = UDP_MAX_SEGMENTS,
162162
},
163163
{
164164
/* send max number + 1 of min sized segments: fail */
165-
.tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V4 + 1,
165+
.tlen = UDP_MAX_SEGMENTS + 1,
166166
.gso_len = 1,
167167
.tfail = true,
168168
},
@@ -259,13 +259,13 @@ struct testcase testcases_v6[] = {
259259
},
260260
{
261261
/* send max number of min sized segments */
262-
.tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V6,
262+
.tlen = UDP_MAX_SEGMENTS,
263263
.gso_len = 1,
264-
.r_num_mss = UDP_MAX_SEGMENTS - CONST_HDRLEN_V6,
264+
.r_num_mss = UDP_MAX_SEGMENTS,
265265
},
266266
{
267267
/* send max number + 1 of min sized segments: fail */
268-
.tlen = UDP_MAX_SEGMENTS - CONST_HDRLEN_V6 + 1,
268+
.tlen = UDP_MAX_SEGMENTS + 1,
269269
.gso_len = 1,
270270
.tfail = true,
271271
},

0 commit comments

Comments
 (0)