From 8ec7449d432a370fa518cd7ad9e98b17b1fe8a45 Mon Sep 17 00:00:00 2001 From: ettus Date: Thu, 13 Aug 2020 16:14:56 -0500 Subject: dpdk: clean up destruction order of dpdk context members Clear the io service map and the dpdk port map in the dpdk context destructor to force them to destruct before the dpdk context. Signed-off-by: ettus --- host/lib/transport/uhd-dpdk/dpdk_common.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/host/lib/transport/uhd-dpdk/dpdk_common.cpp b/host/lib/transport/uhd-dpdk/dpdk_common.cpp index 46818e973..1ce9279ae 100644 --- a/host/lib/transport/uhd-dpdk/dpdk_common.cpp +++ b/host/lib/transport/uhd-dpdk/dpdk_common.cpp @@ -307,10 +307,10 @@ dpdk_ctx::~dpdk_ctx(void) { std::lock_guard lock(global_ctx_mutex); global_ctx = nullptr; - // Stop all the ports - for (auto& port : _ports) { - rte_eth_dev_stop(port.first); - } + // Destroy the io service + _io_srv_portid_map.clear(); + // Destroy and stop all the ports + _ports.clear(); // Free mempools for (auto& pool : _rx_pktbuf_pools) { rte_mempool_free(pool); -- cgit v1.2.3