diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2019-01-18 09:45:34 -0800 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-01-18 17:51:35 -0800 |
commit | a53130679944ddd179593259eb953b89ab1a7a38 (patch) | |
tree | 5d8274750bed0b21aa133bc93d97d75bbce0ecd9 /host/lib/transport/dpdk_zero_copy.hpp | |
parent | 2a44d6836ca08b6b67b83b63487b838e138ac379 (diff) | |
download | uhd-a53130679944ddd179593259eb953b89ab1a7a38.tar.gz uhd-a53130679944ddd179593259eb953b89ab1a7a38.tar.bz2 uhd-a53130679944ddd179593259eb953b89ab1a7a38.zip |
lib: transport: apply clang-format
This is a continuation of 967be2a4.
$ find host/lib/transport -iname *.hpp -o -iname *.cpp |\
xargs clang-format -i -style=file
Skipping host/lib/transport/nirio/ because of build errors.
$ git checkout host/lib/transport/nirio
Diffstat (limited to 'host/lib/transport/dpdk_zero_copy.hpp')
-rw-r--r-- | host/lib/transport/dpdk_zero_copy.hpp | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/host/lib/transport/dpdk_zero_copy.hpp b/host/lib/transport/dpdk_zero_copy.hpp index a4b5b4879..f90e73d0e 100644 --- a/host/lib/transport/dpdk_zero_copy.hpp +++ b/host/lib/transport/dpdk_zero_copy.hpp @@ -8,19 +8,20 @@ #define DPDK_ZERO_COPY_HPP #include <uhd/config.hpp> +#include <uhd/transport/zero_copy.hpp> #include <uhd/types/device_addr.hpp> -#include <uhd/utils/static.hpp> #include <uhd/utils/log.hpp> -#include <uhd/transport/zero_copy.hpp> +#include <uhd/utils/static.hpp> #include <boost/shared_ptr.hpp> +#include <mutex> #include <string> #include <vector> -#include <mutex> namespace uhd { namespace transport { -class uhd_dpdk_ctx : boost::noncopyable { +class uhd_dpdk_ctx : boost::noncopyable +{ public: UHD_SINGLETON_FCN(uhd_dpdk_ctx, get); @@ -35,9 +36,12 @@ public: * \param mbuf_cache_size Size of per-core packet buffer cache from mempool * \param mtu MTU of NIC ports */ - void init(const dict<std::string, std::string> &eal_args, unsigned int num_ports, - int *port_thread_mapping, int num_mbufs, int mbuf_cache_size, - size_t mtu); + void init(const dict<std::string, std::string>& eal_args, + unsigned int num_ports, + int* port_thread_mapping, + int num_mbufs, + int mbuf_cache_size, + size_t mtu); /*! * Get port ID from provided MAC address @@ -45,14 +49,14 @@ public: * \param port_id Int to write ID of port corresponding to MAC address * \return 0 if match found, else no match */ - int get_port_id(std::array<uint8_t, 6> mac_addr, unsigned int &port_id); + int get_port_id(std::array<uint8_t, 6> mac_addr, unsigned int& port_id); /*! * Get port ID for routing packet destined for given address * \param addr Destination address * \return port ID from routing table */ - int get_route(const std::string &addr) const; + int get_route(const std::string& addr) const; /*! * Set IPv4 address and subnet mask of given NIC port @@ -80,19 +84,18 @@ private: /*! * A zero copy transport interface to the dpdk DMA library. */ -class dpdk_zero_copy : public virtual zero_copy_if { +class dpdk_zero_copy : public virtual zero_copy_if +{ public: typedef boost::shared_ptr<dpdk_zero_copy> sptr; - static sptr make( - struct uhd_dpdk_ctx &ctx, + static sptr make(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 - ); + 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; @@ -101,6 +104,6 @@ public: virtual uint32_t get_drop_count(void) const = 0; }; -}} +}} // namespace uhd::transport #endif /* DPDK_ZERO_COPY_HPP */ |