aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCiro Nishiguchi <ciro.nishiguchi@ni.com>2018-11-09 10:21:28 -0600
committerMartin Braun <martin.braun@ettus.com>2018-11-14 14:12:01 -0800
commitdcd31bb2e56f97ed35ab2c95fd985bbbed830045 (patch)
tree2b153c787322e702a0918fe33a45bb87ec21af69
parenta69ab0c23a0c38e3fed3e412df36538d8959d23c (diff)
downloaduhd-dcd31bb2e56f97ed35ab2c95fd985bbbed830045.tar.gz
uhd-dcd31bb2e56f97ed35ab2c95fd985bbbed830045.tar.bz2
uhd-dcd31bb2e56f97ed35ab2c95fd985bbbed830045.zip
uhd: Add device arg to enable dual ethernet for tx
UHD currently only uses a single ethernet link for tx data, even if the device is initialized with dual 10GbE links. Using both links when a DMA FIFO is present causes sequence errors due to DMA FIFO bandwidth limitations. This maintains the current default behavior but allows users to override it through a device arg "enable_tx_dual_eth".
-rw-r--r--host/lib/usrp/x300/x300_device_args.hpp11
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp8
2 files changed, 17 insertions, 2 deletions
diff --git a/host/lib/usrp/x300/x300_device_args.hpp b/host/lib/usrp/x300/x300_device_args.hpp
index 57e6e04cc..56b3c1078 100644
--- a/host/lib/usrp/x300/x300_device_args.hpp
+++ b/host/lib/usrp/x300/x300_device_args.hpp
@@ -32,7 +32,8 @@ public:
_niusrprio_rpc_port("niusrprio_rpc_port", NIUSRPRIO_DEFAULT_RPC_PORT),
_has_fw_file("fw", false),
_fw_file("fw", ""),
- _blank_eeprom("blank_eeprom", false)
+ _blank_eeprom("blank_eeprom", false),
+ _enable_tx_dual_eth("enable_tx_dual_eth", false)
{
// nop
}
@@ -92,6 +93,10 @@ public:
bool get_blank_eeprom() const {
return _blank_eeprom.get();
}
+ bool get_enable_tx_dual_eth() const {
+ return _enable_tx_dual_eth.get();
+ }
+
inline virtual std::string to_string() const {
return _master_clock_rate.to_string() + ", " +
@@ -147,6 +152,9 @@ private:
PARSE_DEFAULT(_fw_file);
}
PARSE_DEFAULT(_blank_eeprom)
+ if (dev_args.has_key("enable_tx_dual_eth")){
+ _enable_tx_dual_eth.set(true);
+ }
//Sanity check params
_enforce_discrete(_master_clock_rate, TICK_RATE_OPTIONS);
@@ -173,6 +181,7 @@ private:
constrained_device_args_t::bool_arg _has_fw_file;
constrained_device_args_t::str_arg<true> _fw_file;
constrained_device_args_t::bool_arg _blank_eeprom;
+ constrained_device_args_t::bool_arg _enable_tx_dual_eth;
};
}}} //namespace
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 0b173beb3..d3eeeef10 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -1286,7 +1286,13 @@ uhd::both_xports_t x300_impl::make_transport(
next_src_addr==0 ? x300::SRC_ADDR0 : x300::SRC_ADDR1;
const uint32_t xbar_src_dst =
conn.type==X300_IFACE_ETH0 ? x300::XB_DST_E0 : x300::XB_DST_E1;
- if (xport_type != TX_DATA) next_src_addr = (next_src_addr + 1) % mb.eth_conns.size();
+
+ // Do not increment src addr for tx_data by default, using dual ethernet
+ // with the DMA FIFO causes sequence errors to DMA FIFO bandwidth
+ // limitations.
+ if (xport_type != TX_DATA || mb.args.get_enable_tx_dual_eth()) {
+ next_src_addr = (next_src_addr + 1) % mb.eth_conns.size();
+ }
xports.send_sid = this->allocate_sid(mb, address, xbar_src_addr, xbar_src_dst);
xports.recv_sid = xports.send_sid.reversed();