From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org, shuah@kernel.org,
willemb@google.com, petrm@nvidia.com, anubhavsinggh@google.com,
richardbgobert@gmail.com, linux-kselftest@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 3/6] selftests: drv-net: gro: always wait for FIN in the capacity test
Date: Wed, 1 Apr 2026 11:26:22 -0700 [thread overview]
Message-ID: <20260401182625.372605-4-kuba@kernel.org> (raw)
In-Reply-To: <20260401182625.372605-1-kuba@kernel.org>
The new capacity/order test exits as soon as it sees the expected
packet sequence. This may allow the "flushing" FIN packet to spill
over to the next test. Let's always wait for the FIN before exiting.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
tools/testing/selftests/net/lib/gro.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/net/lib/gro.c b/tools/testing/selftests/net/lib/gro.c
index 27ccd742615a..f05398c18e0c 100644
--- a/tools/testing/selftests/net/lib/gro.c
+++ b/tools/testing/selftests/net/lib/gro.c
@@ -1154,7 +1154,7 @@ static void check_capacity_pkts(int fd)
memset(coalesced, 0, sizeof(coalesced));
memset(flow_order, -1, sizeof(flow_order));
- while (total_data < num_flows * CAPACITY_PAYLOAD_LEN * 2) {
+ while (1) {
ip_ext_len = 0;
pkt_size = recv(fd, buffer, IP_MAXPACKET + ETH_HLEN + 1, 0);
if (pkt_size < 0)
@@ -1167,7 +1167,6 @@ static void check_capacity_pkts(int fd)
tcph = (struct tcphdr *)(buffer + tcp_offset + ip_ext_len);
- /* FIN packet terminates reception */
if (tcph->fin)
break;
@@ -1189,7 +1188,13 @@ static void check_capacity_pkts(int fd)
data_len = pkt_size - total_hdr_len - ip_ext_len;
}
- flow_order[num_pkt] = flow_id;
+ if (num_pkt < num_flows * 2) {
+ flow_order[num_pkt] = flow_id;
+ } else if (num_pkt == num_flows * 2) {
+ vlog("More packets than expected (%d)\n",
+ num_flows * 2);
+ fail_reason = fail_reason ?: "too many packets";
+ }
coalesced[flow_id] = data_len;
if (data_len == CAPACITY_PAYLOAD_LEN * 2) {
--
2.53.0
next prev parent reply other threads:[~2026-04-01 18:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 18:26 [PATCH net-next 0/6] selftests: drv-net: gro: more test cases Jakub Kicinski
2026-04-01 18:26 ` [PATCH net-next 1/6] selftests: drv-net: gro: add data burst test case Jakub Kicinski
2026-04-01 18:26 ` [PATCH net-next 2/6] selftests: drv-net: gro: add 1 byte payload test Jakub Kicinski
2026-04-01 18:26 ` Jakub Kicinski [this message]
2026-04-01 18:26 ` [PATCH net-next 4/6] selftests: drv-net: gro: prepare for ip6ip6 support Jakub Kicinski
2026-04-01 18:26 ` [PATCH net-next 5/6] selftests: drv-net: gro: test ip6ip6 Jakub Kicinski
2026-04-02 0:20 ` Willem de Bruijn
2026-04-01 18:26 ` [PATCH net-next 6/6] selftests: drv-net: gro: add a test for bad IPv4 csum Jakub Kicinski
2026-04-02 0:28 ` Willem de Bruijn
2026-04-02 2:10 ` Jakub Kicinski
2026-04-02 2:39 ` Willem de Bruijn
2026-04-02 0:19 ` [PATCH net-next 0/6] selftests: drv-net: gro: more test cases Willem de Bruijn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260401182625.372605-4-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anubhavsinggh@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=richardbgobert@gmail.com \
--cc=shuah@kernel.org \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox