From: Pavan Nikhilesh Date: Mon, 11 Dec 2017 15:13:43 +0000 (+0530) Subject: app/eventdev: add ethernet device tear down X-Git-Tag: spdx-start~208 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7f3daf34269e42ec31bf330fa6f869b05a9fec2f;p=dpdk.git 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 Acked-by: Jerin Jacob --- diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c index a5e2837ede..4beb8b31b6 100644 --- a/app/test-eventdev/test_perf_atq.c +++ b/app/test-eventdev/test_perf_atq.c @@ -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, }; diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index 32749a695a..7379539a45 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -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) { diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h index b6758a9362..d81ea9a53d 100644 --- a/app/test-eventdev/test_perf_common.h +++ b/app/test-eventdev/test_perf_common.h @@ -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_ */ diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c index 41b70ad36e..7aa0aea5a1 100644 --- a/app/test-eventdev/test_perf_queue.c +++ b/app/test-eventdev/test_perf_queue.c @@ -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, };