summaryrefslogtreecommitdiffstats
path: root/src/rpc-server
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-08-18 20:34:13 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-08-18 23:46:32 +0300
commit08def8d3b3e909b9bbafcb0f4820a84ab7d522ad (patch)
tree57d87f1ec9161ae9f2f7dc841fec131c7bcd18b6 /src/rpc-server
parent1069c2c1b67899515e9769aac5f23642cc85410c (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/rpc-server')
-rw-r--r--src/rpc-server/commands/trex_rpc_cmd_general.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/rpc-server/commands/trex_rpc_cmd_general.cpp b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
index 21f64e2e..cd845fca 100644
--- a/src/rpc-server/commands/trex_rpc_cmd_general.cpp
+++ b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
@@ -289,7 +289,7 @@ TrexRpcCmdGetSysInfo::_run(const Json::Value &params, Json::Value &result) {
section["ports"] = Json::arrayValue;
for (int i = 0; i < main->get_port_count(); i++) {
- TrexPlatformApi::driver_speed_e speed;
+ uint32_t speed;
string driver;
string hw_macaddr;
string src_macaddr;
@@ -325,27 +325,7 @@ TrexRpcCmdGetSysInfo::_run(const Json::Value &params, Json::Value &result) {
section["ports"][i]["rx"]["caps"].append("rx_bytes");
}
section["ports"][i]["rx"]["counters"] = port->get_rx_count_num();
-
-
- switch (speed) {
- case TrexPlatformApi::SPEED_1G:
- section["ports"][i]["speed"] = 1;
- break;
-
- case TrexPlatformApi::SPEED_10G:
- section["ports"][i]["speed"] = 10;
- break;
-
- case TrexPlatformApi::SPEED_40G:
- section["ports"][i]["speed"] = 40;
- break;
-
- default:
- /* unknown value */
- section["ports"][i]["speed"] = 0;
- break;
- }
-
+ section["ports"][i]["speed"] = (uint16_t) speed / 1000;
}