net/bnxt: fix calculation of VNICs
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 30 Jun 2017 14:20:15 +0000 (09:20 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 6 Jul 2017 13:00:57 +0000 (15:00 +0200)
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@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_hwrm.h
drivers/net/bnxt/rte_pmd_bnxt.c

index 580b2d8..7fb9800 100644 (file)
@@ -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);
index a603dda..82cca3a 100644 (file)
@@ -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));
index fa11d1c..a561d55 100644 (file)
@@ -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,