diff options
author | Alex Williams <alex.williams@ni.com> | 2019-08-13 09:13:46 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:40 -0800 |
commit | a4274c19ebb42db112aa68a26fa499a52b9dd103 (patch) | |
tree | 5c29db76e72b00f5fc6247fce0752fae2abd2ddc /host/include | |
parent | 81bd7896940dcd39181d0aee331e08abe4df1655 (diff) | |
download | uhd-a4274c19ebb42db112aa68a26fa499a52b9dd103.tar.gz uhd-a4274c19ebb42db112aa68a26fa499a52b9dd103.tar.bz2 uhd-a4274c19ebb42db112aa68a26fa499a52b9dd103.zip |
rfnoc: Use adapter_id_t for balancing load across links
Since the mb_iface allocates local device IDs, also have it track
the associated adapter IDs and provide a facility to retrieve them.
Incorporate the adapter IDs in the user API to select the adapter
for streamers.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/rfnoc/defaults.hpp | 6 | ||||
-rw-r--r-- | host/include/uhd/rfnoc_graph.hpp | 37 |
2 files changed, 19 insertions, 24 deletions
diff --git a/host/include/uhd/rfnoc/defaults.hpp b/host/include/uhd/rfnoc/defaults.hpp index 6af67144a..9a3ce252f 100644 --- a/host/include/uhd/rfnoc/defaults.hpp +++ b/host/include/uhd/rfnoc/defaults.hpp @@ -49,11 +49,6 @@ static const int DEFAULT_SPP = 1996; using noc_id_t = uint32_t; /*** Device Identifiers ******************************************************/ -//! Device ID -using device_id_t = uint16_t; -//! NULL/unassigned device ID -static const device_id_t NULL_DEVICE_ID = 0; - //! Device Type using device_type_t = uint16_t; // first nibble for device family (E = E, N = 1, X = A), remaining three nibbles @@ -81,4 +76,3 @@ static const noc_id_t DDC_BLOCK = 0xDDC00000; }} // namespace uhd::rfnoc #endif /* INCLUDED_LIBUHD_RFNOC_DEFAULTS_HPP */ - diff --git a/host/include/uhd/rfnoc_graph.hpp b/host/include/uhd/rfnoc_graph.hpp index 556a298dc..8a56d1c80 100644 --- a/host/include/uhd/rfnoc_graph.hpp +++ b/host/include/uhd/rfnoc_graph.hpp @@ -12,6 +12,7 @@ #include <uhd/rfnoc/graph_edge.hpp> #include <uhd/rfnoc/noc_block_base.hpp> #include <uhd/stream.hpp> +#include <uhd/transport/adapter_id.hpp> #include <uhd/types/device_addr.hpp> #include <uhd/utils/noncopyable.hpp> #include <boost/units/detail/utility.hpp> // for demangle @@ -196,7 +197,7 @@ public: * \param strm_port The port of the streamer to connect. * \param dst_blk The block ID of the destination block to connect to. * \param dst_port The port of the destination block to connect to. - * \param via_device The local device ID (transport) to use for this connection. + * \param adapter_id The local device ID (transport) to use for this connection. * * \throws connect_disallowed_on_dst * if the destination port is statically connected to a *different* block @@ -205,7 +206,7 @@ public: size_t strm_port, const block_id_t& dst_blk, size_t dst_port, - device_id_t via_device = NULL_DEVICE_ID) = 0; + uhd::transport::adapter_id_t adapter_id = uhd::transport::NULL_ADAPTER_ID) = 0; /*! Connect RX streamer to an output of an NoC block * @@ -213,7 +214,7 @@ public: * \param src_port The port of the source block to connect. * \param streamer The streamer to connect. * \param strm_port The port of the streamer to connect. - * \param via_device The local device ID (transport) to use for this connection. + * \param adapter_id The local device ID (transport) to use for this connection. * * \throws connect_disallowed_on_src * if the source port is statically connected to a *different* block @@ -222,31 +223,31 @@ public: size_t src_port, uhd::rx_streamer::sptr streamer, size_t strm_port, - device_id_t via_device = NULL_DEVICE_ID) = 0; + uhd::transport::adapter_id_t adapter_id = uhd::transport::NULL_ADAPTER_ID) = 0; - /*! Enumerate all the possible via devices that can be used to receive - * from the specified block + /*! Enumerate all the possible host transport adapters that can be used to + * receive from the specified block * - * If addr and second_addr were specified in device_args, the device_id_t + * If addr and second_addr were specified in device_args, the adapter_id_t * associated with addr will come first in the vector, then second_addr. * * \param src_blk The block ID of the source block to connect to. * \param src_port The port of the source block to connect to. */ - virtual std::vector<device_id_t> enumerate_dst_via_devices(const block_id_t& src_blk, - size_t src_port) = 0; + virtual std::vector<uhd::transport::adapter_id_t> enumerate_adapters_from_src( + const block_id_t& src_blk, size_t src_port) = 0; - /*! Enumerate all the possible via devices that can be used to send to the - * specified block + /*! Enumerate all the possible host transport adapters that can be used to + * send to the specified block * - * If addr and second_addr were specified in device_args, the device_id_t + * If addr and second_addr were specified in device_args, the adapter_id_t * associated with addr will come first in the vector, then second_addr. * * \param dst_blk The block ID of the destination block to connect to. * \param dst_port The port of the destination block to connect to. */ - virtual std::vector<device_id_t> enumerate_src_via_devices(const block_id_t& dst_blk, - size_t dst_port) = 0; + virtual std::vector<uhd::transport::adapter_id_t> enumerate_adapters_to_dst( + const block_id_t& dst_blk, size_t dst_port) = 0; /*! Enumerate all the possible static connections in the graph * @@ -290,8 +291,8 @@ public: * \param args Arguments to aid the construction of the streamer * \return a shared pointer to a new streamer */ - virtual rx_streamer::sptr create_rx_streamer(const size_t num_ports, - const stream_args_t& args) = 0; + virtual rx_streamer::sptr create_rx_streamer( + const size_t num_ports, const stream_args_t& args) = 0; /*! Create a new transmit streamer from the streamer arguments * The created streamer is still not connected to anything yet. @@ -303,8 +304,8 @@ public: * \param args Arguments to aid the construction of the streamer * \return a shared pointer to a new streamer */ - virtual tx_streamer::sptr create_tx_streamer(const size_t num_ports, - const stream_args_t& args) = 0; + virtual tx_streamer::sptr create_tx_streamer( + const size_t num_ports, const stream_args_t& args) = 0; /************************************************************************** * Hardware Control |