From a4274c19ebb42db112aa68a26fa499a52b9dd103 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 13 Aug 2019 09:13:46 -0700 Subject: 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. --- host/include/uhd/rfnoc/defaults.hpp | 6 ------ host/include/uhd/rfnoc_graph.hpp | 37 +++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 24 deletions(-) (limited to 'host/include') 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 #include #include +#include #include #include #include // 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 enumerate_dst_via_devices(const block_id_t& src_blk, - size_t src_port) = 0; + virtual std::vector 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 enumerate_src_via_devices(const block_id_t& dst_blk, - size_t dst_port) = 0; + virtual std::vector 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 -- cgit v1.2.3