app/eventdev: add ethernet device tear down
Add ethernet device destroy functions to stop and close ethdev ports if they are configured when prod_type_ethdev option is enabled. Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
This commit is contained in:
parent
3fc8de4f8d
commit
7f3daf3426
@ -258,6 +258,7 @@ static const struct evt_test_ops perf_atq = {
|
||||
.launch_lcores = perf_atq_launch_lcores,
|
||||
.eventdev_destroy = perf_eventdev_destroy,
|
||||
.mempool_destroy = perf_mempool_destroy,
|
||||
.ethdev_destroy = perf_ethdev_destroy,
|
||||
.test_result = perf_test_result,
|
||||
.test_destroy = perf_test_destroy,
|
||||
};
|
||||
|
@ -444,6 +444,19 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
|
||||
{
|
||||
int i;
|
||||
RTE_SET_USED(test);
|
||||
|
||||
if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
|
||||
for (i = 0; i < rte_eth_dev_count(); i++) {
|
||||
rte_eth_dev_stop(i);
|
||||
rte_eth_dev_close(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
|
||||
{
|
||||
|
@ -139,6 +139,7 @@ int perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
|
||||
void perf_opt_dump(struct evt_options *opt, uint8_t nb_queues);
|
||||
void perf_test_destroy(struct evt_test *test, struct evt_options *opt);
|
||||
void perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt);
|
||||
void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt);
|
||||
void perf_mempool_destroy(struct evt_test *test, struct evt_options *opt);
|
||||
|
||||
#endif /* _TEST_PERF_COMMON_ */
|
||||
|
@ -270,6 +270,7 @@ static const struct evt_test_ops perf_queue = {
|
||||
.launch_lcores = perf_queue_launch_lcores,
|
||||
.eventdev_destroy = perf_eventdev_destroy,
|
||||
.mempool_destroy = perf_mempool_destroy,
|
||||
.ethdev_destroy = perf_ethdev_destroy,
|
||||
.test_result = perf_test_result,
|
||||
.test_destroy = perf_test_destroy,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user