From deae87b73684b3a7a96c64c918c0342a52262744 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Wed, 19 Dec 2018 15:30:38 +0100 Subject: Use link speed from device capability instead of negotiated speeda JIRA: SAMPLEVNF-151 link speed is used in gen and lat latency extrapolations. Using a link_speed value lower than the actual link speed might result in errors (e.g. negative latencies). Negotiated link speed might be reported slowly (as reported through irq) Hence it is better to use the device capability link speed. In addition, this remove the check for link speed changes in fastpath. Change-Id: I0f475fe5e139b046012de6cd0b710e4390735078 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/run.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'VNFs/DPPD-PROX/run.c') diff --git a/VNFs/DPPD-PROX/run.c b/VNFs/DPPD-PROX/run.c index 6ffd76be..2ad8aca1 100644 --- a/VNFs/DPPD-PROX/run.c +++ b/VNFs/DPPD-PROX/run.c @@ -78,9 +78,14 @@ static void update_link_states(void) port_cfg = &prox_port_cfg[portid]; rte_eth_link_get_nowait(portid, &link); - port_cfg->link_up = link.link_status; +#if RTE_VERSION < RTE_VERSION_NUM(16,4,0,0) + // On more recent DPDK, we use the speed_capa of the port, and not the negotiated speed port_cfg->link_speed = link.link_speed; - plog_info("Link speed now %d Mbps\n", port_cfg->link_speed); +#endif + if (port_cfg->link_up != link.link_status) { + port_cfg->link_up = link.link_status; + plog_info("port %d: Link speed now %d Mbps\n", portid, link.link_speed); + } } } -- cgit 1.2.3-korg