net/bnxt: fix xstats for VF
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 22 May 2018 18:13:46 +0000 (11:13 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 22 May 2018 22:35:01 +0000 (00:35 +0200)
Query of port stats is permitted for VF interfaces as well.
Fix the code to allow VFs to query port stats.

Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_stats.c

index 62e02aa..6e56bfd 100644 (file)
@@ -3160,7 +3160,7 @@ skip_init:
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return 0;
 
-       if (BNXT_PF(bp) && pci_dev->id.device_id != BROADCOM_DEV_ID_NS2) {
+       if (pci_dev->id.device_id != BROADCOM_DEV_ID_NS2) {
                snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
                         "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
                         pci_dev->addr.bus, pci_dev->addr.devid,
index ba4ef16..d6fdc1b 100644 (file)
@@ -3131,9 +3131,6 @@ int bnxt_hwrm_port_qstats(struct bnxt *bp)
        struct bnxt_pf_info *pf = &bp->pf;
        int rc;
 
-       if (!(bp->flags & BNXT_FLAG_PORT_STATS))
-               return 0;
-
        HWRM_PREP(req, PORT_QSTATS);
 
        req.port_id = rte_cpu_to_le_16(pf->port_id);
index 0797896..bbd4e78 100644 (file)
@@ -266,11 +266,6 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
        unsigned int count, i;
        uint64_t tx_drop_pkts;
 
-       if (!(bp->flags & BNXT_FLAG_PORT_STATS)) {
-               PMD_DRV_LOG(ERR, "xstats not supported for VF\n");
-               return 0;
-       }
-
        bnxt_hwrm_port_qstats(bp);
        bnxt_hwrm_func_qstats_tx_drop(bp, 0xffff, &tx_drop_pkts);