diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-08-18 20:34:13 +0300 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-08-18 23:46:32 +0300 |
commit | 08def8d3b3e909b9bbafcb0f4820a84ab7d522ad (patch) | |
tree | 57d87f1ec9161ae9f2f7dc841fec131c7bcd18b6 /src/stateless/cp/trex_stateless_port.cpp | |
parent | 1069c2c1b67899515e9769aac5f23642cc85410c (diff) |
TRex argument --dump-interfaces <list of PCI> (by default will take interfaces from /etc/trex_cfg.yaml if exists, if does not exists, will show all DPDK interfaces)
get interface speed from DPDK instead of using constants per driver
add script to generate config file /etc/trex_cfg.yaml: sudo ./dpdk_setup_ports.py -c <list of PCI>
show table of interfaces in sudo ./dpdk_setup_ports.py -t
Diffstat (limited to 'src/stateless/cp/trex_stateless_port.cpp')
-rw-r--r-- | src/stateless/cp/trex_stateless_port.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp index 134d4c98..2a545c5f 100644 --- a/src/stateless/cp/trex_stateless_port.cpp +++ b/src/stateless/cp/trex_stateless_port.cpp @@ -573,7 +573,7 @@ TrexStatelessPort::get_max_stream_id() const { } void -TrexStatelessPort::get_properties(std::string &driver, TrexPlatformApi::driver_speed_e &speed) { +TrexStatelessPort::get_properties(std::string &driver, uint32_t &speed) { driver = m_api_info.driver_name; speed = m_api_info.speed; @@ -657,19 +657,7 @@ TrexStatelessPort::send_message_to_rx(TrexStatelessCpToRxMsgBase *msg) { uint64_t TrexStatelessPort::get_port_speed_bps() const { - switch (m_api_info.speed) { - case TrexPlatformApi::SPEED_1G: - return (1LLU * 1000 * 1000 * 1000); - - case TrexPlatformApi::SPEED_10G: - return (10LLU * 1000 * 1000 * 1000); - - case TrexPlatformApi::SPEED_40G: - return (40LLU * 1000 * 1000 * 1000); - - default: - return 0; - } + return (uint64_t) m_api_info.speed * 1000 * 1000; } static inline double |