aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
authorettus <matt.prost@ni.com>2020-08-13 16:14:56 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-08-14 15:10:34 -0500
commit8ec7449d432a370fa518cd7ad9e98b17b1fe8a45 (patch)
treec361ebed472a1af003a2e99084138b66e0706526 /host/lib/transport
parentf2ec5c91a79cee4c05465349d7e0da865ad1bead (diff)
downloaduhd-8ec7449d432a370fa518cd7ad9e98b17b1fe8a45.tar.gz
uhd-8ec7449d432a370fa518cd7ad9e98b17b1fe8a45.tar.bz2
uhd-8ec7449d432a370fa518cd7ad9e98b17b1fe8a45.zip
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 <matt.prost@ni.com>
Diffstat (limited to 'host/lib/transport')
-rw-r--r--host/lib/transport/uhd-dpdk/dpdk_common.cpp8
1 files 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<std::mutex> 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);