aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2019-05-31 14:55:59 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:21 -0800
commitde9cbe9c7c0a6e9296c561423d3b568bc1513133 (patch)
tree4ad7f19e6a33d409afe163aef3b4844442b094a8 /host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp
parentfff4fd59b7b7995904ecb2b010f05f78e9d0a0de (diff)
downloaduhd-de9cbe9c7c0a6e9296c561423d3b568bc1513133.tar.gz
uhd-de9cbe9c7c0a6e9296c561423d3b568bc1513133.tar.bz2
uhd-de9cbe9c7c0a6e9296c561423d3b568bc1513133.zip
rfnoc: Graph and link stream manager API cleanup
Diffstat (limited to 'host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp')
-rw-r--r--host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp89
1 files changed, 80 insertions, 9 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp b/host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp
index c31bf8987..4ff69bb3e 100644
--- a/host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp
+++ b/host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp
@@ -13,12 +13,19 @@
#include <uhdlib/rfnoc/mb_iface.hpp>
#include <functional>
#include <memory>
+#include <set>
namespace uhd { namespace rfnoc {
/*! A class that is responsible managing all data endpoints, control endpoints and client
- * zero instances accessible via a physical link. There must be one instance this this
- * class per physical link (Ethernet cable, PCIe connection, etc)
+ * zero instances accessible via a logical link between the host device and
+ * motherboard.
+ *
+ * Note that each transport adapter on the host has its own set of streaming endpoints,
+ * and thus, the host's device_id_t uniquely identifies the host-side transport adapter
+ * to use for packet transmission/reception.
+ *
+ * There must be one instance of this class per logical link.
*/
class link_stream_manager
{
@@ -39,12 +46,30 @@ public:
*/
virtual const std::set<sep_addr_t>& get_reachable_endpoints() const = 0;
- /*! \brief Initialize a control endpoint to the specified destination
+ /*! \brief Connect the host to the specified destination and init a control endpoint
*
* \param dst_addr The physical address of the destination endpoint
* \return A pair (source, destination) endpoint IDs for the control stream
*/
- virtual sep_id_pair_t init_ctrl_stream(sep_addr_t dst_addr) = 0;
+ virtual sep_id_pair_t connect_host_to_device(sep_addr_t dst_addr) = 0;
+
+ /*! \brief Check if the two specified endpoints can be connected remotely
+ *
+ * \param dst_addr The physical address of the destination endpoint
+ * \param src_addr The physical address of the source endpoint
+ * \return true if the endpoints can be connected
+ */
+ virtual bool can_connect_device_to_device(
+ sep_addr_t dst_addr, sep_addr_t src_addr) const = 0;
+
+ /*! \brief Connect two remote endpoints to each other
+ *
+ * \param dst_addr The physical address of the destination endpoint
+ * \param src_addr The physical address of the source endpoint
+ * \return A pair (source, destination) endpoint IDs for the src/dst
+ */
+ virtual sep_id_pair_t connect_device_to_device(
+ sep_addr_t dst_addr, sep_addr_t src_addr) = 0;
/*! \brief Get a register iface (ctrlport endpoint) to a particular block
*
@@ -66,15 +91,61 @@ public:
*/
virtual detail::client_zero::sptr get_client_zero(sep_id_t dst_epid) const = 0;
- /*! \brief Create a data stream
+ /*! Configure a flow controlled data stream from the endpoint with ID src_epid to the
+ * endpoint with ID dst_epid
*
* \param dst_epid The endpoint ID of the destination
- * \param vc The virtual channel
- * \param xport_args The transport argument
+ * \param src_epid The endpoint ID of the source
+ * \param lossy_xport Is the transport lossy?
+ * \param fc_freq_ratio Flow control response frequency as a ratio of the buff params
+ * \param fc_headroom_ratio Flow control headroom as a ratio of the buff params
+ * \param reset Optionally reset the stream
+ */
+ virtual stream_buff_params_t create_device_to_device_data_stream(
+ const sep_id_t& dst_epid,
+ const sep_id_t& src_epid,
+ const bool lossy_xport,
+ const double fc_freq_ratio,
+ const double fc_headroom_ratio,
+ const bool reset = false) = 0;
+
+ /*! \brief Create a data stream going from the host to the device
+ *
+ * \param dst_addr The address of the destination stream endpoint
+ * \param lossy_xport Is the transport lossy?
+ * \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 fc_freq_ratio Flow control response frequency as a ratio of the buff params
+ * \param fc_headroom_ratio Flow control headroom as a ratio of the buff params
+ * \param xport_args The transport arguments
+ * \return An transport instance
+ */
+ virtual chdr_data_xport_t create_host_to_device_data_stream(const sep_addr_t dst_addr,
+ const bool lossy_xport,
+ const sw_buff_t pyld_buff_fmt,
+ const sw_buff_t mdata_buff_fmt,
+ const double fc_freq_ratio,
+ const double fc_headroom_ratio,
+ const device_addr_t& xport_args) = 0;
+
+ /*! \brief Create a data stream going from the device to the host
+ *
+ * \param dst_addr The address of the destination stream endpoint
+ * \param lossy_xport Is the transport lossy?
+ * \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 fc_freq_ratio Flow control response frequency as a ratio of the buff params
+ * \param fc_headroom_ratio Flow control headroom as a ratio of the buff params
+ * \param xport_args The transport arguments
* \return An transport instance
*/
- virtual chdr_data_xport_t create_data_stream(
- sep_addr_t dst_addr, sep_vc_t vc, const device_addr_t& xport_args) = 0;
+ virtual chdr_data_xport_t create_device_to_host_data_stream(const sep_addr_t src_addr,
+ const bool lossy_xport,
+ const sw_buff_t pyld_buff_fmt,
+ const sw_buff_t mdata_buff_fmt,
+ const double fc_freq_ratio,
+ const double fc_headroom_ratio,
+ const device_addr_t& xport_args) = 0;
static uptr make(const chdr::chdr_packet_factory& pkt_factory,
mb_iface& mb_if,