aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/rfnoc/mb_iface.hpp
diff options
context:
space:
mode:
authorAaron Rossetto <aaron.rossetto@ni.com>2019-10-17 08:44:11 -0500
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:32 -0800
commit0bd233e64210c6605e8a6ec1424fa81f9ea8a681 (patch)
treef97729a7bba21cdfc45ee756bee1ac0489358544 /host/lib/include/uhdlib/rfnoc/mb_iface.hpp
parent912ed28b3df13b9f9c33f2fa92867ec0ac7445fd (diff)
downloaduhd-0bd233e64210c6605e8a6ec1424fa81f9ea8a681.tar.gz
uhd-0bd233e64210c6605e8a6ec1424fa81f9ea8a681.tar.bz2
uhd-0bd233e64210c6605e8a6ec1424fa81f9ea8a681.zip
uhd: Introduce I/O service manager
- Implement I/O service detach link methods - The I/O service manager instantiates new I/O services or connects links to existing I/O services based on options provided by the user in stream_args. - Add a streamer ID parameter to methods to create transports so that the I/O service manager can group transports appropriately when using offload threads. - Change X300 and MPMD to use I/O service manager to connect links to I/O services. - There is now a single I/O service manager per rfnoc_graph (and it is also stored in the graph) - The I/O service manager now also knows the device args for the rfnoc_graph it was created with, and can make decisions based upon those (e.g, use a specific I/O service for DPDK, share cores between streamers, etc.) - The I/O Service Manager does not get any decision logic with this commit, though - The MB ifaces for mpmd and x300 now access this global I/O service manager - Add configuration of link parameters with overrides Co-Authored-By: Martin Braun <martin.braun@ettus.com> Co-Authored-By: Aaron Rossetto <aaron.rossetto@ni.com>
Diffstat (limited to 'host/lib/include/uhdlib/rfnoc/mb_iface.hpp')
-rw-r--r--host/lib/include/uhdlib/rfnoc/mb_iface.hpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/mb_iface.hpp b/host/lib/include/uhdlib/rfnoc/mb_iface.hpp
index abfc9d1c4..53f0897f9 100644
--- a/host/lib/include/uhdlib/rfnoc/mb_iface.hpp
+++ b/host/lib/include/uhdlib/rfnoc/mb_iface.hpp
@@ -7,6 +7,7 @@
#ifndef INCLUDED_LIBUHD_MB_IFACE_HPP
#define INCLUDED_LIBUHD_MB_IFACE_HPP
+#include <uhd/exception.hpp>
#include <uhd/transport/adapter_id.hpp>
#include <uhd/types/endianness.hpp>
#include <uhdlib/rfnoc/chdr_ctrl_xport.hpp>
@@ -14,6 +15,7 @@
#include <uhdlib/rfnoc/chdr_tx_data_xport.hpp>
#include <uhdlib/rfnoc/clock_iface.hpp>
#include <uhdlib/rfnoc/rfnoc_common.hpp>
+#include <uhdlib/usrp/common/io_service_mgr.hpp>
#include <memory>
namespace uhd { namespace rfnoc {
@@ -86,6 +88,27 @@ public:
virtual std::shared_ptr<clock_iface> get_clock_iface(
const std::string& clock_name) = 0;
+ /*! Set the IO service manager
+ *
+ */
+ void set_io_srv_mgr(uhd::usrp::io_service_mgr::sptr io_srv_mgr)
+ {
+ _io_srv_mgr = io_srv_mgr;
+ }
+
+ /*! Get the I/O Service Manager
+ *
+ * This function must be called by the implementations of the various
+ * make_*_transport() calls to get access to the global I/O Service Manager
+ */
+ uhd::usrp::io_service_mgr::sptr get_io_srv_mgr()
+ {
+ if (!_io_srv_mgr) {
+ throw uhd::runtime_error("I/O Service Manager not set for mb_iface!");
+ }
+ return _io_srv_mgr;
+ }
+
/*! Create a control transport
*
* This is usually called once per motherboard, since there is only one
@@ -108,6 +131,7 @@ public:
* \param pyld_buff_fmt Datatype of SW buffer that holds the data payload
* \param mdata_buff_fmt Datatype of SW buffer that holds the data metadata
* \param xport_args Transport configuration args
+ * \param streamer_id A unique identifier for the streamer that will own the transport
* \return A CHDR RX data transport
*/
virtual chdr_rx_data_xport::uptr make_rx_data_transport(
@@ -116,7 +140,8 @@ public:
const sep_id_pair_t& epids,
const sw_buff_t pyld_buff_fmt,
const sw_buff_t mdata_buff_fmt,
- const device_addr_t& xport_args) = 0;
+ const device_addr_t& xport_args,
+ const std::string& streamer_id) = 0;
/*! Create an TX data transport
*
@@ -127,6 +152,7 @@ public:
* \param pyld_buff_fmt Datatype of SW buffer that holds the data payload
* \param mdata_buff_fmt Datatype of SW buffer that holds the data metadata
* \param xport_args Transport configuration args
+ * \param streamer_id A unique identifier for the streamer that will own the transport
* \return A CHDR TX data transport
*/
virtual chdr_tx_data_xport::uptr make_tx_data_transport(
@@ -135,7 +161,11 @@ public:
const sep_id_pair_t& epids,
const uhd::rfnoc::sw_buff_t pyld_buff_fmt,
const uhd::rfnoc::sw_buff_t mdata_buff_fmt,
- const device_addr_t& xport_args) = 0;
+ const device_addr_t& xport_args,
+ const std::string& streamer_id) = 0;
+
+private:
+ uhd::usrp::io_service_mgr::sptr _io_srv_mgr;
};
}} /* namespace uhd::rfnoc */