Skip to content

Commit

Permalink
event/sw: fix flow ID init in self test
Browse files Browse the repository at this point in the history
[ upstream commit ab059e8 ]

The issue is seen by unit tests:

MALLOC_PERTURB_=204 \
DPDK_TEST=eventdev_selftest_sw \
/root/dpdk/x86_64-native-linuxapp-gcc/app/test/dpdk-test -c 0xff
(...)
*** Running XStats ID Reset test...
12: 1761: qid_0_port_2_pinned_flows value , expected 1 got 7
1778: qid_0_port_2_pinned_flows value incorrect, expected 1 got 7
ERROR - XStats ID Reset test FAILED.
SW Eventdev Selftest Failed.
Test Failed

The flow ID is not set in the event, which results in an undefined
flow, whose value depends on what was previously in stack. Having
different flows for the packets makes the test to fail, since only one
flow is expected.

This only happens in -O3, where the same stack area is shared by the
event object and the address of the mbuf allocated in rte_gen_arp().

Fix this by properly initializing the flow id.

Bugzilla ID: 1101
Fixes: e21df4b ("test/eventdev: add SW xstats tests")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
olivier-matz-6wind authored and kevintraynor committed Nov 1, 2022
1 parent 2468712 commit 14a1303
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/event/sw/sw_evdev_selftest.c
Expand Up @@ -1488,6 +1488,7 @@ xstats_id_reset_tests(struct test *t)
goto fail;
}
ev.queue_id = t->qid[i];
ev.flow_id = 0;
ev.op = RTE_EVENT_OP_NEW;
ev.mbuf = arp;
*rte_event_pmd_selftest_seqn(arp) = i;
Expand Down

0 comments on commit 14a1303

Please sign in to comment.