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. --- .../include/uhdlib/rfnoc/graph_stream_manager.hpp | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp') diff --git a/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp b/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp index 2227a7ad3..8a721ea26 100644 --- a/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp +++ b/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp @@ -8,13 +8,14 @@ #define INCLUDED_LIBUHD_RFNOC_GRAPH_STREAM_MANAGER_HPP #include +#include #include +#include +#include #include #include #include #include -#include -#include #include #include #include @@ -48,11 +49,11 @@ public: /*! \brief Connect the host to the specified destination and create a control stream * * \param dst_addr The physical address of the destination endpoint - * \param via_device The preference for the device to take to get to the destination + * \param adapter The preference for the adapter to use to get to the destination * \return A pair (source, destination) endpoint IDs for the control stream */ - virtual sep_id_pair_t connect_host_to_device( - sep_addr_t dst_addr, device_id_t host_device = NULL_DEVICE_ID) = 0; + virtual sep_id_pair_t connect_host_to_device(sep_addr_t dst_addr, + uhd::transport::adapter_id_t adapter = uhd::transport::NULL_ADAPTER_ID) = 0; /*! \brief Connect two remote endpoints to each other * @@ -69,23 +70,23 @@ public: * \param block_index The index of the block in the device * \param client_clk The clock that is driving the ctrlport slave * \param timebase_clk The clock that is driving the timebase - * \param via_device The preference for the device to take to get to the destination + * \param adapter The preference for the adapter to use to get to the destination * \return An interface to the ctrlport endpoint */ virtual ctrlport_endpoint::sptr get_block_register_iface(sep_addr_t dst_addr, uint16_t block_index, const clock_iface& client_clk, const clock_iface& timebase_clk, - device_id_t via_device = NULL_DEVICE_ID) = 0; + uhd::transport::adapter_id_t adapter = uhd::transport::NULL_ADAPTER_ID) = 0; /*! \brief Get a pointer to the client zero instance for the specified EPID * * \param dst_epid The endpoint ID of the destination - * \param via_device The preference for the device to take to get to the destination + * \param adapter The preference for the adapter to use to get to the destination * \return An interface to the client zero instance */ - virtual detail::client_zero::sptr get_client_zero( - sep_addr_t dst_addr, device_id_t via_device = NULL_DEVICE_ID) const = 0; + virtual detail::client_zero::sptr get_client_zero(sep_addr_t dst_addr, + uhd::transport::adapter_id_t adapter = uhd::transport::NULL_ADAPTER_ID) const = 0; /*! Configure a flow controlled data stream from the endpoint with ID src_epid to the @@ -111,7 +112,7 @@ public: * \param dst_addr The address of the destination stream endpoint * \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 via_device The preference for the device to take to get to the destination + * \param adapter The preference for the adapter to use to get to the destination * \param xport_args The transport arguments * \return An transport instance */ @@ -119,7 +120,7 @@ public: sep_addr_t dst_addr, const sw_buff_t pyld_buff_fmt, const sw_buff_t mdata_buff_fmt, - const device_id_t via_device, + const uhd::transport::adapter_id_t adapter, const device_addr_t& xport_args) = 0; /*! \brief Create a data stream going from the host to the device @@ -127,7 +128,7 @@ public: * \param dst_addr The address of the destination stream endpoint * \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 via_device The preference for the device to take to get to the destination + * \param adapter The preference for the adapter to use to get to the destination * \param xport_args The transport arguments * \return An transport instance */ @@ -135,15 +136,16 @@ public: sep_addr_t dst_addr, const sw_buff_t pyld_buff_fmt, const sw_buff_t mdata_buff_fmt, - const device_id_t via_device, + const uhd::transport::adapter_id_t adapter, const device_addr_t& xport_args) = 0; - /*! \brief Get all the via_devices that can reach the specified endpoint + /*! \brief Get all the adapters that can reach the specified endpoint * * \param addr The address of the stream endpoint - * \return A vector of all the via_devices + * \return A vector of adapter IDs */ - virtual std::vector get_via_devices(sep_addr_t addr) const = 0; + virtual std::vector get_adapters( + sep_addr_t addr) const = 0; /*! * \brief Create a graph_stream_manager and return a unique_ptr to it -- cgit v1.2.3