[dpdk-dev] [PATCH 3/7] net/bnxt: fix calculation of VNICs

Ajit Khaparde ajit.khaparde at broadcom.com
Thu Jun 29 04:51:38 CEST 2017


We used the default as a work-around for the 4-byte MTU VNICs,
but we filter those out now. So fix the calculation of VNICs
accordingly.

Fixes: ff63ebbb67a7 ("net/bnxt: determine the Rx status of VF")

Signed-off-by: Stephen Hurd <stephen.hurd at broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c    | 10 +++++-----
 drivers/net/bnxt/bnxt_hwrm.h    |  2 +-
 drivers/net/bnxt/rte_pmd_bnxt.c |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 580b2d8..7fb9800 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2740,12 +2740,12 @@ int bnxt_hwrm_port_led_cfg(struct bnxt *bp, bool led_on)
 	return rc;
 }
 
-static void bnxt_vnic_count(struct bnxt_vnic_info *vnic, void *cbdata)
+static void
+bnxt_vnic_count(struct bnxt_vnic_info *vnic __rte_unused, void *cbdata)
 {
 	uint32_t *count = cbdata;
 
-	if (vnic->func_default)
-		*count = *count + 1;
+	*count = *count + 1;
 }
 
 static int bnxt_vnic_count_hwrm_stub(struct bnxt *bp __rte_unused,
@@ -2754,7 +2754,7 @@ static int bnxt_vnic_count_hwrm_stub(struct bnxt *bp __rte_unused,
 	return 0;
 }
 
-int bnxt_vf_default_vnic_count(struct bnxt *bp, uint16_t vf)
+int bnxt_vf_vnic_count(struct bnxt *bp, uint16_t vf)
 {
 	uint32_t count = 0;
 
@@ -2837,7 +2837,7 @@ int bnxt_hwrm_func_vf_vnic_query_and_config(struct bnxt *bp, uint16_t vf,
 		rc = bnxt_hwrm_vnic_qcfg(bp, &vnic, bp->pf.first_vf_id + vf);
 		if (rc)
 			break;
-		if (vnic.mru == 4)	/* Indicates unallocated */
+		if (vnic.mru <= 4)	/* Indicates unallocated */
 			continue;
 
 		vnic_cb(&vnic, cbdata);
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index a603dda..82cca3a 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -145,7 +145,7 @@ int bnxt_hwrm_port_led_qcaps(struct bnxt *bp);
 int bnxt_hwrm_func_cfg_vf_set_flags(struct bnxt *bp, uint16_t vf);
 void vf_vnic_set_rxmask_cb(struct bnxt_vnic_info *vnic, void *flagp);
 int bnxt_set_rx_mask_no_vlan(struct bnxt *bp, struct bnxt_vnic_info *vnic);
-int bnxt_vf_default_vnic_count(struct bnxt *bp, uint16_t vf);
+int bnxt_vf_vnic_count(struct bnxt *bp, uint16_t vf);
 int bnxt_hwrm_func_vf_vnic_query_and_config(struct bnxt *bp, uint16_t vf,
 	void (*vnic_cb)(struct bnxt_vnic_info *, void *), void *cbdata,
 	int (*hwrm_cb)(struct bnxt *bp, struct bnxt_vnic_info *vnic));
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index faeb6f4..1bd5aee 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -610,7 +610,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id)
 		return -ENOTSUP;
 	}
 
-	return bnxt_vf_default_vnic_count(bp, vf_id);
+	return bnxt_vf_vnic_count(bp, vf_id);
 }
 
 int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id,
-- 
2.10.1 (Apple Git-78)



More information about the dev mailing list