From 7301ea4ba7896fb8e8a543ab80f013dd006559ad Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Fri, 30 Jun 2017 09:20:15 -0500 Subject: [PATCH] net/bnxt: fix calculation of VNICs 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 Signed-off-by: Ajit Khaparde --- 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 580b2d8271..7fb9800c6f 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 a603dda181..82cca3a7c0 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 fa11d1ccd1..a561d55fe1 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.20.1