mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-14 06:24:53 +08:00
selftests: xsk: Add test case for packets at end of UMEM
Add test case to testapp_invalid_desc for valid packets at the end of the UMEM. Signed-off-by: Kal Conley <kal.conley@dectris.com> Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> Link: https://lore.kernel.org/r/20230403145047.33065-3-kal.conley@dectris.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
This commit is contained in:
parent
7a2050df24
commit
ccd1b2933f
@ -1662,6 +1662,8 @@ static void testapp_invalid_desc(struct test_spec *test)
|
||||
{-2, PKT_SIZE, 0, false},
|
||||
/* Packet too large */
|
||||
{0x2000, XSK_UMEM__INVALID_FRAME_SIZE, 0, false},
|
||||
/* Up to end of umem allowed */
|
||||
{umem_size - PKT_SIZE, PKT_SIZE, 0, true},
|
||||
/* After umem ends */
|
||||
{umem_size, PKT_SIZE, 0, false},
|
||||
/* Straddle the end of umem */
|
||||
@ -1675,16 +1677,17 @@ static void testapp_invalid_desc(struct test_spec *test)
|
||||
|
||||
if (test->ifobj_tx->umem->unaligned_mode) {
|
||||
/* Crossing a page boundrary allowed */
|
||||
pkts[6].valid = true;
|
||||
pkts[7].valid = true;
|
||||
}
|
||||
if (test->ifobj_tx->umem->frame_size == XSK_UMEM__DEFAULT_FRAME_SIZE / 2) {
|
||||
/* Crossing a 2K frame size boundrary not allowed */
|
||||
pkts[7].valid = false;
|
||||
pkts[8].valid = false;
|
||||
}
|
||||
|
||||
if (test->ifobj_tx->shared_umem) {
|
||||
pkts[4].addr += umem_size;
|
||||
pkts[5].addr += umem_size;
|
||||
pkts[6].addr += umem_size;
|
||||
}
|
||||
|
||||
pkt_stream_generate_custom(test, pkts, ARRAY_SIZE(pkts));
|
||||
|
Loading…
Reference in New Issue
Block a user