Skip to content

Commit

Permalink
selftests/xsk: Add packet stream replacement function
Browse files Browse the repository at this point in the history
Add pkt_stream_replace_ifobject function to replace the packet stream for
a given ifobject.

Signed-off-by: Tushar Vyavahare <[email protected]>
  • Loading branch information
tvyavaha authored and Kernel Patches Daemon committed Mar 3, 2025
1 parent b22bdf7 commit 933259d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tools/testing/selftests/bpf/xskxceiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,14 +757,15 @@ static struct pkt_stream *pkt_stream_clone(struct pkt_stream *pkt_stream)
return pkt_stream_generate(pkt_stream->nb_pkts, pkt_stream->pkts[0].len);
}

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

pkt_stream = pkt_stream_generate(nb_pkts, pkt_len);
test->ifobj_tx->xsk->pkt_stream = pkt_stream;
pkt_stream = pkt_stream_generate(nb_pkts, pkt_len);
test->ifobj_rx->xsk->pkt_stream = pkt_stream;
static void pkt_stream_replace(struct test_spec *test, u32 nb_pkts, u32 pkt_len)
{
pkt_stream_replace_ifobject(test->ifobj_tx, nb_pkts, pkt_len);
pkt_stream_replace_ifobject(test->ifobj_rx, nb_pkts, pkt_len);
}

static void __pkt_stream_replace_half(struct ifobject *ifobj, u32 pkt_len,
Expand Down

0 comments on commit 933259d

Please sign in to comment.