From 46f61951e88d8936814095bf2f8db014b6ff67e6 Mon Sep 17 00:00:00 2001 From: RobertWalstab Date: Tue, 14 Jul 2020 10:51:51 +0200 Subject: mpmd: remove liberio --- host/lib/usrp/mpmd/CMakeLists.txt | 11 -- host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.cpp | 126 ----------------------- host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.hpp | 69 ------------- host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp | 7 -- 4 files changed, 213 deletions(-) delete mode 100644 host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.cpp delete mode 100644 host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.hpp (limited to 'host/lib') diff --git a/host/lib/usrp/mpmd/CMakeLists.txt b/host/lib/usrp/mpmd/CMakeLists.txt index 5a6ce72c1..6604ba5a8 100644 --- a/host/lib/usrp/mpmd/CMakeLists.txt +++ b/host/lib/usrp/mpmd/CMakeLists.txt @@ -18,17 +18,6 @@ if(ENABLE_MPMD) ${CMAKE_CURRENT_SOURCE_DIR}/mpmd_link_if_ctrl_udp.cpp ) - if(ENABLE_LIBERIO) - message(STATUS "Compiling MPMD with liberio support...") - LIBUHD_APPEND_SOURCES( - ${CMAKE_CURRENT_SOURCE_DIR}/mpmd_link_if_ctrl_liberio.cpp - ) - set_property( - SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/mpmd_link_if_mgr.cpp - PROPERTY COMPILE_DEFINITIONS HAVE_LIBERIO - ) - endif(ENABLE_LIBERIO) - if(ENABLE_DPDK) include_directories(${DPDK_INCLUDE_DIRS}) set_property( diff --git a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.cpp b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.cpp deleted file mode 100644 index bf383f44d..000000000 --- a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// -// Copyright 2017 Ettus Research, National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#include "mpmd_link_if_ctrl_liberio.hpp" -#include -#include -#include -#include -#include - -using namespace uhd; -using namespace uhd::transport; -using namespace uhd::mpmd::xport; - -const uhd::rfnoc::chdr::chdr_packet_factory mpmd_link_if_ctrl_liberio::_pkt_factory( - uhd::rfnoc::CHDR_W_64, ENDIANNESS_LITTLE); - -namespace { - -//! The default MTU will be this number times the page size -const size_t LIBERIO_PAGES_PER_BUF = 2; -//! The default MTU -const size_t LIBERIO_DEFAULT_MTU = LIBERIO_PAGES_PER_BUF * getpagesize(); -//! The default link_rate (8 Bytes * 200 MHz) -const double LIBERIO_DEFAULT_LINK_RATE = 200e6 * 8; -//! Number of descriptors that liberio allocates (receive) -const size_t LIBERIO_NUM_RECV_FRAMES = 128; -//! Number of descriptors that liberio allocates (send) -const size_t LIBERIO_NUM_SEND_FRAMES = 128; -//! MTU for largest non-data packet accepted (arbitrarily-determined...) -// Note: Management frames must fit here, and it determines the padded RX size -const size_t LIBERIO_MAX_NONDATA_PACKET_SIZE = 128; - -std::vector -get_liberio_info_from_xport_info( - const mpmd_link_if_mgr::xport_info_list_t& link_info_list) -{ - std::vector result; - for (const auto& link_info : link_info_list) { - if (!link_info.count("tx_dev")) { - UHD_LOG_ERROR("MPMD::XPORT::LIBERIO", - "Invalid response from get_chdr_link_options()! No `tx_dev' key!"); - throw uhd::runtime_error( - "Invalid response from get_chdr_link_options()! No `tx_dev' key!"); - } - if (!link_info.count("rx_dev")) { - UHD_LOG_ERROR("MPMD::XPORT::LIBERIO", - "Invalid response from get_chdr_link_options()! No `rx_dev' key!"); - throw uhd::runtime_error( - "Invalid response from get_chdr_link_options()! No `rx_dev' key!"); - } - const std::string tx_dev = link_info.at("tx_dev"); - const std::string rx_dev = link_info.at("rx_dev"); - result.emplace_back( - mpmd_link_if_ctrl_liberio::liberio_link_info_t{tx_dev, rx_dev}); - } - - return result; -} - -} // namespace - - -/****************************************************************************** - * Structors - *****************************************************************************/ -mpmd_link_if_ctrl_liberio::mpmd_link_if_ctrl_liberio(const uhd::device_addr_t& mb_args, - const mpmd_link_if_mgr::xport_info_list_t& xport_info) - : _mb_args(mb_args) - , _recv_args(filter_args(mb_args, "recv")) - , _send_args(filter_args(mb_args, "send")) - , _dma_channels(get_liberio_info_from_xport_info(xport_info)) - , _link_rate(LIBERIO_DEFAULT_LINK_RATE) // FIXME -{ - // nop -} - -/****************************************************************************** - * API - *****************************************************************************/ -uhd::transport::both_links_t mpmd_link_if_ctrl_liberio::get_link(const size_t link_idx, - const uhd::transport::link_type_t link_type, - const uhd::device_addr_t& link_args) -{ - UHD_ASSERT_THROW(link_idx == 0); - if (_next_channel >= _dma_channels.size()) { - UHD_LOG_ERROR( - "MPMD::XPORT::LIBERIO", "Cannot create liberio link: DMA channels exhausted"); - throw uhd::runtime_error("Cannot create liberio link: DMA channels exhausted"); - } - auto link_info = _dma_channels.at(_next_channel++); - - /* FIXME: Should have common infrastructure for creating I/O services */ - auto io_srv = uhd::transport::inline_io_service::make(); - link_params_t link_params; - if (link_type == link_type_t::RX_DATA) { - link_params.recv_frame_size = get_mtu(uhd::RX_DIRECTION); // FIXME - link_params.send_frame_size = LIBERIO_MAX_NONDATA_PACKET_SIZE; // FIXME - } else if (link_type == link_type_t::TX_DATA) { - link_params.recv_frame_size = LIBERIO_MAX_NONDATA_PACKET_SIZE; // FIXME - link_params.send_frame_size = get_mtu(uhd::TX_DIRECTION); // FIXME - } else { - link_params.recv_frame_size = LIBERIO_MAX_NONDATA_PACKET_SIZE; // FIXME - link_params.send_frame_size = LIBERIO_MAX_NONDATA_PACKET_SIZE; // FIXME - } - link_params.num_recv_frames = LIBERIO_NUM_RECV_FRAMES; // FIXME - link_params.num_send_frames = LIBERIO_NUM_SEND_FRAMES; // FIXME - - // Liberio doesn't need in-band flow control, so pretend have very large buffers - link_params.recv_buff_size = std::numeric_limits::max(); - link_params.send_buff_size = std::numeric_limits::max(); - auto link = uhd::transport::liberio_link::make( - link_info.first, link_info.second, link_params); - io_srv->attach_send_link(link); - io_srv->attach_recv_link(link); - return std::make_tuple( - link, link_params.send_buff_size, link, link_params.recv_buff_size, false, true); -} - -size_t mpmd_link_if_ctrl_liberio::get_mtu(const uhd::direction_t /*dir*/) const -{ - return LIBERIO_DEFAULT_MTU; // FIXME -} diff --git a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.hpp b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.hpp deleted file mode 100644 index 03331c576..000000000 --- a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_liberio.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// Copyright 2017 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef INCLUDED_MPMD_XPORT_CTRL_LIBERIO_HPP -#define INCLUDED_MPMD_XPORT_CTRL_LIBERIO_HPP - -#include "mpmd_link_if_ctrl_base.hpp" -#include - -namespace uhd { namespace mpmd { namespace xport { - -/*! Liberio transport manager - */ -class mpmd_link_if_ctrl_liberio : public mpmd_link_if_ctrl_base -{ -public: - /* For liberio, get_chdr_link_options returns information about DMA engines. - * We assume there is only ever one liberio link available - * first = tx path - * second = rx path - */ - using liberio_link_info_t = std::pair; - - mpmd_link_if_ctrl_liberio(const uhd::device_addr_t& mb_args, - const mpmd_link_if_mgr::xport_info_list_t& xport_info); - - size_t get_num_links() const - { - return 1; - } - - uhd::transport::both_links_t get_link(const size_t link_idx, - const uhd::transport::link_type_t link_type, - const uhd::device_addr_t& link_args); - - size_t get_mtu(const uhd::direction_t) const; - - double get_link_rate(const size_t /*link_idx*/) const - { - return _link_rate; - } - - const uhd::rfnoc::chdr::chdr_packet_factory& get_packet_factory() const - { - return _pkt_factory; - } - -private: - const uhd::device_addr_t _mb_args; - const uhd::dict _recv_args; - const uhd::dict _send_args; - //! A list of DMA channels we can use for links - std::vector _dma_channels; - double _link_rate; - - /*! An index representing the next DMA channel to use, for a simple - * allocation of channels. For get_link(), increment for each new link, and - * throw an exception if _next_channel > number of DMA channels. - */ - size_t _next_channel = 0; - static const uhd::rfnoc::chdr::chdr_packet_factory _pkt_factory; -}; - -}}} /* namespace uhd::mpmd::xport */ - -#endif /* INCLUDED_MPMD_XPORT_CTRL_LIBERIO_HPP */ diff --git a/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp b/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp index 930f5e465..2173feeca 100644 --- a/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp +++ b/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp @@ -9,9 +9,6 @@ #include "mpmd_impl.hpp" #include "mpmd_link_if_ctrl_base.hpp" #include "mpmd_link_if_ctrl_udp.hpp" -#ifdef HAVE_LIBERIO -# include "mpmd_link_if_ctrl_liberio.hpp" -#endif uhd::dict uhd::mpmd::xport::filter_args( const uhd::device_addr_t& args, const std::string& prefix) @@ -104,10 +101,6 @@ private: //} #endif return std::make_unique(_mb_args, xport_info, chdr_w); -#ifdef HAVE_LIBERIO - } else if (link_type == "liberio") { - return std::make_unique(_mb_args, xport_info); -#endif } UHD_LOG_WARNING("MPMD", "Cannot instantiate transport medium " << link_type); return nullptr; -- cgit v1.2.3