Skip to content

Commit

Permalink
bnxt_en: Fix VF attributes reporting.
Browse files Browse the repository at this point in the history
The .ndo_get_vf_config() is returning the wrong qos attribute.  Fix
the code that checks and reports the qos and spoofchk attributes.  The
BNXT_VF_QOS and BNXT_VF_LINK_UP flags should not be set by default
during init. time.

Signed-off-by: Michael Chan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Michael Chan authored and davem330 committed Apr 24, 2017
1 parent a82fba8 commit f024905
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ int bnxt_get_vf_config(struct net_device *dev, int vf_id,
ivi->max_tx_rate = vf->max_tx_rate;
ivi->min_tx_rate = vf->min_tx_rate;
ivi->vlan = vf->vlan;
ivi->qos = vf->flags & BNXT_VF_QOS;
ivi->spoofchk = vf->flags & BNXT_VF_SPOOFCHK;
if (vf->flags & BNXT_VF_QOS)
ivi->qos = vf->vlan >> VLAN_PRIO_SHIFT;
else
ivi->qos = 0;
ivi->spoofchk = !!(vf->flags & BNXT_VF_SPOOFCHK);
if (!(vf->flags & BNXT_VF_LINK_FORCED))
ivi->linkstate = IFLA_VF_LINK_STATE_AUTO;
else if (vf->flags & BNXT_VF_LINK_UP)
Expand Down Expand Up @@ -304,7 +307,6 @@ static int bnxt_set_vf_attr(struct bnxt *bp, int num_vfs)
for (i = 0; i < num_vfs; i++) {
vf = &bp->pf.vf[i];
memset(vf, 0, sizeof(*vf));
vf->flags = BNXT_VF_QOS | BNXT_VF_LINK_UP;
}
return 0;
}
Expand Down

0 comments on commit f024905

Please sign in to comment.