From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 2/2] ms/selftests/xsk: fix number of Tx frags in invalid packet
Date: Mon, 16 Nov 2026 15:07:33 +0200 [thread overview]
Message-ID: <20261116130936.612078-3-eva.kurchatova@virtuozzo.com> (raw)
In-Reply-To: <20261116130936.612078-1-eva.kurchatova@virtuozzo.com>
From: Larysa Zaremba <larysa.zaremba@intel.com>
The issue occurs in TOO_MANY_FRAGS test case when xdp_zc_max_segs is set to
an odd number.
TOO_MANY_FRAGS test case contains an invalid packet consisting of
(xdp_zc_max_segs) frags. Every frag, even the last one has XDP_PKT_CONTD
flag set. This packet is expected to be dropped. After that, there is a
valid linear packet, which is expected to be received back.
Once (xdp_zc_max_segs) is an odd number, the last packet cannot be
received, if packet forwarding between Rx and Tx interfaces relies on
the ethernet header, e.g. checks for ETH_P_LOOPBACK. Packet is malformed,
if all traffic is looped.
Turns out, sending function processes multiple invalid frags as if they
were in 2-frag packets. So once the invalid mbuf packet contains an odd
number of those, the valid packet after gets paired with the previous
invalid descriptor, and hence does not get an ethernet header generated, so
it is either dropped or malformed.
Make invalid packets in verbatim mode always have only a single frag. For
such packets, number of frags is otherwise meaningless, as descriptor flags
are pre-configured in verbatim mode and packet data is not generated for
invalid descriptors.
Fixes: 697604492b64 ("selftests/xsk: add invalid descriptor test for multi-buffer")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://lore.kernel.org/r/20260203155103.2305816-3-larysa.zaremba@intel.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
(cherry picked from commit 88af9fefed412e4bea9a1a771cbe6fe347fa3507)
Rebase note: applied to xskxceiver.c. Mainline moved this code to
test_xsk.c in commit 3ab77f35a75e ("selftests/bpf: test_xsk: Split
xskxceiver") and then to prog_tests/ in commit d1aec26fce25
("selftests/bpf: test_xsk: Integrate test_xsk.c to test_progs
framework"). Neither is here. The code is the same.
https://virtuozzo.atlassian.net/browse/VSTOR-154852
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
tools/testing/selftests/bpf/xskxceiver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
index 014b20ef4aaf..5707c8d520ef 100644
--- a/tools/testing/selftests/bpf/xskxceiver.c
+++ b/tools/testing/selftests/bpf/xskxceiver.c
@@ -724,7 +724,7 @@ static u32 pkt_nb_frags(u32 frame_size, struct pkt_stream *pkt_stream, struct pk
}
/* Search for the end of the packet in verbatim mode */
- if (!pkt_continues(pkt->options))
+ if (!pkt_continues(pkt->options) || !pkt->valid)
return nb_frags;
next_frag = pkt_stream->current_pkt_nb;
--
2.56.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-16 13:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 13:07 [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes Eva Kurchatova
2026-11-16 13:07 ` [Devel] [PATCH hci-8.1 1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use Eva Kurchatova
2026-11-16 13:13 ` no-reply
2026-11-16 13:40 ` Eva Kurchatova (Virtuozzo)
2026-11-16 13:07 ` Eva Kurchatova [this message]
2026-11-16 13:13 ` [Devel] [PATCH hci-8.1 2/2] ms/selftests/xsk: fix number of Tx frags in invalid packet no-reply
2026-11-16 17:00 ` [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes Konstantin Khorenko
2026-11-16 17:00 ` Konstantin Khorenko
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=20261116130936.612078-3-eva.kurchatova@virtuozzo.com \
--to=eva.kurchatova@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.