aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2019-03-18 11:11:13 -0700
committermichael-west <michael.west@ettus.com>2019-05-21 16:05:39 -0700
commit79b235502da6d5f55ca59d48f9d825e40e191d02 (patch)
treee786e8936a6361bccf179c9aa5d88506e348ecf5 /host/lib/include
parent960a8ff10ad084cabb8397eceda44f56b327246f (diff)
downloaduhd-79b235502da6d5f55ca59d48f9d825e40e191d02.tar.gz
uhd-79b235502da6d5f55ca59d48f9d825e40e191d02.tar.bz2
uhd-79b235502da6d5f55ca59d48f9d825e40e191d02.zip
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.
Diffstat (limited to 'host/lib/include')
-rw-r--r--host/lib/include/uhdlib/transport/dpdk_zero_copy.hpp45
1 files changed, 45 insertions, 0 deletions
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 <uhdlib/transport/dpdk_common.hpp>
+#include <uhd/types/device_addr.hpp>
+#include <uhd/transport/zero_copy.hpp>
+#include <boost/shared_ptr.hpp>
+#include <string>
+
+
+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<dpdk_zero_copy> 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 */