From d11d6d0006c890d586e0d2d3382436804cda8625 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Mon, 1 Jul 2019 17:11:54 +0200 Subject: Fix port throughput related statistics for i40e virtual functions When CRC stripping is enabled (default PROX behavior), the number of rx bytes received by the NIC returned by DPDK usually does not take the CRC 4 bytes into account. However, for i40e virtual functions those 4 bytes are counted as part of the received bytes. This resulted in both DPDK and PROX taking those 4 bytes into account causing the RX % to be above 100%. Change-Id: I59883b638ed67a6778f80c4dd6bfbfc4f9f2f528 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/display_ports.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VNFs/DPPD-PROX/display_ports.c b/VNFs/DPPD-PROX/display_ports.c index 54755106..79a5a2d7 100644 --- a/VNFs/DPPD-PROX/display_ports.c +++ b/VNFs/DPPD-PROX/display_ports.c @@ -179,10 +179,10 @@ static void display_ports_draw_per_sec_stats(void) /* Take 20 bytes overhead (or 24 if crc strip is enabled) into accound */ struct percent rx_percent; struct percent tx_percent; - if (strcmp(prox_port_cfg[port_id].short_name, "i40e") == 0) { + if (strcmp(prox_port_cfg[port_id].short_name, "i40e_vf") == 0) { #if defined (DEV_RX_OFFLOAD_CRC_STRIP) if (prox_port_cfg[port_id].requested_rx_offload & DEV_RX_OFFLOAD_CRC_STRIP) { - rx_percent = calc_percent(last->rx_bytes - prev->rx_bytes + 24 * (last->rx_tot - prev->rx_tot), delta_t); + rx_percent = calc_percent(last->rx_bytes - prev->rx_bytes + 20 * (last->rx_tot - prev->rx_tot), delta_t); tx_percent = calc_percent(last->tx_bytes - prev->tx_bytes + 24 * (last->tx_tot - prev->tx_tot), delta_t); } else { rx_percent = calc_percent(last->rx_bytes - prev->rx_bytes + 20 * (last->rx_tot - prev->rx_tot), delta_t); @@ -203,7 +203,7 @@ static void display_ports_draw_per_sec_stats(void) rx_percent = calc_percent(last->rx_bytes - prev->rx_bytes + 20 * (last->rx_tot - prev->rx_tot), delta_t); tx_percent = calc_percent(last->tx_bytes - prev->tx_bytes + 20 * (last->tx_tot - prev->tx_tot), delta_t); } else { - rx_percent = calc_percent(last->rx_bytes - prev->rx_bytes + 24 * (last->rx_tot - prev->rx_tot), delta_t); + rx_percent = calc_percent(last->rx_bytes - prev->rx_bytes + 20 * (last->rx_tot - prev->rx_tot), delta_t); tx_percent = calc_percent(last->tx_bytes - prev->tx_bytes + 24 * (last->tx_tot - prev->tx_tot), delta_t); } } else { -- cgit 1.2.3-korg