diff options
author | Ciro Nishiguchi <ciro.nishiguchi@ni.com> | 2019-10-23 21:58:49 -0500 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:21:32 -0800 |
commit | b4ef7ca804be35830a2c8ac5a143afafd33362f6 (patch) | |
tree | 33d20bb8ba238aa7e6f18d7d0b59d67c3c797c2e /host/lib/usrp/common | |
parent | 03dcda01e0af9dbebee17eec31adcea502fefdb8 (diff) | |
download | uhd-b4ef7ca804be35830a2c8ac5a143afafd33362f6.tar.gz uhd-b4ef7ca804be35830a2c8ac5a143afafd33362f6.tar.bz2 uhd-b4ef7ca804be35830a2c8ac5a143afafd33362f6.zip |
rfnoc: Restrict to inline I/O service based on link restrictions
For links that do not support releasing buffers out of order, restrict
the I/O service manager to always select the inline I/O service.
Diffstat (limited to 'host/lib/usrp/common')
-rw-r--r-- | host/lib/usrp/common/io_service_mgr.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/host/lib/usrp/common/io_service_mgr.cpp b/host/lib/usrp/common/io_service_mgr.cpp index c00f36a25..437d77423 100644 --- a/host/lib/usrp/common/io_service_mgr.cpp +++ b/host/lib/usrp/common/io_service_mgr.cpp @@ -435,6 +435,9 @@ private: }; using link_pair_t = std::pair<recv_link_if::sptr, send_link_if::sptr>; + bool _out_of_order_supported( + recv_link_if::sptr recv_link, send_link_if::sptr send_link) const; + const uhd::device_addr_t _args; inline_io_service_mgr _inline_io_srv_mgr; @@ -453,12 +456,19 @@ io_service_mgr::sptr io_service_mgr::make(const uhd::device_addr_t& args) io_service::sptr io_service_mgr_impl::connect_links(recv_link_if::sptr recv_link, send_link_if::sptr send_link, const link_type_t link_type, - const io_service_args_t& default_args, + const io_service_args_t& default_args_, const uhd::device_addr_t& stream_args, const std::string& streamer_id) { UHD_ASSERT_THROW(link_type != link_type_t::ASYNC_MSG); + io_service_args_t default_args = default_args_; + + if (!_out_of_order_supported(recv_link, send_link)) { + default_args.recv_offload = false; + default_args.send_offload = false; + } + const io_service_args_t args = read_io_service_args( merge_io_service_dev_args(_args, stream_args), default_args); @@ -498,6 +508,15 @@ io_service::sptr io_service_mgr_impl::connect_links(recv_link_if::sptr recv_link } } + // If the link doesn't support buffers out of order, then we can only use + // the inline I/O service. Warn if a different one was requested. + if (!_out_of_order_supported(recv_link, send_link)) { + if (io_srv_type != INLINE_IO_SRV) { + UHD_LOG_WARNING(LOG_ID, "Link type does not support send/recv offload, ignoring"); + } + io_srv_type = INLINE_IO_SRV; + } + switch (io_srv_type) { case INLINE_IO_SRV: io_srv = _inline_io_srv_mgr.connect_links(recv_link, send_link); @@ -541,4 +560,17 @@ void io_service_mgr_impl::disconnect_links( _link_info_map.erase(it); } +bool io_service_mgr_impl::_out_of_order_supported( + recv_link_if::sptr recv_link, send_link_if::sptr send_link) const +{ + bool supported = true; + if (recv_link) { + supported = recv_link->supports_recv_buff_out_of_order(); + } + if (send_link) { + supported = supported && send_link->supports_send_buff_out_of_order(); + } + return supported; +} + }} // namespace uhd::usrp |