Skip to content

Commit 8d41ed9

Browse files
tvyavahaKernel Patches Daemon
authored and
Kernel Patches Daemon
committed
selftests/xsk: Add packet stream replacement function
Add pkt_stream_replace_ifobject function to replace the packet stream for a given ifobject. Signed-off-by: Tushar Vyavahare <[email protected]>
1 parent 4d1d6fc commit 8d41ed9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tools/testing/selftests/bpf/xskxceiver.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -757,14 +757,15 @@ static struct pkt_stream *pkt_stream_clone(struct pkt_stream *pkt_stream)
757757
return pkt_stream_generate(pkt_stream->nb_pkts, pkt_stream->pkts[0].len);
758758
}
759759

760-
static void pkt_stream_replace(struct test_spec *test, u32 nb_pkts, u32 pkt_len)
760+
static void pkt_stream_replace_ifobject(struct ifobject *ifobj, u32 nb_pkts, u32 pkt_len)
761761
{
762-
struct pkt_stream *pkt_stream;
762+
ifobj->xsk->pkt_stream = pkt_stream_generate(nb_pkts, pkt_len);
763+
}
763764

764-
pkt_stream = pkt_stream_generate(nb_pkts, pkt_len);
765-
test->ifobj_tx->xsk->pkt_stream = pkt_stream;
766-
pkt_stream = pkt_stream_generate(nb_pkts, pkt_len);
767-
test->ifobj_rx->xsk->pkt_stream = pkt_stream;
765+
static void pkt_stream_replace(struct test_spec *test, u32 nb_pkts, u32 pkt_len)
766+
{
767+
pkt_stream_replace_ifobject(test->ifobj_tx, nb_pkts, pkt_len);
768+
pkt_stream_replace_ifobject(test->ifobj_rx, nb_pkts, pkt_len);
768769
}
769770

770771
static void __pkt_stream_replace_half(struct ifobject *ifobj, u32 pkt_len,

0 commit comments

Comments
 (0)