net/bnxt: fix xstats
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Sat, 8 Jun 2019 19:22:06 +0000 (23:22 +0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Jun 2019 15:01:06 +0000 (00:01 +0900)
commita9586abdbcb3178b94570dd0af3646104f1154cd
tree0dd4ff61afd373784df04f5fbf1de03d35e48360
parent905cd45ce30efc9f46ee83a4aa5a4a42935ef70c
net/bnxt: fix xstats

If the HWRM_PORT_QSTATS_EXT fails to initialize
fw_rx_port_stats_ext_size or fw_tx_port_stats_ext_size,
the driver can end up passing junk statistics to the application.

Instead of relying on the application to initialize the xstats
buffer before calling the xstats_get dev_op, memset xstats
with zeros to avoid returning or displaying incorrect statistics.

Also fixed the buffer starting offset.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_stats.c