All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/i40e: fix VF statistics
@ 2017-06-05 21:14 Qi Zhang
  2017-06-06 14:49 ` [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Qi Zhang @ 2017-06-05 21:14 UTC (permalink / raw)
  To: jingjing.wu, helin.zhang; +Cc: dev, Qi Zhang, stable

CRC bytes should be excluded, so rx/tx bytes of VF stats is aligned
with PF stats.

Fixes: 9aace75fc82e ("i40e: fix statistics")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4c49673..7aa7f91 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2329,6 +2329,10 @@ i40e_update_vsi_stats(struct i40e_vsi *vsi)
 	i40e_stat_update_48(hw, I40E_GLV_BPRCH(idx), I40E_GLV_BPRCL(idx),
 			    vsi->offset_loaded, &oes->rx_broadcast,
 			    &nes->rx_broadcast);
+	/* exclude CRC bytes */
+	nes->rx_bytes -= (nes->rx_unicast + nes->rx_multicast +
+		nes->rx_broadcast) * ETHER_CRC_LEN;
+
 	i40e_stat_update_32(hw, I40E_GLV_RDPC(idx), vsi->offset_loaded,
 			    &oes->rx_discards, &nes->rx_discards);
 	/* GLV_REPC not supported */
@@ -2348,6 +2352,9 @@ i40e_update_vsi_stats(struct i40e_vsi *vsi)
 	i40e_stat_update_48(hw, I40E_GLV_BPTCH(idx), I40E_GLV_BPTCL(idx),
 			    vsi->offset_loaded,  &oes->tx_broadcast,
 			    &nes->tx_broadcast);
+	/* exclude CRC bytes */
+	nes->tx_bytes -= (nes->tx_unicast + nes->tx_multicast +
+		nes->tx_broadcast) * ETHER_CRC_LEN;
 	/* GLV_TDPC not supported */
 	i40e_stat_update_32(hw, I40E_GLV_TEPC(idx), vsi->offset_loaded,
 			    &oes->tx_errors, &nes->tx_errors);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH] net/i40e: fix VF statistics
  2017-06-05 21:14 [PATCH] net/i40e: fix VF statistics Qi Zhang
@ 2017-06-06 14:49 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2017-06-06 14:49 UTC (permalink / raw)
  To: Qi Zhang, jingjing.wu, helin.zhang; +Cc: dev, stable

On 6/5/2017 10:14 PM, Qi Zhang wrote:
> CRC bytes should be excluded, so rx/tx bytes of VF stats is aligned
> with PF stats.
> 
> Fixes: 9aace75fc82e ("i40e: fix statistics")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-06 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 21:14 [PATCH] net/i40e: fix VF statistics Qi Zhang
2017-06-06 14:49 ` [dpdk-stable] " Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.