net/bnxt: workaround spurious zero stats in Thor
authorSomnath Kotur <somnath.kotur@broadcom.com>
Mon, 31 May 2021 05:53:01 +0000 (11:23 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 8 Jun 2021 21:01:29 +0000 (23:01 +0200)
commit219842b9990c2a3a426c14c7911a44d2cb9b6fdf
treea8037317ed44b748923a69eedab5dca2640e937c
parent03c8f2fe111c2b4c4fddc960dc82253ac7e6c5c5
net/bnxt: workaround spurious zero stats in Thor

There is a HW bug that can result in certain stats being reported as
zero.
Workaround this by ignoring stats with a value of zero based on the
previously stored snapshot of the same stat.
This bug mainly manifests in the output of func_qstats as FW aggregrates
each ring's stat value to give the per function stat and if one of
them is zero, the per function stat value ends up being lower than the
previous snapshot which shows up as a zero PPS value in testpmd.
Eliminate invocation of func_qstats and aggregate the per-ring stat
values in the driver itself to derive the func_qstats output post
accounting for the spurious zero stat value.

Bugzilla ID: 641
Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_hwrm.h
drivers/net/bnxt/bnxt_stats.c