diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-08-29 12:45:04 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-08-29 12:45:04 -0700 |
commit | cad5463cda93b8cdc9a8579d4af5a493bbf9a116 (patch) | |
tree | fd4412a92f3e23b0cdd103371ae46847c13d49c2 /host/lib/usrp/x300 | |
parent | 192ad7e01ac20efe23a14d0fe22a6fb745f8c4cf (diff) | |
parent | a9bfadd3253b57a15191a00baea2e57e1c56fac9 (diff) | |
download | uhd-cad5463cda93b8cdc9a8579d4af5a493bbf9a116.tar.gz uhd-cad5463cda93b8cdc9a8579d4af5a493bbf9a116.tar.bz2 uhd-cad5463cda93b8cdc9a8579d4af5a493bbf9a116.zip |
Merge branch 'UHD-3.9.LTS' into maint
Diffstat (limited to 'host/lib/usrp/x300')
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 5f47c35ed..7f7fcad09 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -626,10 +626,12 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) } if ((mb.recv_args.has_key("recv_frame_size")) - && (req_max_frame_size.recv_frame_size < _max_frame_sizes.recv_frame_size)) { + && (req_max_frame_size.recv_frame_size > _max_frame_sizes.recv_frame_size)) { UHD_MSG(warning) << boost::format("You requested a receive frame size of (%lu) but your NIC's max frame size is (%lu).") - % req_max_frame_size.recv_frame_size << _max_frame_sizes.recv_frame_size << std::endl + % req_max_frame_size.recv_frame_size + % _max_frame_sizes.recv_frame_size + << std::endl << boost::format("Please verify your NIC's MTU setting using '%s' or set the recv_frame_size argument appropriately.") % mtu_tool << std::endl << "UHD will use the auto-detected max frame size for this connection." @@ -637,10 +639,12 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) } if ((mb.recv_args.has_key("send_frame_size")) - && (req_max_frame_size.send_frame_size < _max_frame_sizes.send_frame_size)) { + && (req_max_frame_size.send_frame_size > _max_frame_sizes.send_frame_size)) { UHD_MSG(warning) << boost::format("You requested a send frame size of (%lu) but your NIC's max frame size is (%lu).") - % req_max_frame_size.send_frame_size << _max_frame_sizes.send_frame_size << std::endl + % req_max_frame_size.send_frame_size + % _max_frame_sizes.send_frame_size + << std::endl << boost::format("Please verify your NIC's MTU setting using '%s' or set the send_frame_size argument appropriately.") % mtu_tool << std::endl << "UHD will use the auto-detected max frame size for this connection." @@ -1494,10 +1498,11 @@ x300_impl::frame_size_t x300_impl::determine_max_frame_size(const std::string &a if (!(uhd::ntohx<boost::uint32_t>(request->flags) & X300_MTU_DETECT_ECHO_REPLY)) throw uhd::not_implemented_error("Holler protocol not implemented"); + //Reducing range of (min,max) by setting max value to 10gig max_frame_size as larger sizes are not supported size_t min_recv_frame_size = sizeof(x300_mtu_t); - size_t max_recv_frame_size = user_frame_size.recv_frame_size; + size_t max_recv_frame_size = std::min(user_frame_size.recv_frame_size, X300_10GE_DATA_FRAME_MAX_SIZE) & size_t(~3); size_t min_send_frame_size = sizeof(x300_mtu_t); - size_t max_send_frame_size = user_frame_size.send_frame_size; + size_t max_send_frame_size = std::min(user_frame_size.send_frame_size, X300_10GE_DATA_FRAME_MAX_SIZE) & size_t(~3); UHD_MSG(status) << "Determining maximum frame size... "; while (min_recv_frame_size < max_recv_frame_size) |