From: Ajit Khaparde Date: Tue, 22 May 2018 18:13:46 +0000 (-0700) Subject: net/bnxt: fix xstats for VF X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7f799071fe75842e9e76cef98d019c1072cfb649;p=dpdk.git net/bnxt: fix xstats for VF 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 --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 62e02aa8af..6e56bfd367 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -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, diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index ba4ef16760..d6fdc1b88c 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -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); diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c index 0797896a6a..bbd4e78b73 100644 --- a/drivers/net/bnxt/bnxt_stats.c +++ b/drivers/net/bnxt/bnxt_stats.c @@ -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);