|
@@ -3277,6 +3277,7 @@ static int bnxt_hwrm_vnic_cfg(struct bnxt *bp, u16 vnic_id)
|
|
|
unsigned int ring = 0, grp_idx;
|
|
|
struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id];
|
|
|
struct hwrm_vnic_cfg_input req = {0};
|
|
|
+ u16 def_vlan = 0;
|
|
|
|
|
|
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_VNIC_CFG, -1, -1);
|
|
|
/* Only RSS support for now TBD: COS & LB */
|
|
@@ -3297,7 +3298,11 @@ static int bnxt_hwrm_vnic_cfg(struct bnxt *bp, u16 vnic_id)
|
|
|
req.mru = cpu_to_le16(bp->dev->mtu + ETH_HLEN + ETH_FCS_LEN +
|
|
|
VLAN_HLEN);
|
|
|
|
|
|
- if (bp->flags & BNXT_FLAG_STRIP_VLAN)
|
|
|
+#ifdef CONFIG_BNXT_SRIOV
|
|
|
+ if (BNXT_VF(bp))
|
|
|
+ def_vlan = bp->vf.vlan;
|
|
|
+#endif
|
|
|
+ if ((bp->flags & BNXT_FLAG_STRIP_VLAN) || def_vlan)
|
|
|
req.flags |= cpu_to_le32(VNIC_CFG_REQ_FLAGS_VLAN_STRIP_MODE);
|
|
|
|
|
|
return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
|
|
@@ -3836,6 +3841,32 @@ static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static int bnxt_hwrm_func_qcfg(struct bnxt *bp)
|
|
|
+{
|
|
|
+ struct hwrm_func_qcfg_input req = {0};
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_QCFG, -1, -1);
|
|
|
+ req.fid = cpu_to_le16(0xffff);
|
|
|
+ mutex_lock(&bp->hwrm_cmd_lock);
|
|
|
+ rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
|
|
|
+ if (rc)
|
|
|
+ goto func_qcfg_exit;
|
|
|
+
|
|
|
+#ifdef CONFIG_BNXT_SRIOV
|
|
|
+ if (BNXT_VF(bp)) {
|
|
|
+ struct hwrm_func_qcfg_output *resp = bp->hwrm_cmd_resp_addr;
|
|
|
+ struct bnxt_vf_info *vf = &bp->vf;
|
|
|
+
|
|
|
+ vf->vlan = le16_to_cpu(resp->vlan) & VLAN_VID_MASK;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
+func_qcfg_exit:
|
|
|
+ mutex_unlock(&bp->hwrm_cmd_lock);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
int bnxt_hwrm_func_qcaps(struct bnxt *bp)
|
|
|
{
|
|
|
int rc = 0;
|
|
@@ -4230,6 +4261,11 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init)
|
|
|
netdev_warn(bp->dev, "HWRM set coalescing failure rc: %x\n",
|
|
|
rc);
|
|
|
|
|
|
+ if (BNXT_VF(bp)) {
|
|
|
+ bnxt_hwrm_func_qcfg(bp);
|
|
|
+ netdev_update_features(bp->dev);
|
|
|
+ }
|
|
|
+
|
|
|
return 0;
|
|
|
|
|
|
err_out:
|
|
@@ -5469,7 +5505,14 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
|
|
|
features |= NETIF_F_HW_VLAN_CTAG_RX |
|
|
|
NETIF_F_HW_VLAN_STAG_RX;
|
|
|
}
|
|
|
-
|
|
|
+#ifdef CONFIG_BNXT_SRIOV
|
|
|
+ if (BNXT_VF(bp)) {
|
|
|
+ if (bp->vf.vlan) {
|
|
|
+ features &= ~(NETIF_F_HW_VLAN_CTAG_RX |
|
|
|
+ NETIF_F_HW_VLAN_STAG_RX);
|
|
|
+ }
|
|
|
+ }
|
|
|
+#endif
|
|
|
return features;
|
|
|
}
|
|
|
|