summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/handle_lat.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2018-12-19 15:30:38 +0100
committerXavier Simonart <xavier.simonart@intel.com>2019-02-20 16:32:05 +0100
commitdeae87b73684b3a7a96c64c918c0342a52262744 (patch)
tree25c569b8a231132ed4f34a564901d9140b77c5fd /VNFs/DPPD-PROX/handle_lat.c
parent06d71cb8ceab4d531a29b09c589eeda7bd4e6311 (diff)
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 <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/handle_lat.c')
-rw-r--r--VNFs/DPPD-PROX/handle_lat.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/VNFs/DPPD-PROX/handle_lat.c b/VNFs/DPPD-PROX/handle_lat.c
index 8c7de8f1..0273230b 100644
--- a/VNFs/DPPD-PROX/handle_lat.c
+++ b/VNFs/DPPD-PROX/handle_lat.c
@@ -507,6 +507,8 @@ static int handle_lat_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, uin
struct task_lat *task = (struct task_lat *)tbase;
int rc;
+#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
// If link is down, link_speed is 0
if (unlikely(task->link_speed == 0)) {
if (task->port && task->port->link_speed != 0) {
@@ -519,7 +521,7 @@ static int handle_lat_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, uin
return 0;
}
}
-
+#endif
if (n_pkts == 0) {
task->begin = tbase->aux->tsc_rx.before;
return 0;
@@ -729,6 +731,7 @@ static void lat_start(struct task_base *tbase)
if (task->port) {
// task->port->link_speed reports the link speed in Mbps e.g. 40k for a 40 Gbps NIC.
// task->link_speed reports link speed in Bytes per sec.
+#if RTE_VERSION < RTE_VERSION_NUM(16,4,0,0)
// It can be 0 if link is down, and must hence be updated in fast path.
task->link_speed = task->port->link_speed * 125000L;
if (task->link_speed)
@@ -737,6 +740,15 @@ static void lat_start(struct task_base *tbase)
else
plog_info("\tPort %u: link speed is %ld Mbps - link might be down\n",
(uint8_t)(task->port - prox_port_cfg), 8 * task->link_speed / 1000000);
+#else
+ if (task->port->link_speed == UINT32_MAX)
+ task->link_speed = UINT64_MAX;
+ else {
+ task->link_speed = task->port->link_speed * 125000L;
+ plog_info("\tPort %u: link max speed is %ld Mbps\n",
+ (uint8_t)(task->port - prox_port_cfg), 8 * task->link_speed / 1000000);
+ }
+#endif
}
}