[dpdk-dev,v1,1/2] net/i40e: fix incorrect xstats value mapping

Message ID 1479104089-27862-2-git-send-email-remy.horton@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

Remy Horton Nov. 14, 2016, 6:14 a.m. UTC
  The offsets used in rte_i40evf_stats_strings for transmission
statistics were wrong, returning the total byte count rather than
the respective (unicast, multicast, broadcast, drop, & error)
packet counts.

Fixes: da61cd084976 ("i40evf: add extended stats")

Signed-off-by: Remy Horton <remy.horton@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Kevin Traynor Nov. 14, 2016, 5:59 p.m. UTC | #1
On 11/14/2016 06:14 AM, Remy Horton wrote:
> The offsets used in rte_i40evf_stats_strings for transmission
> statistics were wrong, returning the total byte count rather than
> the respective (unicast, multicast, broadcast, drop, & error)
> packet counts.
> 
> Fixes: da61cd084976 ("i40evf: add extended stats")

This should go to the LTS branch also.

Acked-by: Kevin Traynor <ktraynor@redhat.com>

> 
> Signed-off-by: Remy Horton <remy.horton@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index aa306d6..afae2ec 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -176,11 +176,11 @@ static const struct rte_i40evf_xstats_name_off rte_i40evf_stats_strings[] = {
>  	{"rx_unknown_protocol_packets", offsetof(struct i40e_eth_stats,
>  		rx_unknown_protocol)},
>  	{"tx_bytes", offsetof(struct i40e_eth_stats, tx_bytes)},
> -	{"tx_unicast_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
> -	{"tx_multicast_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
> -	{"tx_broadcast_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
> -	{"tx_dropped_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
> -	{"tx_error_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
> +	{"tx_unicast_packets", offsetof(struct i40e_eth_stats, tx_unicast)},
> +	{"tx_multicast_packets", offsetof(struct i40e_eth_stats, tx_multicast)},
> +	{"tx_broadcast_packets", offsetof(struct i40e_eth_stats, tx_broadcast)},
> +	{"tx_dropped_packets", offsetof(struct i40e_eth_stats, tx_discards)},
> +	{"tx_error_packets", offsetof(struct i40e_eth_stats, tx_errors)},
>  };
>  
>  #define I40EVF_NB_XSTATS (sizeof(rte_i40evf_stats_strings) / \
>
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index aa306d6..afae2ec 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -176,11 +176,11 @@  static const struct rte_i40evf_xstats_name_off rte_i40evf_stats_strings[] = {
 	{"rx_unknown_protocol_packets", offsetof(struct i40e_eth_stats,
 		rx_unknown_protocol)},
 	{"tx_bytes", offsetof(struct i40e_eth_stats, tx_bytes)},
-	{"tx_unicast_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
-	{"tx_multicast_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
-	{"tx_broadcast_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
-	{"tx_dropped_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
-	{"tx_error_packets", offsetof(struct i40e_eth_stats, tx_bytes)},
+	{"tx_unicast_packets", offsetof(struct i40e_eth_stats, tx_unicast)},
+	{"tx_multicast_packets", offsetof(struct i40e_eth_stats, tx_multicast)},
+	{"tx_broadcast_packets", offsetof(struct i40e_eth_stats, tx_broadcast)},
+	{"tx_dropped_packets", offsetof(struct i40e_eth_stats, tx_discards)},
+	{"tx_error_packets", offsetof(struct i40e_eth_stats, tx_errors)},
 };
 
 #define I40EVF_NB_XSTATS (sizeof(rte_i40evf_stats_strings) / \