diff options
Diffstat (limited to 'src/dpdk22/lib/librte_ether')
-rw-r--r-- | src/dpdk22/lib/librte_ether/rte_ethdev.c | 15 | ||||
-rw-r--r-- | src/dpdk22/lib/librte_ether/rte_ethdev.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/dpdk22/lib/librte_ether/rte_ethdev.c b/src/dpdk22/lib/librte_ether/rte_ethdev.c index ed971b49..43ec0265 100644 --- a/src/dpdk22/lib/librte_ether/rte_ethdev.c +++ b/src/dpdk22/lib/librte_ether/rte_ethdev.c @@ -1430,6 +1430,21 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) } } +// TREX_PATCH +int +rte_eth_get_speed(uint8_t port_id, int *speed) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + + dev = &rte_eth_devices[port_id]; + + // Only xl710 support this + *speed = i40e_trex_get_speed(dev); + return 0; +} + int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) { diff --git a/src/dpdk22/lib/librte_ether/rte_ethdev.h b/src/dpdk22/lib/librte_ether/rte_ethdev.h index f8c7c86d..e4bc9742 100644 --- a/src/dpdk22/lib/librte_ether/rte_ethdev.h +++ b/src/dpdk22/lib/librte_ether/rte_ethdev.h @@ -2150,6 +2150,8 @@ extern void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); extern void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); +extern int rte_eth_get_speed(uint8_t port_id, int *speed); + /** * Retrieve the general I/O statistics of an Ethernet device. * |