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: ff63ebbb67 ("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>
This commit is contained in:
Ajit Khaparde 2017-06-30 09:20:15 -05:00 committed by Ferruh Yigit
parent 84b70ca081
commit 7301ea4ba7
3 changed files with 7 additions and 7 deletions

View 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);

View 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));

View 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,