diff options
| author | Alex Williams <alex.williams@ni.com> | 2019-08-08 15:41:30 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:36 -0800 | 
| commit | 117af6f0b0d50e6ba81bbd8f970d8963f615548a (patch) | |
| tree | 61e5b5f037afc406e7208267cf8773bb6e057d94 /host/lib/include/uhdlib | |
| parent | bffef674fbbcd892967017e81515bb76e0b850b5 (diff) | |
| download | uhd-117af6f0b0d50e6ba81bbd8f970d8963f615548a.tar.gz uhd-117af6f0b0d50e6ba81bbd8f970d8963f615548a.tar.bz2 uhd-117af6f0b0d50e6ba81bbd8f970d8963f615548a.zip  | |
rfnoc: Add ability to select transport for streamers to user APIs
Now the user can choose which transport is used in connect() calls.
Diffstat (limited to 'host/lib/include/uhdlib')
| -rw-r--r-- | host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp | 11 | ||||
| -rw-r--r-- | host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp | 5 | ||||
| -rw-r--r-- | host/lib/include/uhdlib/transport/rx_streamer_impl.hpp | 1 | 
3 files changed, 13 insertions, 4 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp b/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp index 28fa8ec7c..2227a7ad3 100644 --- a/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp +++ b/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp @@ -111,6 +111,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 xport_args The transport arguments       * \return An transport instance       */ @@ -118,6 +119,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 device_addr_t& xport_args) = 0;      /*! \brief Create a data stream going from the host to the device @@ -125,6 +127,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 xport_args The transport arguments       * \return An transport instance       */ @@ -132,8 +135,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 device_addr_t& xport_args) = 0; +    /*! \brief Get all the via_devices that can reach the specified endpoint +     * +     * \param addr The address of the stream endpoint +     * \return A vector of all the via_devices +     */ +    virtual std::vector<device_id_t> get_via_devices(sep_addr_t addr) const = 0; +      /*!       * \brief Create a graph_stream_manager and return a unique_ptr to it       * diff --git a/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp b/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp index bc56fd311..4785949e7 100644 --- a/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp +++ b/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp @@ -7,6 +7,7 @@  #ifndef INCLUDED_RFNOC_RFNOC_COMMON_HPP  #define INCLUDED_RFNOC_RFNOC_COMMON_HPP +#include <uhd/rfnoc/defaults.hpp>  #include <uhdlib/transport/link_if.hpp>  #include <memory> @@ -35,8 +36,6 @@ constexpr size_t chdr_w_to_bits(chdr_w_t chdr_w)      }  } -//! Device ID Type -using device_id_t = uint16_t;  //! Stream Endpoint Instance Number Type  using sep_inst_t = uint16_t;  //! Stream Endpoint Physical Address Type @@ -50,8 +49,6 @@ using sep_id_pair_t = std::pair<sep_id_t, sep_id_t>;  //! Stream Endpoint Virtual Channel Type  using sep_vc_t = uint8_t; -//! NULL/unassigned device ID -static constexpr device_id_t NULL_DEVICE_ID = 0;  //! NULL/unassigned device address  static constexpr sep_addr_t NULL_DEVICE_ADDR{NULL_DEVICE_ID, 0};  //! NULL/unassigned stream endpoint ID diff --git a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp index d66e867bc..d3fe97c7f 100644 --- a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp +++ b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp @@ -90,6 +90,7 @@ public:      }      //! Connect a new channel to the streamer +    // FIXME: Needs some way to handle virtual channels, since xport could be shared among them      void connect_channel(const size_t channel, typename transport_t::uptr xport)      {          const size_t max_pyld_size = xport->get_max_payload_size();  | 
