aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorThomas Vogel <thomas.vogel@ni.com>2019-01-07 13:12:20 +0100
committerBrent Stapleton <brent.stapleton@ettus.com>2019-01-09 14:47:21 -0800
commit015b6aeb0b9cad0014fb15479a3cfc15e5f37d88 (patch)
tree203a6dc6a390cf65d02e5979f18f0f8f30403f7a /host
parenta490455abc5771ef3544f55597c209fde19cba4d (diff)
downloaduhd-015b6aeb0b9cad0014fb15479a3cfc15e5f37d88.tar.gz
uhd-015b6aeb0b9cad0014fb15479a3cfc15e5f37d88.tar.bz2
uhd-015b6aeb0b9cad0014fb15479a3cfc15e5f37d88.zip
udp_wsa_zero_copy: add default xport params
Diffstat (limited to 'host')
-rw-r--r--host/lib/transport/udp_wsa_zero_copy.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/host/lib/transport/udp_wsa_zero_copy.cpp b/host/lib/transport/udp_wsa_zero_copy.cpp
index c6df0b2aa..1bdf18095 100644
--- a/host/lib/transport/udp_wsa_zero_copy.cpp
+++ b/host/lib/transport/udp_wsa_zero_copy.cpp
@@ -19,7 +19,8 @@ using namespace uhd::transport;
namespace asio = boost::asio;
//A reasonable number of frames for send/recv and async/sync
-static const size_t DEFAULT_NUM_FRAMES = 32;
+constexpr size_t UDP_ZERO_COPY_DEFAULT_NUM_FRAMES = 1;
+constexpr size_t UDP_ZERO_COPY_DEFAULT_FRAME_SIZE = 1472; // Based on common 1500 byte MTU for 1GbE.
/***********************************************************************
* Check registry for correct fast-path setting (windows only)
@@ -381,6 +382,29 @@ udp_zero_copy::sptr udp_zero_copy::make(
xport_params.send_frame_size = size_t(hints.cast<double>("send_frame_size", default_buff_args.send_frame_size));
xport_params.num_send_frames = size_t(hints.cast<double>("num_send_frames", default_buff_args.num_send_frames));
+ if (xport_params.num_recv_frames == 0) {
+ UHD_LOG_TRACE("UDP",
+ "Default value for num_recv_frames: " << UDP_ZERO_COPY_DEFAULT_NUM_FRAMES);
+ xport_params.num_recv_frames = UDP_ZERO_COPY_DEFAULT_NUM_FRAMES;
+ }
+ if (xport_params.num_send_frames == 0) {
+ UHD_LOG_TRACE("UDP",
+ "Default value for no num_send_frames: " << UDP_ZERO_COPY_DEFAULT_NUM_FRAMES);
+ xport_params.num_send_frames = UDP_ZERO_COPY_DEFAULT_NUM_FRAMES;
+ }
+ if (xport_params.recv_frame_size == 0) {
+ UHD_LOG_TRACE("UDP",
+ "Using default value for recv_frame_size: "
+ << UDP_ZERO_COPY_DEFAULT_FRAME_SIZE);
+ xport_params.recv_frame_size = UDP_ZERO_COPY_DEFAULT_FRAME_SIZE;
+ }
+ if (xport_params.send_frame_size == 0) {
+ UHD_LOG_TRACE("UDP",
+ "Using default value for send_frame_size, "
+ << UDP_ZERO_COPY_DEFAULT_FRAME_SIZE);
+ xport_params.send_frame_size = UDP_ZERO_COPY_DEFAULT_FRAME_SIZE;
+ }
+
//extract buffer size hints from the device addr and check if they match up
size_t usr_recv_buff_size = size_t(hints.cast<double>("recv_buff_size", 0.0));
size_t usr_send_buff_size = size_t(hints.cast<double>("send_buff_size", 0.0));