event/opdl: add unit tests
This commit adds unit test inside the OPDL PMD. There is a PMd parameter "self_test" can be used to triger the test when vdev bus probe opdl device e.g. sudo ./app/test --vdev="event_opdl0,self_test=1" Signed-off-by: Liang Ma <liang.j.ma@intel.com> Signed-off-by: Peter Mccarthy <peter.mccarthy@intel.com>
This commit is contained in:
parent
8ca5fad56d
commit
d548ef513c
@ -31,6 +31,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_ring.c
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_evdev.c
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_evdev_init.c
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_evdev_xstats.c
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_test.c
|
||||
|
||||
# export include files
|
||||
SYMLINK-y-include +=
|
||||
|
@ -728,6 +728,9 @@ opdl_probe(struct rte_vdev_device *vdev)
|
||||
str_len = strlen(name);
|
||||
memcpy(opdl->service_name, name, str_len);
|
||||
|
||||
if (do_test == 1)
|
||||
test_result = opdl_selftest();
|
||||
|
||||
return test_result;
|
||||
}
|
||||
|
||||
|
@ -337,5 +337,6 @@ int initialise_all_other_ports(struct rte_eventdev *dev);
|
||||
int initialise_queue_zero_ports(struct rte_eventdev *dev);
|
||||
int assign_internal_queue_ids(struct rte_eventdev *dev);
|
||||
void destroy_queues_and_rings(struct rte_eventdev *dev);
|
||||
int opdl_selftest(void);
|
||||
|
||||
#endif /* _OPDL_EVDEV_H_ */
|
||||
|
1056
drivers/event/opdl/opdl_test.c
Normal file
1056
drivers/event/opdl/opdl_test.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user