summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/bnxt_re/qplib_sp.c
diff options
context:
space:
mode:
authorSelvin Xavier <selvin.xavier@broadcom.com>2018-10-08 03:28:00 -0700
committerJason Gunthorpe <jgg@mellanox.com>2018-10-16 00:03:50 -0600
commit316dd2825db1396304fb3003fad6cf1fef1883a0 (patch)
treec1b27c60269d1895b388538d77c51df7bfa1c9b9 /drivers/infiniband/hw/bnxt_re/qplib_sp.c
parent5c80c9138e28f600e185d0f23fca5ea7fe45bd95 (diff)
RDMA/bnxt_re: Report out of sequence hw counters
Expose out of sequence errors received from FW. This counter is a 32 bit counter and driver has to accumulate the counter. Stores the previous value for calculating the difference in the next query. Also, update the HW statistics structure with new fields. Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/qplib_sp.c')
-rw-r--r--drivers/infiniband/hw/bnxt_re/qplib_sp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
index c80f2eaaf1a3..14e2b3c13e5c 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
@@ -840,6 +840,16 @@ int bnxt_qplib_get_roce_stats(struct bnxt_qplib_rcfw *rcfw,
stats->res_srq_load_err = le64_to_cpu(sb->res_srq_load_err);
stats->res_tx_pci_err = le64_to_cpu(sb->res_tx_pci_err);
stats->res_rx_pci_err = le64_to_cpu(sb->res_rx_pci_err);
+ if (!rcfw->init_oos_stats) {
+ rcfw->oos_prev = le64_to_cpu(sb->res_oos_drop_count);
+ rcfw->init_oos_stats = 1;
+ } else {
+ stats->res_oos_drop_count +=
+ (le64_to_cpu(sb->res_oos_drop_count) -
+ rcfw->oos_prev) & BNXT_QPLIB_OOS_COUNT_MASK;
+ rcfw->oos_prev = le64_to_cpu(sb->res_oos_drop_count);
+ }
+
bail:
bnxt_qplib_rcfw_free_sbuf(rcfw, sbuf);
return rc;