aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-10-19 18:09:31 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-11-08 07:37:31 -0800
commitef94c93a0822beda2f8c691bd4390727f7355322 (patch)
tree5d6188f38c217c23674ebfa2e10f49818041e1b5
parentabea5bb240a64a721de7bc8108e72671726b3e98 (diff)
downloaduhd-ef94c93a0822beda2f8c691bd4390727f7355322.tar.gz
uhd-ef94c93a0822beda2f8c691bd4390727f7355322.tar.bz2
uhd-ef94c93a0822beda2f8c691bd4390727f7355322.zip
mpmd: Increase UHD-side MTU cap for 10 GbE and 1 GbE
This gets closer to what our hardware can actually support. See the comments for further explanations. This has the side-effect of patching an issue on X410 (using 200 MHz images) where garbage samples would get injected (one per packet). It is not, however, the final fix for that problem.
-rw-r--r--host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp18
-rw-r--r--mpm/python/usrp_mpm/discovery.py8
2 files changed, 18 insertions, 8 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp
index 89f713f1e..fe7d2b670 100644
--- a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp
+++ b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp
@@ -29,14 +29,24 @@ using namespace uhd::mpmd::xport;
namespace {
-//! Maximum CHDR packet size in bytes
-const size_t MPMD_10GE_DATA_FRAME_MAX_SIZE = 7972;
-const size_t MPMD_1GE_DATA_FRAME_MAX_SIZE = 1472;
+//! Maximum CHDR packet size in bytes.
+// Our 10GbE connections use custom FPGA code which caps frames at 8192 bytes.
+// However, we artificially limit this to a smaller frame size, which gives us
+// a safety margin.
+const size_t MPMD_10GE_DATA_FRAME_MAX_SIZE = 8016;
+// For 1 GbE, we either go through our on-chip PHY/MAC, which also caps at 8192
+// bytes, or we go through the RJ45, and then the DMA to the chip, which can go
+// higher. We thus choose the same value as for 10 GbE.
+// Note that for 1 GbE, we almost always have an MTU of 1500, so we will rarely
+// meet this frame size, but MTU discovery will take care of that. This is just
+// a cap to make sure we never try CHDR packets that will clog our fabric.
+const size_t MPMD_1GE_DATA_FRAME_MAX_SIZE = 8016;
//! Number of send/recv frames
const size_t MPMD_ETH_NUM_FRAMES = 32;
-//!
+//! Buffer depth in seconds. We use the link rate to determine how large buffers
+// must be to store this many seconds worth of data.
const double MPMD_BUFFER_DEPTH = 20.0e-3; // s
//! For MTU discovery, the time we wait for a packet before calling it
// oversized (seconds).
diff --git a/mpm/python/usrp_mpm/discovery.py b/mpm/python/usrp_mpm/discovery.py
index bae736150..c33f1e3c4 100644
--- a/mpm/python/usrp_mpm/discovery.py
+++ b/mpm/python/usrp_mpm/discovery.py
@@ -16,9 +16,9 @@ from usrp_mpm.mpmutils import to_binary_str
RESPONSE_PREAMBLE = b"USRP-MPM"
RESPONSE_SEP = b";"
RESPONSE_CLAIMED_KEY = b"claimed"
-# "Max MTU" is not a redundant name. We don't know the total path MTU, but we
-# can say for sure that it won't exceed a certain value, and that's the max MTU
-MAX_MTU = 8000
+# A buffer size large enough to capture any UDP packet we receive on the
+# discovery socket
+MAX_SOCK_BUFSIZ = 9000
# For setsockopt
IP_MTU_DISCOVER = 10
IP_PMTUDISC_DO = 2
@@ -71,7 +71,7 @@ def _discovery_process(state, discovery_addr):
try:
while True:
- data, sender = sock.recvfrom(MAX_MTU)
+ data, sender = sock.recvfrom(MAX_SOCK_BUFSIZ)
log.debug("Got poked by: %s", sender[0])
# TODO this is still part of the awful subnet identification
if not sender[0].startswith(discovery_addr_prefix):