aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-05-09 17:25:10 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:53 -0800
commita60f56197604084b238da8804d7a72d6fae1e832 (patch)
treea0feb63658de88fd2dc0d9e3e707c830ebae596e
parent83a2ae4e947c508a6aebd95e065a2937750f13be (diff)
downloaduhd-a60f56197604084b238da8804d7a72d6fae1e832.tar.gz
uhd-a60f56197604084b238da8804d7a72d6fae1e832.tar.bz2
uhd-a60f56197604084b238da8804d7a72d6fae1e832.zip
mpmd: Increased buff size on mpmd rx
-rw-r--r--host/lib/usrp/netd/netd_impl.cpp24
-rw-r--r--host/lib/usrp/netd/netd_impl.hpp5
2 files changed, 29 insertions, 0 deletions
diff --git a/host/lib/usrp/netd/netd_impl.cpp b/host/lib/usrp/netd/netd_impl.cpp
index 557ebff4a..f412d0f0f 100644
--- a/host/lib/usrp/netd/netd_impl.cpp
+++ b/host/lib/usrp/netd/netd_impl.cpp
@@ -165,6 +165,30 @@ netd_mboard_impl::uptr netd_impl::setup_mb(const size_t mb_i,
return mb;
}
+
+// TODO this does not consider the liberio use case!
+uhd::device_addr_t netd_impl::get_rx_hints(size_t /* mb_index */)
+{
+ //device_addr_t rx_hints = _mb[mb_index].recv_args;
+ device_addr_t rx_hints; // TODO don't ignore what the user tells us
+ // (default to a large recv buff)
+ if (not rx_hints.has_key("recv_buff_size"))
+ {
+ //For the ethernet transport, the buffer has to be set before creating
+ //the transport because it is independent of the frame size and # frames
+ //For nirio, the buffer size is not configurable by the user
+ #if defined(UHD_PLATFORM_MACOS) || defined(UHD_PLATFORM_BSD)
+ //limit buffer resize on macos or it will error
+ rx_hints["recv_buff_size"] = boost::lexical_cast<std::string>(NETD_RX_SW_BUFF_SIZE_ETH_MACOS);
+ #elif defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)
+ //set to half-a-second of buffering at max rate
+ rx_hints["recv_buff_size"] = boost::lexical_cast<std::string>(NETD_RX_SW_BUFF_SIZE_ETH);
+ #endif
+ }
+ return rx_hints;
+}
+
+
// frame_size_t determine_max_frame_size(const std::string &addr,
// const frame_size_t &user_frame_size){
// transport::udp_simple::sptr udp =
diff --git a/host/lib/usrp/netd/netd_impl.hpp b/host/lib/usrp/netd/netd_impl.hpp
index 4b08f50cd..ffd794735 100644
--- a/host/lib/usrp/netd/netd_impl.hpp
+++ b/host/lib/usrp/netd/netd_impl.hpp
@@ -25,6 +25,9 @@
#include <uhd/utils/tasks.hpp>
#include <map>
+static const size_t NETD_RX_SW_BUFF_SIZE_ETH = 0x2000000;//32MiB For an ~8k frame size any size >32MiB is just wasted buffer space
+static const size_t NETD_RX_SW_BUFF_SIZE_ETH_MACOS = 0x100000; //1Mib
+
static const size_t MPM_DISCOVERY_PORT = 49600;
static const size_t MPM_RPC_PORT = 49601;
static const char MPM_DISCOVERY_CMD[] = "MPM-DISC";
@@ -79,6 +82,8 @@ class netd_impl : public uhd::usrp::device3_impl
const uhd::device_addr_t&);
private:
+ uhd::device_addr_t get_rx_hints(size_t mb_index);
+
std::vector<netd_mboard_impl::uptr> _mb;
size_t _sid_framer;
};