selftests, xsk: Fix rx_full stats test
Fix the rx_full stats test so that it correctly reports pass even when
the fill ring is not full of buffers.
Fixes: 872a1184db
("selftests: xsk: Put the same buffer only once in the fill ring")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/bpf/20220121123508.12759-1-magnus.karlsson@gmail.com
This commit is contained in:
Родитель
ed8bb03222
Коммит
b4ec6a1923
|
@ -906,7 +906,10 @@ static bool rx_stats_are_valid(struct ifobject *ifobject)
|
|||
return true;
|
||||
case STAT_TEST_RX_FULL:
|
||||
xsk_stat = stats.rx_ring_full;
|
||||
expected_stat -= RX_FULL_RXQSIZE;
|
||||
if (ifobject->umem->num_frames < XSK_RING_PROD__DEFAULT_NUM_DESCS)
|
||||
expected_stat = ifobject->umem->num_frames - RX_FULL_RXQSIZE;
|
||||
else
|
||||
expected_stat = XSK_RING_PROD__DEFAULT_NUM_DESCS - RX_FULL_RXQSIZE;
|
||||
break;
|
||||
case STAT_TEST_RX_FILL_EMPTY:
|
||||
xsk_stat = stats.rx_fill_ring_empty_descs;
|
||||
|
|
Загрузка…
Ссылка в новой задаче