]> git.droids-corp.org - dpdk.git/commitdiff
app/eventdev: add ethernet device tear down
authorPavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Mon, 11 Dec 2017 15:13:43 +0000 (20:43 +0530)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Fri, 19 Jan 2018 15:09:56 +0000 (16:09 +0100)
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>
app/test-eventdev/test_perf_atq.c
app/test-eventdev/test_perf_common.c
app/test-eventdev/test_perf_common.h
app/test-eventdev/test_perf_queue.c

index a5e2837ede8179cabba1e4b4f53cc6d1a0aebe55..4beb8b31b6b6439137d3845fc1354149f0b90954 100644 (file)
@@ -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,
 };
index 32749a695a4b701dfb1a45e421bcc800634e6191..7379539a45e0503137155219d0ab73256e76be4d 100644 (file)
@@ -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)
 {
index b6758a9362a018b331d208cc635b5fc2fc4f1175..d81ea9a53d43b28b583582008229c24d11c23669 100644 (file)
@@ -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_ */
index 41b70ad36e3850cea5f89c75bcd8b9495aca6543..7aa0aea5a103607681dea91c3f68793d18cf493c 100644 (file)
@@ -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,
 };