diff options
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/chdr_ctrl_xport.cpp | 8 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_rx_data_xport.cpp | 13 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_tx_data_xport.cpp | 17 |
3 files changed, 26 insertions, 12 deletions
diff --git a/host/lib/rfnoc/chdr_ctrl_xport.cpp b/host/lib/rfnoc/chdr_ctrl_xport.cpp index 8946a3b08..f8b3cf03e 100644 --- a/host/lib/rfnoc/chdr_ctrl_xport.cpp +++ b/host/lib/rfnoc/chdr_ctrl_xport.cpp @@ -19,8 +19,9 @@ chdr_ctrl_xport::chdr_ctrl_xport(io_service::sptr io_srv, const chdr::chdr_packet_factory& pkt_factory, sep_id_t my_epid, size_t num_send_frames, - size_t num_recv_frames) - : _my_epid(my_epid), _recv_packet(pkt_factory.make_generic()) + size_t num_recv_frames, + disconnect_callback_t disconnect) + : _my_epid(my_epid), _recv_packet(pkt_factory.make_generic()), _disconnect(disconnect) { /* Make dumb send pipe */ send_io_if::send_callback_t send_cb = [this]( @@ -99,6 +100,9 @@ chdr_ctrl_xport::~chdr_ctrl_xport() _send_if.reset(); _ctrl_recv_if.reset(); _mgmt_recv_if.reset(); + + // Disconnect the transport + _disconnect(); } /*! diff --git a/host/lib/rfnoc/chdr_rx_data_xport.cpp b/host/lib/rfnoc/chdr_rx_data_xport.cpp index d4476d54f..74b310fa1 100644 --- a/host/lib/rfnoc/chdr_rx_data_xport.cpp +++ b/host/lib/rfnoc/chdr_rx_data_xport.cpp @@ -36,11 +36,13 @@ chdr_rx_data_xport::chdr_rx_data_xport(uhd::transport::io_service::sptr io_srv, const chdr::chdr_packet_factory& pkt_factory, const uhd::rfnoc::sep_id_pair_t& epids, const size_t num_recv_frames, - const fc_params_t& fc_params) + const fc_params_t& fc_params, + disconnect_callback_t disconnect) : _fc_state(epids, fc_params.freq) , _fc_sender(pkt_factory, epids) , _epid(epids.second) , _chdr_w_bytes(chdr_w_to_bits(pkt_factory.get_chdr_w()) / 8) + , _disconnect(disconnect) { UHD_LOG_TRACE("XPORT::RX_DATA_XPORT", "Creating rx xport with local epid=" << epids.second @@ -87,6 +89,9 @@ chdr_rx_data_xport::~chdr_rx_data_xport() { // Release recv_io before allowing members needed by callbacks be destroyed _recv_io.reset(); + + // Disconnect the links + _disconnect(); } chdr_rx_data_xport::fc_params_t chdr_rx_data_xport::configure_sep(io_service::sptr io_srv, @@ -100,7 +105,8 @@ chdr_rx_data_xport::fc_params_t chdr_rx_data_xport::configure_sep(io_service::sp const stream_buff_params_t& recv_capacity, const stream_buff_params_t& fc_freq, const stream_buff_params_t& fc_headroom, - const bool lossy_xport) + const bool lossy_xport, + disconnect_callback_t disconnect) { const sep_id_t remote_epid = epids.first; const sep_id_t local_epid = epids.second; @@ -166,7 +172,8 @@ chdr_rx_data_xport::fc_params_t chdr_rx_data_xport::configure_sep(io_service::sp pkt_factory, local_epid, 1, // num_send_frames - 1); // num_recv_frames + 1, // num_recv_frames + disconnect); // Setup a route to the EPID // Note that this may be gratuitous--The endpoint may already have been set up diff --git a/host/lib/rfnoc/chdr_tx_data_xport.cpp b/host/lib/rfnoc/chdr_tx_data_xport.cpp index 530da5a47..7e926a163 100644 --- a/host/lib/rfnoc/chdr_tx_data_xport.cpp +++ b/host/lib/rfnoc/chdr_tx_data_xport.cpp @@ -31,12 +31,14 @@ chdr_tx_data_xport::chdr_tx_data_xport(uhd::transport::io_service::sptr io_srv, const chdr::chdr_packet_factory& pkt_factory, const uhd::rfnoc::sep_id_pair_t& epids, const size_t num_send_frames, - const fc_params_t fc_params) + const fc_params_t fc_params, + disconnect_callback_t disconnect) : _fc_state(fc_params.buff_capacity) , _fc_sender(pkt_factory, epids) , _epid(epids.first) , _chdr_w_bytes(chdr_w_to_bits(pkt_factory.get_chdr_w()) / 8) , _frame_size(send_link->get_send_frame_size()) + , _disconnect(disconnect) { UHD_LOG_TRACE("XPORT::TX_DATA_XPORT", "Creating tx xport with local epid=" << epids.first @@ -78,6 +80,9 @@ chdr_tx_data_xport::~chdr_tx_data_xport() { // Release send_io before allowing members needed by callbacks be destroyed _send_io.reset(); + + // Disconnect the transport + _disconnect(); } /* @@ -225,7 +230,8 @@ chdr_tx_data_xport::fc_params_t chdr_tx_data_xport::configure_sep(io_service::sp const sw_buff_t pyld_buff_fmt, const sw_buff_t mdata_buff_fmt, const double fc_freq_ratio, - const double fc_headroom_ratio) + const double fc_headroom_ratio, + disconnect_callback_t disconnect) { const sep_id_t remote_epid = epids.second; const sep_id_t local_epid = epids.first; @@ -238,7 +244,8 @@ chdr_tx_data_xport::fc_params_t chdr_tx_data_xport::configure_sep(io_service::sp pkt_factory, local_epid, 1, // num_send_frames - 1); // num_recv_frames + 1, // num_recv_frames + disconnect); // Setup a route to the EPID mgmt_portal.setup_local_route(*ctrl_xport, remote_epid); @@ -246,10 +253,6 @@ chdr_tx_data_xport::fc_params_t chdr_tx_data_xport::configure_sep(io_service::sp mgmt_portal.config_local_tx_stream( *ctrl_xport, remote_epid, pyld_buff_fmt, mdata_buff_fmt); - // We no longer need the control xport, release it so - // the control xport is no longer connected to the I/O service. - ctrl_xport.reset(); - return configure_flow_ctrl(io_srv, recv_link, send_link, |