From 79b235502da6d5f55ca59d48f9d825e40e191d02 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Mon, 18 Mar 2019 11:11:13 -0700 Subject: uhdlib: Add dpdk_zero_copy.hpp dpdk_zero_copy.hpp was referenced in multiple places using relative paths. Let's throw it in uhdlib for easy access. --- .../include/uhdlib/transport/dpdk_zero_copy.hpp | 45 ++++++++++++++++++++++ host/lib/transport/dpdk_zero_copy.cpp | 2 +- host/lib/transport/dpdk_zero_copy.hpp | 45 ---------------------- host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.cpp | 2 +- host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.hpp | 2 +- host/lib/usrp/x300/x300_impl.cpp | 2 +- host/tests/dpdk_test.cpp | 2 +- 7 files changed, 50 insertions(+), 50 deletions(-) create mode 100644 host/lib/include/uhdlib/transport/dpdk_zero_copy.hpp delete mode 100644 host/lib/transport/dpdk_zero_copy.hpp diff --git a/host/lib/include/uhdlib/transport/dpdk_zero_copy.hpp b/host/lib/include/uhdlib/transport/dpdk_zero_copy.hpp new file mode 100644 index 000000000..8dcce6eee --- /dev/null +++ b/host/lib/include/uhdlib/transport/dpdk_zero_copy.hpp @@ -0,0 +1,45 @@ +// +// Copyright 2018 Ettus Research, a National Instruments Company +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#ifndef DPDK_ZERO_COPY_HPP +#define DPDK_ZERO_COPY_HPP + +#include +#include +#include +#include +#include + + +namespace uhd { namespace transport { + +/*! + * A zero copy transport interface to the dpdk DMA library. + */ +class dpdk_zero_copy : public virtual zero_copy_if { +public: + typedef boost::shared_ptr sptr; + + static sptr make( + const struct uhd_dpdk_ctx &ctx, + const unsigned int dpdk_port_id, + const std::string &addr, + const std::string &remote_port, + const std::string &local_port, /* 0 = auto-assign */ + const zero_copy_xport_params &default_buff_args, + const device_addr_t &hints + ); + + virtual uint16_t get_local_port(void) const = 0; + + virtual std::string get_local_addr(void) const = 0; + + virtual uint32_t get_drop_count(void) const = 0; +}; + +}} // namespace uhd::transport + +#endif /* DPDK_ZERO_COPY_HPP */ diff --git a/host/lib/transport/dpdk_zero_copy.cpp b/host/lib/transport/dpdk_zero_copy.cpp index 9649c1cfb..a6a158762 100644 --- a/host/lib/transport/dpdk_zero_copy.cpp +++ b/host/lib/transport/dpdk_zero_copy.cpp @@ -4,10 +4,10 @@ // SPDX-License-Identifier: GPL-3.0-or-later // -#include "dpdk_zero_copy.hpp" #include #include #include +#include #include #include #include diff --git a/host/lib/transport/dpdk_zero_copy.hpp b/host/lib/transport/dpdk_zero_copy.hpp deleted file mode 100644 index 8dcce6eee..000000000 --- a/host/lib/transport/dpdk_zero_copy.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright 2018 Ettus Research, a National Instruments Company -// -// SPDX-License-Identifier: GPL-3.0-or-later -// - -#ifndef DPDK_ZERO_COPY_HPP -#define DPDK_ZERO_COPY_HPP - -#include -#include -#include -#include -#include - - -namespace uhd { namespace transport { - -/*! - * A zero copy transport interface to the dpdk DMA library. - */ -class dpdk_zero_copy : public virtual zero_copy_if { -public: - typedef boost::shared_ptr sptr; - - static sptr make( - const struct uhd_dpdk_ctx &ctx, - const unsigned int dpdk_port_id, - const std::string &addr, - const std::string &remote_port, - const std::string &local_port, /* 0 = auto-assign */ - const zero_copy_xport_params &default_buff_args, - const device_addr_t &hints - ); - - virtual uint16_t get_local_port(void) const = 0; - - virtual std::string get_local_addr(void) const = 0; - - virtual uint32_t get_drop_count(void) const = 0; -}; - -}} // namespace uhd::transport - -#endif /* DPDK_ZERO_COPY_HPP */ diff --git a/host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.cpp b/host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.cpp index f739942b4..a496e8e69 100644 --- a/host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.cpp +++ b/host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.cpp @@ -7,9 +7,9 @@ #include "mpmd_impl.hpp" #include "mpmd_xport_mgr.hpp" #include "mpmd_xport_ctrl_dpdk_udp.hpp" -#include "../../transport/dpdk_zero_copy.hpp" #include #include +#include #include diff --git a/host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.hpp b/host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.hpp index 1ee1549e0..943cd44d6 100644 --- a/host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.hpp +++ b/host/lib/usrp/mpmd/mpmd_xport_ctrl_dpdk_udp.hpp @@ -8,8 +8,8 @@ #define INCLUDED_MPMD_XPORT_CTRL_DPDK_UDP_HPP #include "mpmd_xport_ctrl_base.hpp" -#include "../transport/dpdk_zero_copy.hpp" #include +#include #include "../device3/device3_impl.hpp" namespace uhd { namespace mpmd { namespace xport { diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 72aeb09e6..796d422ad 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -25,7 +25,7 @@ #include #include #ifdef HAVE_DPDK -# include "../../transport/dpdk_zero_copy.hpp" +# include # include #endif #include diff --git a/host/tests/dpdk_test.cpp b/host/tests/dpdk_test.cpp index ff52e4b60..df4717154 100644 --- a/host/tests/dpdk_test.cpp +++ b/host/tests/dpdk_test.cpp @@ -8,7 +8,7 @@ */ -#include "../transport/dpdk_zero_copy.hpp" +#include #include #include #include -- cgit v1.2.3