diff options
author | Andrew Lynch <andrew.lynch@ni.com> | 2020-06-10 17:15:46 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-06-26 14:34:13 -0500 |
commit | 5c1771cc68edca442d870611ef8d9662b5d00d8b (patch) | |
tree | 33c4c2dbf82259a4bc6ce4bd11f40e2384260d32 /host/lib/usrp | |
parent | 9318323b769200ee328456b0ef92ea19c1b96b6e (diff) | |
download | uhd-5c1771cc68edca442d870611ef8d9662b5d00d8b.tar.gz uhd-5c1771cc68edca442d870611ef8d9662b5d00d8b.tar.bz2 uhd-5c1771cc68edca442d870611ef8d9662b5d00d8b.zip |
CHDR: support multiple CHDR widths
Support management payloads on busses over 64 bits
Automatically set CHDR width for mpmd_link_if_ctrl_udp
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp | 7 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp | 13 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_link_if_mgr.hpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_mb_iface.cpp | 2 |
5 files changed, 20 insertions, 14 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp index b4a0dfd32..bdf088025 100644 --- a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp +++ b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp @@ -26,9 +26,6 @@ using namespace uhd; using namespace uhd::transport; using namespace uhd::mpmd::xport; -const uhd::rfnoc::chdr::chdr_packet_factory mpmd_link_if_ctrl_udp::_pkt_factory( - uhd::rfnoc::CHDR_W_64, ENDIANNESS_LITTLE); - namespace { //! Maximum CHDR packet size in bytes @@ -214,10 +211,12 @@ size_t discover_mtu(const std::string& address, * Structors *****************************************************************************/ mpmd_link_if_ctrl_udp::mpmd_link_if_ctrl_udp(const uhd::device_addr_t& mb_args, - const mpmd_link_if_mgr::xport_info_list_t& xport_info) + const mpmd_link_if_mgr::xport_info_list_t& xport_info, + const uhd::rfnoc::chdr_w_t chdr_w) : _mb_args(mb_args) , _udp_info(get_udp_info_from_xport_info(xport_info)) , _mtu(MPMD_10GE_DATA_FRAME_MAX_SIZE) + , _pkt_factory(chdr_w, ENDIANNESS_LITTLE) { const bool use_dpdk = mb_args.has_key("use_dpdk"); // FIXME use constrained_device_args diff --git a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp index c80f1e613..ebe4f5db2 100644 --- a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp +++ b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp @@ -10,6 +10,7 @@ #include "mpmd_link_if_ctrl_base.hpp" #include "mpmd_link_if_mgr.hpp" #include <uhd/types/device_addr.hpp> +#include <uhdlib/rfnoc/rfnoc_common.hpp> #include <unordered_map> namespace uhd { namespace mpmd { namespace xport { @@ -30,7 +31,8 @@ public: using udp_link_info_map = std::unordered_map<std::string, udp_link_info_t>; mpmd_link_if_ctrl_udp(const uhd::device_addr_t& mb_args, - const mpmd_link_if_mgr::xport_info_list_t& xport_info); + const mpmd_link_if_mgr::xport_info_list_t& xport_info, + const uhd::rfnoc::chdr_w_t chdr_w); size_t get_num_links() const; uhd::transport::both_links_t get_link(const size_t link_idx, @@ -51,7 +53,7 @@ private: std::vector<std::string> _available_addrs; //! MTU size_t _mtu; - static const uhd::rfnoc::chdr::chdr_packet_factory _pkt_factory; + const uhd::rfnoc::chdr::chdr_packet_factory _pkt_factory; }; }}} /* namespace uhd::mpmd::xport */ diff --git a/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp b/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp index 4b36e7ba4..930f5e465 100644 --- a/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp +++ b/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp @@ -36,9 +36,11 @@ public: /************************************************************************** * API (see mpmd_link_if_mgr.hpp) *************************************************************************/ - bool connect(const std::string& link_type, const xport_info_list_t& xport_info) + bool connect(const std::string& link_type, + const xport_info_list_t& xport_info, + const uhd::rfnoc::chdr_w_t chdr_w) { - auto link_if_ctrl = make_link_if_ctrl(link_type, xport_info); + auto link_if_ctrl = make_link_if_ctrl(link_type, xport_info, chdr_w); if (!link_if_ctrl) { UHD_LOG_WARNING( "MPMD::XPORT", "Unable to create xport ctrl for link type " << link_type); @@ -89,8 +91,9 @@ private: /************************************************************************** * Private methods / helpers *************************************************************************/ - mpmd_link_if_ctrl_base::uptr make_link_if_ctrl( - const std::string& link_type, const xport_info_list_t& xport_info) + mpmd_link_if_ctrl_base::uptr make_link_if_ctrl(const std::string& link_type, + const xport_info_list_t& xport_info, + const uhd::rfnoc::chdr_w_t chdr_w) { // Here, we hard-code the list of available transport types if (link_type == "udp") { @@ -100,7 +103,7 @@ private: // xport_info); //} #endif - return std::make_unique<mpmd_link_if_ctrl_udp>(_mb_args, xport_info); + return std::make_unique<mpmd_link_if_ctrl_udp>(_mb_args, xport_info, chdr_w); #ifdef HAVE_LIBERIO } else if (link_type == "liberio") { return std::make_unique<mpmd_link_if_ctrl_liberio>(_mb_args, xport_info); diff --git a/host/lib/usrp/mpmd/mpmd_link_if_mgr.hpp b/host/lib/usrp/mpmd/mpmd_link_if_mgr.hpp index a1d11bad7..b8e7454cb 100644 --- a/host/lib/usrp/mpmd/mpmd_link_if_mgr.hpp +++ b/host/lib/usrp/mpmd/mpmd_link_if_mgr.hpp @@ -11,6 +11,7 @@ #include <uhd/types/dict.hpp> #include <uhd/types/direction.hpp> #include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/rfnoc_common.hpp> #include <uhdlib/transport/links.hpp> #include <map> #include <memory> @@ -80,8 +81,9 @@ public: * contain the available IP addresses. * \returns true on success */ - virtual bool connect( - const std::string& xport_type, const xport_info_list_t& xport_info) = 0; + virtual bool connect(const std::string& xport_type, + const xport_info_list_t& xport_info, + const uhd::rfnoc::chdr_w_t chdr_w) = 0; /*! The number of available links * diff --git a/host/lib/usrp/mpmd/mpmd_mb_iface.cpp b/host/lib/usrp/mpmd/mpmd_mb_iface.cpp index 41b664374..d4f6cc383 100644 --- a/host/lib/usrp/mpmd/mpmd_mb_iface.cpp +++ b/host/lib/usrp/mpmd/mpmd_mb_iface.cpp @@ -62,7 +62,7 @@ void mpmd_mboard_impl::mpmd_mb_iface::init() "get_chdr_link_options", type); // User may have specified: addr=192.168.10.2, second_addr= // MPM may have said: "my addresses are 192.168.10.2 and 192.168.20.2" - if (_link_if_mgr->connect(type, xport_info)) { + if (_link_if_mgr->connect(type, xport_info, get_chdr_w())) { UHD_LOG_TRACE("MPMD::MB_IFACE", "Link type " << type << " successful."); } } |