From 902c8456fbd13e85b930eae423e24b7abfc81869 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 4 Nov 2021 13:09:17 +0100 Subject: 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. --- host/lib/usrp/x300/x300_eth_mgr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp') 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 */))); -- cgit v1.2.3