diff options
author | ettus <matt.prost@ni.com> | 2020-08-13 16:14:56 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-08-14 15:10:34 -0500 |
commit | 8ec7449d432a370fa518cd7ad9e98b17b1fe8a45 (patch) | |
tree | c361ebed472a1af003a2e99084138b66e0706526 | |
parent | f2ec5c91a79cee4c05465349d7e0da865ad1bead (diff) | |
download | uhd-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>
-rw-r--r-- | host/lib/transport/uhd-dpdk/dpdk_common.cpp | 8 |
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); |