aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-11-04 13:09:17 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2021-12-02 05:49:53 -0800
commit902c8456fbd13e85b930eae423e24b7abfc81869 (patch)
treecff64043a406385b0c2e649ceec88431c544d271 /host/lib/usrp
parent9f9c75ecd6e4a318dad5c378fbf260c8fd8c2922 (diff)
downloaduhd-902c8456fbd13e85b930eae423e24b7abfc81869.tar.gz
uhd-902c8456fbd13e85b930eae423e24b7abfc81869.tar.bz2
uhd-902c8456fbd13e85b930eae423e24b7abfc81869.zip
x300: Remove usage of CHDR_MAX_LEN_HDR
This constant was generally harmful, since it was only correct under certain circumstances (64 bit CHDR with timestamps). The X3x0 code was the last place it was being used, and we remove it without substitute because it was not doing anything useful here.
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/x300/x300_eth_mgr.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/host/lib/usrp/x300/x300_eth_mgr.cpp b/host/lib/usrp/x300/x300_eth_mgr.cpp
index 3650b8753..e4b131339 100644
--- a/host/lib/usrp/x300/x300_eth_mgr.cpp
+++ b/host/lib/usrp/x300/x300_eth_mgr.cpp
@@ -56,14 +56,18 @@ constexpr size_t ETH_MSG_NUM_FRAMES = 64;
constexpr size_t ETH_DATA_NUM_FRAMES = 32;
constexpr size_t ETH_MSG_FRAME_SIZE = uhd::transport::udp_simple::mtu; // bytes
+// Note: These rates do not account for protocol overhead (CHDR headers), but
+// only have to be approximately correct. They are used as identifiers, and to
+// size buffers. Since the buffers also need to hold CHDR headers, this value
+// is good enough.
constexpr size_t MAX_RATE_10GIGE = (size_t)( // bytes/s
10e9 / 8 * // wire speed multiplied by percentage of packets that is sample data
- (float(x300::DATA_FRAME_MAX_SIZE - CHDR_MAX_LEN_HDR)
+ (float(x300::DATA_FRAME_MAX_SIZE)
/ float(x300::DATA_FRAME_MAX_SIZE
+ 8 /* UDP header */ + 20 /* Ethernet header length */)));
constexpr size_t MAX_RATE_1GIGE = (size_t)( // bytes/s
1e9 / 8 * // wire speed multiplied by percentage of packets that is sample data
- (float(GE_DATA_FRAME_RECV_SIZE - CHDR_MAX_LEN_HDR)
+ (float(GE_DATA_FRAME_RECV_SIZE)
/ float(GE_DATA_FRAME_RECV_SIZE
+ 8 /* UDP header */ + 20 /* Ethernet header length */)));