RDMA/bnxt_re: Expose rx discards and drop counters
authorSelvin Xavier <selvin.xavier@broadcom.com>
Mon, 8 Oct 2018 10:27:59 +0000 (03:27 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 16 Oct 2018 06:03:50 +0000 (00:03 -0600)
Expose the RoCE discard and drop counters from the HW statistics context

Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/bnxt_re/hw_counters.c
drivers/infiniband/hw/bnxt_re/hw_counters.h

index 77416bc..e63adf2 100644 (file)
@@ -68,6 +68,8 @@ static const char * const bnxt_re_stat_name[] = {
        [BNXT_RE_TX_PKTS]               =  "tx_pkts",
        [BNXT_RE_TX_BYTES]              =  "tx_bytes",
        [BNXT_RE_RECOVERABLE_ERRORS]    =  "recoverable_errors",
+       [BNXT_RE_RX_DROPS]              =  "rx_roce_drops",
+       [BNXT_RE_RX_DISCARDS]           =  "rx_roce_discards",
        [BNXT_RE_TO_RETRANSMITS]        = "to_retransmits",
        [BNXT_RE_SEQ_ERR_NAKS_RCVD]     = "seq_err_naks_rcvd",
        [BNXT_RE_MAX_RETRY_EXCEEDED]    = "max_retry_exceeded",
@@ -128,6 +130,10 @@ int bnxt_re_ib_get_hw_stats(struct ib_device *ibdev,
        if (bnxt_re_stats) {
                stats->value[BNXT_RE_RECOVERABLE_ERRORS] =
                        le64_to_cpu(bnxt_re_stats->tx_bcast_pkts);
+               stats->value[BNXT_RE_RX_DROPS] =
+                       le64_to_cpu(bnxt_re_stats->rx_drop_pkts);
+               stats->value[BNXT_RE_RX_DISCARDS] =
+                       le64_to_cpu(bnxt_re_stats->rx_discard_pkts);
                stats->value[BNXT_RE_RX_PKTS] =
                        le64_to_cpu(bnxt_re_stats->rx_ucast_pkts);
                stats->value[BNXT_RE_RX_BYTES] =
index a01a922..2c8a409 100644 (file)
@@ -51,6 +51,8 @@ enum bnxt_re_hw_stats {
        BNXT_RE_TX_PKTS,
        BNXT_RE_TX_BYTES,
        BNXT_RE_RECOVERABLE_ERRORS,
+       BNXT_RE_RX_DROPS,
+       BNXT_RE_RX_DISCARDS,
        BNXT_RE_TO_RETRANSMITS,
        BNXT_RE_SEQ_ERR_NAKS_RCVD,
        BNXT_RE_MAX_RETRY_EXCEEDED,