diff options
author | michael-west <michael.west@ettus.com> | 2020-07-07 13:37:25 -0700 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-08-04 15:41:07 -0500 |
commit | d7c64eb4b13670dbc5728f994e70dca60616af63 (patch) | |
tree | 706844126fe06450e8f262ef1b48dedbe14680de /host/lib/usrp | |
parent | 6d4c07d09ad54155df7ed374e7fbfebd9d40758b (diff) | |
download | uhd-d7c64eb4b13670dbc5728f994e70dca60616af63.tar.gz uhd-d7c64eb4b13670dbc5728f994e70dca60616af63.tar.bz2 uhd-d7c64eb4b13670dbc5728f994e70dca60616af63.zip |
RFNoC: Add xport disconnect callbacks
Transports were not disconnecting their links from the I/O service upon
destruction, leaving behind inaccessible send and recv links used by
nothing. This led to I/O errors after creating several transports.
Added callbacks to transports to automatically disconnect their links
from the I/O service when the transport is destroyed. Updated all
callers to supply a disconnect callback.
Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_mb_iface.cpp | 27 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_mb_iface.cpp | 27 |
2 files changed, 40 insertions, 14 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_mb_iface.cpp b/host/lib/usrp/mpmd/mpmd_mb_iface.cpp index d4f6cc383..534d71a4d 100644 --- a/host/lib/usrp/mpmd/mpmd_mb_iface.cpp +++ b/host/lib/usrp/mpmd/mpmd_mb_iface.cpp @@ -182,7 +182,10 @@ uhd::rfnoc::chdr_ctrl_xport::sptr mpmd_mboard_impl::mpmd_mb_iface::make_ctrl_tra pkt_factory, local_epid, send_link->get_num_send_frames(), - recv_link->get_num_recv_frames()); + recv_link->get_num_recv_frames(), + [this, send_link, recv_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); return xport; } @@ -250,9 +253,11 @@ mpmd_mboard_impl::mpmd_mb_iface::make_rx_data_transport( recv_capacity, fc_freq, fc_headroom, - lossy_xport); + lossy_xport, + [this, recv_link, send_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); - get_io_srv_mgr()->disconnect_links(recv_link, send_link); cfg_io_srv.reset(); // Connect the links to an I/O service @@ -269,7 +274,10 @@ mpmd_mboard_impl::mpmd_mb_iface::make_rx_data_transport( pkt_factory, epids, recv_link->get_num_recv_frames(), - fc_params); + fc_params, + [this, recv_link, send_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); return rx_xport; } @@ -320,9 +328,11 @@ mpmd_mboard_impl::mpmd_mb_iface::make_tx_data_transport( pyld_buff_fmt, mdata_buff_fmt, fc_freq_ratio, - fc_headroom_ratio); + fc_headroom_ratio, + [this, recv_link, send_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); - get_io_srv_mgr()->disconnect_links(recv_link, send_link); cfg_io_srv.reset(); // Connect the links to an I/O service @@ -340,7 +350,10 @@ mpmd_mboard_impl::mpmd_mb_iface::make_tx_data_transport( pkt_factory, epids, send_link->get_num_send_frames(), - buff_capacity); + buff_capacity, + [this, recv_link, send_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); return tx_xport; } diff --git a/host/lib/usrp/x300/x300_mb_iface.cpp b/host/lib/usrp/x300/x300_mb_iface.cpp index 412b28a92..a6d5e794b 100644 --- a/host/lib/usrp/x300/x300_mb_iface.cpp +++ b/host/lib/usrp/x300/x300_mb_iface.cpp @@ -117,7 +117,10 @@ uhd::rfnoc::chdr_ctrl_xport::sptr x300_impl::x300_mb_iface::make_ctrl_transport( _pkt_factory, local_epid, send_link->get_num_send_frames(), - recv_link->get_num_recv_frames()); + recv_link->get_num_recv_frames(), + [this, send_link, recv_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); return xport; } @@ -182,9 +185,11 @@ uhd::rfnoc::chdr_rx_data_xport::uptr x300_impl::x300_mb_iface::make_rx_data_tran recv_capacity, fc_freq, fc_headroom, - lossy_xport); + lossy_xport, + [this, recv_link, send_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); - get_io_srv_mgr()->disconnect_links(recv_link, send_link); cfg_io_srv.reset(); // Connect the links to an I/O service @@ -202,7 +207,10 @@ uhd::rfnoc::chdr_rx_data_xport::uptr x300_impl::x300_mb_iface::make_rx_data_tran _pkt_factory, epids, recv_link->get_num_recv_frames(), - fc_params); + fc_params, + [this, recv_link, send_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); return rx_xport; } @@ -251,9 +259,11 @@ uhd::rfnoc::chdr_tx_data_xport::uptr x300_impl::x300_mb_iface::make_tx_data_tran pyld_buff_fmt, mdata_buff_fmt, fc_freq_ratio, - fc_headroom_ratio); + fc_headroom_ratio, + [this, recv_link, send_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); - get_io_srv_mgr()->disconnect_links(recv_link, send_link); cfg_io_srv.reset(); // Connect the links to an I/O service @@ -271,7 +281,10 @@ uhd::rfnoc::chdr_tx_data_xport::uptr x300_impl::x300_mb_iface::make_tx_data_tran _pkt_factory, epids, send_link->get_num_send_frames(), - buff_capacity); + buff_capacity, + [this, recv_link, send_link]() { + this->get_io_srv_mgr()->disconnect_links(recv_link, send_link); + }); return tx_xport; } |