Commit a0392abe authored by David S. Miller's avatar David S. Miller
Browse files


Jeff Kirsher says:

====================
100GbE Intel Wired LAN Driver Updates 2019-02-22

This series contains updates to the ice driver only.

Bruce adds the __always_unused attribute to a parameter to avoid
compiler warnings when using -Wunused-parameter.  Fixed unnecessary
type-casting and the use of sizeof().  Fix the allocation of structs
that have become memory hogs, so allocate them in heaps and fix all the
associated references.  Fixed the "possible" numeric overflow issues
that were caught with static analysis.

Maciej fixes the maximum MTU calculation by taking into account double
VLAN tagging amd ensure that the operations are done in the correct
order.

Victor fixes the supported node calculation, where we were not taking
into account if there is space to add the new VSI or intermediate node
above that layer, then it is not required to continue the calculation.
Added a check for a leaf node presence for a given VSI, which is needed
before removing a VSI.

Jake fixes an issue where the VSI list is shared, so simply removing a
VSI from the list will cause issues for the other users who reference
the list.  Since we also free the memory, this could lead to
segmentation faults.

Brett fixes an issue where driver unload could cause a system reboot
when intel_iommu=on parameter is set.  The issue is that we are not
clearing the CAUSE_ENA bit for the appropriate control queues register
when freeing the miscellaneous interrupt vector.

Mitch is so kind, he prevented spamming the VF with link messages when
the link status really has not changed.  Updates the driver to use the
absolute vector ID and not the per-PF vector ID for the VF MSIx vector
allocation.

Lukasz fixes the ethtool pause parameter for the ice driver, which was
originally based off the link status but is now based off the PHY
configuration.  This is to resolve an issue where pause parameters could
be set while link was down.

Jesse updates the string that reports statistics so the string does not
get modified at runtime and cause reports of string truncation.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ace4a267 1fa6e138
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ extern const char ice_drv_ver[];
#define ICE_DFLT_NETIF_M (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)

#define ICE_MAX_MTU	(ICE_AQ_SET_MAC_FRAME_SIZE_MAX - \
			 ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN)
			(ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2)))

#define ICE_UP_TABLE_TRANSLATE(val, i) \
		(((val) << ICE_AQ_VSI_UP_TABLE_UP##i##_S) & \
+19 −2
Original line number Diff line number Diff line
@@ -2450,6 +2450,7 @@ ice_aq_dis_lan_txq(struct ice_hw *hw, u8 num_qgrps,
{
	struct ice_aqc_dis_txqs *cmd;
	struct ice_aq_desc desc;
	enum ice_status status;
	u16 i, sz = 0;

	cmd = &desc.params.dis_txqs;
@@ -2485,6 +2486,8 @@ ice_aq_dis_lan_txq(struct ice_hw *hw, u8 num_qgrps,
		break;
	}

	/* flush pipe on time out */
	cmd->cmd_type |= ICE_AQC_Q_DIS_CMD_FLUSH_PIPE;
	/* If no queue group info, we are in a reset flow. Issue the AQ */
	if (!qg_list)
		goto do_aq;
@@ -2510,7 +2513,17 @@ ice_aq_dis_lan_txq(struct ice_hw *hw, u8 num_qgrps,
		return ICE_ERR_PARAM;

do_aq:
	return ice_aq_send_cmd(hw, &desc, qg_list, buf_size, cd);
	status = ice_aq_send_cmd(hw, &desc, qg_list, buf_size, cd);
	if (status) {
		if (!qg_list)
			ice_debug(hw, ICE_DBG_SCHED, "VM%d disable failed %d\n",
				  vmvf_num, hw->adminq.sq_last_status);
		else
			ice_debug(hw, ICE_DBG_SCHED, "disable Q %d failed %d\n",
				  le16_to_cpu(qg_list[0].q_id[0]),
				  hw->adminq.sq_last_status);
	}
	return status;
}

/* End of FW Admin Queue command wrappers */
@@ -2796,8 +2809,12 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,

	/* add the lan q */
	status = ice_aq_add_lan_txq(hw, num_qgrps, buf, buf_size, cd);
	if (status)
	if (status) {
		ice_debug(hw, ICE_DBG_SCHED, "enable Q %d failed %d\n",
			  le16_to_cpu(buf->txqs[0].txq_id),
			  hw->adminq.sq_last_status);
		goto ena_txq_exit;
	}

	node.node_teid = buf->txqs[0].q_teid;
	node.data.elem_type = ICE_AQC_ELEM_TYPE_LEAF;
+73 −59
Original line number Diff line number Diff line
@@ -63,45 +63,45 @@ static const struct ice_stats ice_gstrings_vsi_stats[] = {
 * is queried on the base PF netdev.
 */
static const struct ice_stats ice_gstrings_pf_stats[] = {
	ICE_PF_STAT("tx_bytes", stats.eth.tx_bytes),
	ICE_PF_STAT("rx_bytes", stats.eth.rx_bytes),
	ICE_PF_STAT("tx_unicast", stats.eth.tx_unicast),
	ICE_PF_STAT("rx_unicast", stats.eth.rx_unicast),
	ICE_PF_STAT("tx_multicast", stats.eth.tx_multicast),
	ICE_PF_STAT("rx_multicast", stats.eth.rx_multicast),
	ICE_PF_STAT("tx_broadcast", stats.eth.tx_broadcast),
	ICE_PF_STAT("rx_broadcast", stats.eth.rx_broadcast),
	ICE_PF_STAT("tx_errors", stats.eth.tx_errors),
	ICE_PF_STAT("tx_size_64", stats.tx_size_64),
	ICE_PF_STAT("rx_size_64", stats.rx_size_64),
	ICE_PF_STAT("tx_size_127", stats.tx_size_127),
	ICE_PF_STAT("rx_size_127", stats.rx_size_127),
	ICE_PF_STAT("tx_size_255", stats.tx_size_255),
	ICE_PF_STAT("rx_size_255", stats.rx_size_255),
	ICE_PF_STAT("tx_size_511", stats.tx_size_511),
	ICE_PF_STAT("rx_size_511", stats.rx_size_511),
	ICE_PF_STAT("tx_size_1023", stats.tx_size_1023),
	ICE_PF_STAT("rx_size_1023", stats.rx_size_1023),
	ICE_PF_STAT("tx_size_1522", stats.tx_size_1522),
	ICE_PF_STAT("rx_size_1522", stats.rx_size_1522),
	ICE_PF_STAT("tx_size_big", stats.tx_size_big),
	ICE_PF_STAT("rx_size_big", stats.rx_size_big),
	ICE_PF_STAT("link_xon_tx", stats.link_xon_tx),
	ICE_PF_STAT("link_xon_rx", stats.link_xon_rx),
	ICE_PF_STAT("link_xoff_tx", stats.link_xoff_tx),
	ICE_PF_STAT("link_xoff_rx", stats.link_xoff_rx),
	ICE_PF_STAT("tx_dropped_link_down", stats.tx_dropped_link_down),
	ICE_PF_STAT("rx_undersize", stats.rx_undersize),
	ICE_PF_STAT("rx_fragments", stats.rx_fragments),
	ICE_PF_STAT("rx_oversize", stats.rx_oversize),
	ICE_PF_STAT("rx_jabber", stats.rx_jabber),
	ICE_PF_STAT("rx_csum_bad", hw_csum_rx_error),
	ICE_PF_STAT("rx_length_errors", stats.rx_len_errors),
	ICE_PF_STAT("rx_dropped", stats.eth.rx_discards),
	ICE_PF_STAT("rx_crc_errors", stats.crc_errors),
	ICE_PF_STAT("illegal_bytes", stats.illegal_bytes),
	ICE_PF_STAT("mac_local_faults", stats.mac_local_faults),
	ICE_PF_STAT("mac_remote_faults", stats.mac_remote_faults),
	ICE_PF_STAT("port.tx_bytes", stats.eth.tx_bytes),
	ICE_PF_STAT("port.rx_bytes", stats.eth.rx_bytes),
	ICE_PF_STAT("port.tx_unicast", stats.eth.tx_unicast),
	ICE_PF_STAT("port.rx_unicast", stats.eth.rx_unicast),
	ICE_PF_STAT("port.tx_multicast", stats.eth.tx_multicast),
	ICE_PF_STAT("port.rx_multicast", stats.eth.rx_multicast),
	ICE_PF_STAT("port.tx_broadcast", stats.eth.tx_broadcast),
	ICE_PF_STAT("port.rx_broadcast", stats.eth.rx_broadcast),
	ICE_PF_STAT("port.tx_errors", stats.eth.tx_errors),
	ICE_PF_STAT("port.tx_size_64", stats.tx_size_64),
	ICE_PF_STAT("port.rx_size_64", stats.rx_size_64),
	ICE_PF_STAT("port.tx_size_127", stats.tx_size_127),
	ICE_PF_STAT("port.rx_size_127", stats.rx_size_127),
	ICE_PF_STAT("port.tx_size_255", stats.tx_size_255),
	ICE_PF_STAT("port.rx_size_255", stats.rx_size_255),
	ICE_PF_STAT("port.tx_size_511", stats.tx_size_511),
	ICE_PF_STAT("port.rx_size_511", stats.rx_size_511),
	ICE_PF_STAT("port.tx_size_1023", stats.tx_size_1023),
	ICE_PF_STAT("port.rx_size_1023", stats.rx_size_1023),
	ICE_PF_STAT("port.tx_size_1522", stats.tx_size_1522),
	ICE_PF_STAT("port.rx_size_1522", stats.rx_size_1522),
	ICE_PF_STAT("port.tx_size_big", stats.tx_size_big),
	ICE_PF_STAT("port.rx_size_big", stats.rx_size_big),
	ICE_PF_STAT("port.link_xon_tx", stats.link_xon_tx),
	ICE_PF_STAT("port.link_xon_rx", stats.link_xon_rx),
	ICE_PF_STAT("port.link_xoff_tx", stats.link_xoff_tx),
	ICE_PF_STAT("port.link_xoff_rx", stats.link_xoff_rx),
	ICE_PF_STAT("port.tx_dropped_link_down", stats.tx_dropped_link_down),
	ICE_PF_STAT("port.rx_undersize", stats.rx_undersize),
	ICE_PF_STAT("port.rx_fragments", stats.rx_fragments),
	ICE_PF_STAT("port.rx_oversize", stats.rx_oversize),
	ICE_PF_STAT("port.rx_jabber", stats.rx_jabber),
	ICE_PF_STAT("port.rx_csum_bad", hw_csum_rx_error),
	ICE_PF_STAT("port.rx_length_errors", stats.rx_len_errors),
	ICE_PF_STAT("port.rx_dropped", stats.eth.rx_discards),
	ICE_PF_STAT("port.rx_crc_errors", stats.crc_errors),
	ICE_PF_STAT("port.illegal_bytes", stats.illegal_bytes),
	ICE_PF_STAT("port.mac_local_faults", stats.mac_local_faults),
	ICE_PF_STAT("port.mac_remote_faults", stats.mac_remote_faults),
};

static const u32 ice_regs_dump_list[] = {
@@ -304,7 +304,7 @@ static void ice_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
			return;

		for (i = 0; i < ICE_PF_STATS_LEN; i++) {
			snprintf(p, ETH_GSTRING_LEN, "port.%s",
			snprintf(p, ETH_GSTRING_LEN, "%s",
				 ice_gstrings_pf_stats[i].stat_string);
			p += ETH_GSTRING_LEN;
		}
@@ -1084,7 +1084,7 @@ ice_get_settings_link_up(struct ethtool_link_ksettings *ks,
	 * current PHY type, get what is supported by the NVM and intersect
	 * them to get what is truly supported
	 */
	memset(&cap_ksettings, 0, sizeof(struct ethtool_link_ksettings));
	memset(&cap_ksettings, 0, sizeof(cap_ksettings));
	ice_phy_type_to_ethtool(netdev, &cap_ksettings);
	ethtool_intersect_link_masks(ks, &cap_ksettings);

@@ -1416,7 +1416,7 @@ ice_set_link_ksettings(struct net_device *netdev,
		return -EOPNOTSUPP;

	/* copy the ksettings to copy_ks to avoid modifying the original */
	memcpy(&copy_ks, ks, sizeof(struct ethtool_link_ksettings));
	memcpy(&copy_ks, ks, sizeof(copy_ks));

	/* save autoneg out of ksettings */
	autoneg = copy_ks.base.autoneg;
@@ -1435,7 +1435,7 @@ ice_set_link_ksettings(struct net_device *netdev,
		return -EINVAL;

	/* get our own copy of the bits to check against */
	memset(&safe_ks, 0, sizeof(struct ethtool_link_ksettings));
	memset(&safe_ks, 0, sizeof(safe_ks));
	safe_ks.base.cmd = copy_ks.base.cmd;
	safe_ks.base.link_mode_masks_nwords =
		copy_ks.base.link_mode_masks_nwords;
@@ -1449,8 +1449,7 @@ ice_set_link_ksettings(struct net_device *netdev,
	/* If copy_ks.base and safe_ks.base are not the same now, then they are
	 * trying to set something that we do not support.
	 */
	if (memcmp(&copy_ks.base, &safe_ks.base,
		   sizeof(struct ethtool_link_settings)))
	if (memcmp(&copy_ks.base, &safe_ks.base, sizeof(copy_ks.base)))
		return -EOPNOTSUPP;

	while (test_and_set_bit(__ICE_CFG_BUSY, pf->state)) {
@@ -1474,7 +1473,7 @@ ice_set_link_ksettings(struct net_device *netdev,
	}

	/* Copy abilities to config in case autoneg is not set below */
	memset(&config, 0, sizeof(struct ice_aqc_set_phy_cfg_data));
	memset(&config, 0, sizeof(config));
	config.caps = abilities->caps & ~ICE_AQC_PHY_AN_MODE;
	if (abilities->caps & ICE_AQC_PHY_AN_MODE)
		config.caps |= ICE_AQ_PHY_ENA_AUTO_LINK_UPDT;
@@ -1668,7 +1667,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
		    vsi->tx_rings[0]->count, new_tx_cnt);

	tx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_txq,
				sizeof(struct ice_ring), GFP_KERNEL);
				sizeof(*tx_rings), GFP_KERNEL);
	if (!tx_rings) {
		err = -ENOMEM;
		goto done;
@@ -1700,7 +1699,7 @@ process_rx:
		    vsi->rx_rings[0]->count, new_rx_cnt);

	rx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_rxq,
				sizeof(struct ice_ring), GFP_KERNEL);
				sizeof(*rx_rings), GFP_KERNEL);
	if (!rx_rings) {
		err = -ENOMEM;
		goto done;
@@ -1819,21 +1818,36 @@ static void
ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
{
	struct ice_netdev_priv *np = netdev_priv(netdev);
	struct ice_port_info *pi;
	struct ice_port_info *pi = np->vsi->port_info;
	struct ice_aqc_get_phy_caps_data *pcaps;
	struct ice_vsi *vsi = np->vsi;
	enum ice_status status;

	/* Initialize pause params */
	pause->rx_pause = 0;
	pause->tx_pause = 0;

	pcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*pcaps),
			     GFP_KERNEL);
	if (!pcaps)
		return;

	pi = np->vsi->port_info;
	pause->autoneg =
		((pi->phy.link_info.an_info & ICE_AQ_AN_COMPLETED) ?
	/* Get current phy config */
	status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_SW_CFG, pcaps,
				     NULL);
	if (status)
		goto out;

	pause->autoneg = ((pcaps->caps & ICE_AQC_PHY_AN_MODE) ?
			AUTONEG_ENABLE : AUTONEG_DISABLE);

	if (pi->fc.current_mode == ICE_FC_RX_PAUSE) {
		pause->rx_pause = 1;
	} else if (pi->fc.current_mode == ICE_FC_TX_PAUSE) {
	if (pcaps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE)
		pause->tx_pause = 1;
	} else if (pi->fc.current_mode == ICE_FC_FULL) {
	if (pcaps->caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE)
		pause->rx_pause = 1;
		pause->tx_pause = 1;
	}

out:
	devm_kfree(&vsi->back->pdev->dev, pcaps);
}

/**
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#define PF_FW_ATQLEN_ATQVFE_M			BIT(28)
#define PF_FW_ATQLEN_ATQOVFL_M			BIT(29)
#define PF_FW_ATQLEN_ATQCRIT_M			BIT(30)
#define VF_MBX_ARQLEN(_VF)			(0x0022BC00 + ((_VF) * 4))
#define PF_FW_ATQLEN_ATQENABLE_M		BIT(31)
#define PF_FW_ATQT				0x00080400
#define PF_MBX_ARQBAH				0x0022E400
+70 −42
Original line number Diff line number Diff line
@@ -249,12 +249,12 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi, bool alloc_qvectors)

	/* allocate memory for both Tx and Rx ring pointers */
	vsi->tx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_txq,
				     sizeof(struct ice_ring *), GFP_KERNEL);
				     sizeof(*vsi->tx_rings), GFP_KERNEL);
	if (!vsi->tx_rings)
		goto err_txrings;

	vsi->rx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_rxq,
				     sizeof(struct ice_ring *), GFP_KERNEL);
				     sizeof(*vsi->rx_rings), GFP_KERNEL);
	if (!vsi->rx_rings)
		goto err_rxrings;

@@ -262,7 +262,7 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi, bool alloc_qvectors)
		/* allocate memory for q_vector pointers */
		vsi->q_vectors = devm_kcalloc(&pf->pdev->dev,
					      vsi->num_q_vectors,
					      sizeof(struct ice_q_vector *),
					      sizeof(*vsi->q_vectors),
					      GFP_KERNEL);
		if (!vsi->q_vectors)
			goto err_vectors;
@@ -348,19 +348,25 @@ static int ice_get_free_slot(void *array, int size, int curr)
void ice_vsi_delete(struct ice_vsi *vsi)
{
	struct ice_pf *pf = vsi->back;
	struct ice_vsi_ctx ctxt;
	struct ice_vsi_ctx *ctxt;
	enum ice_status status;

	ctxt = devm_kzalloc(&pf->pdev->dev, sizeof(*ctxt), GFP_KERNEL);
	if (!ctxt)
		return;

	if (vsi->type == ICE_VSI_VF)
		ctxt.vf_num = vsi->vf_id;
	ctxt.vsi_num = vsi->vsi_num;
		ctxt->vf_num = vsi->vf_id;
	ctxt->vsi_num = vsi->vsi_num;

	memcpy(&ctxt.info, &vsi->info, sizeof(struct ice_aqc_vsi_props));
	memcpy(&ctxt->info, &vsi->info, sizeof(ctxt->info));

	status = ice_free_vsi(&pf->hw, vsi->idx, &ctxt, false, NULL);
	status = ice_free_vsi(&pf->hw, vsi->idx, ctxt, false, NULL);
	if (status)
		dev_err(&pf->pdev->dev, "Failed to delete VSI %i in FW\n",
			vsi->vsi_num);

	devm_kfree(&pf->pdev->dev, ctxt);
}

/**
@@ -908,37 +914,41 @@ static void ice_set_rss_vsi_ctx(struct ice_vsi_ctx *ctxt, struct ice_vsi *vsi)
 */
static int ice_vsi_init(struct ice_vsi *vsi)
{
	struct ice_vsi_ctx ctxt = { 0 };
	struct ice_pf *pf = vsi->back;
	struct ice_hw *hw = &pf->hw;
	struct ice_vsi_ctx *ctxt;
	int ret = 0;

	ctxt = devm_kzalloc(&pf->pdev->dev, sizeof(*ctxt), GFP_KERNEL);
	if (!ctxt)
		return -ENOMEM;

	switch (vsi->type) {
	case ICE_VSI_PF:
		ctxt.flags = ICE_AQ_VSI_TYPE_PF;
		ctxt->flags = ICE_AQ_VSI_TYPE_PF;
		break;
	case ICE_VSI_VF:
		ctxt.flags = ICE_AQ_VSI_TYPE_VF;
		ctxt->flags = ICE_AQ_VSI_TYPE_VF;
		/* VF number here is the absolute VF number (0-255) */
		ctxt.vf_num = vsi->vf_id + hw->func_caps.vf_base_id;
		ctxt->vf_num = vsi->vf_id + hw->func_caps.vf_base_id;
		break;
	default:
		return -ENODEV;
	}

	ice_set_dflt_vsi_ctx(&ctxt);
	ice_set_dflt_vsi_ctx(ctxt);
	/* if the switch is in VEB mode, allow VSI loopback */
	if (vsi->vsw->bridge_mode == BRIDGE_MODE_VEB)
		ctxt.info.sw_flags |= ICE_AQ_VSI_SW_FLAG_ALLOW_LB;
		ctxt->info.sw_flags |= ICE_AQ_VSI_SW_FLAG_ALLOW_LB;

	/* Set LUT type and HASH type if RSS is enabled */
	if (test_bit(ICE_FLAG_RSS_ENA, pf->flags))
		ice_set_rss_vsi_ctx(&ctxt, vsi);
		ice_set_rss_vsi_ctx(ctxt, vsi);

	ctxt.info.sw_id = vsi->port_info->sw_id;
	ice_vsi_setup_q_map(vsi, &ctxt);
	ctxt->info.sw_id = vsi->port_info->sw_id;
	ice_vsi_setup_q_map(vsi, ctxt);

	ret = ice_add_vsi(hw, vsi->idx, &ctxt, NULL);
	ret = ice_add_vsi(hw, vsi->idx, ctxt, NULL);
	if (ret) {
		dev_err(&pf->pdev->dev,
			"Add VSI failed, err %d\n", ret);
@@ -946,11 +956,12 @@ static int ice_vsi_init(struct ice_vsi *vsi)
	}

	/* keep context for update VSI operations */
	vsi->info = ctxt.info;
	vsi->info = ctxt->info;

	/* record VSI number returned */
	vsi->vsi_num = ctxt.vsi_num;
	vsi->vsi_num = ctxt->vsi_num;

	devm_kfree(&pf->pdev->dev, ctxt);
	return ret;
}

@@ -1620,7 +1631,7 @@ ice_vsi_cfg_txqs(struct ice_vsi *vsi, struct ice_ring **rings, int offset)
	u16 buf_len, i, pf_q;
	int err = 0, tc;

	buf_len = sizeof(struct ice_aqc_add_tx_qgrp);
	buf_len = sizeof(*qg_buf);
	qg_buf = devm_kzalloc(&pf->pdev->dev, buf_len, GFP_KERNEL);
	if (!qg_buf)
		return -ENOMEM;
@@ -1823,26 +1834,34 @@ int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)
{
	struct device *dev = &vsi->back->pdev->dev;
	struct ice_hw *hw = &vsi->back->hw;
	struct ice_vsi_ctx ctxt = { 0 };
	struct ice_vsi_ctx *ctxt;
	enum ice_status status;
	int ret = 0;

	ctxt = devm_kzalloc(dev, sizeof(*ctxt), GFP_KERNEL);
	if (!ctxt)
		return -ENOMEM;

	/* Here we are configuring the VSI to let the driver add VLAN tags by
	 * setting vlan_flags to ICE_AQ_VSI_VLAN_MODE_ALL. The actual VLAN tag
	 * insertion happens in the Tx hot path, in ice_tx_map.
	 */
	ctxt.info.vlan_flags = ICE_AQ_VSI_VLAN_MODE_ALL;
	ctxt->info.vlan_flags = ICE_AQ_VSI_VLAN_MODE_ALL;

	ctxt.info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);
	ctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);

	status = ice_update_vsi(hw, vsi->idx, &ctxt, NULL);
	status = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
	if (status) {
		dev_err(dev, "update VSI for VLAN insert failed, err %d aq_err %d\n",
			status, hw->adminq.sq_last_status);
		return -EIO;
		ret = -EIO;
		goto out;
	}

	vsi->info.vlan_flags = ctxt.info.vlan_flags;
	return 0;
	vsi->info.vlan_flags = ctxt->info.vlan_flags;
out:
	devm_kfree(dev, ctxt);
	return ret;
}

/**
@@ -1854,35 +1873,42 @@ int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)
{
	struct device *dev = &vsi->back->pdev->dev;
	struct ice_hw *hw = &vsi->back->hw;
	struct ice_vsi_ctx ctxt = { 0 };
	struct ice_vsi_ctx *ctxt;
	enum ice_status status;
	int ret = 0;

	ctxt = devm_kzalloc(dev, sizeof(*ctxt), GFP_KERNEL);
	if (!ctxt)
		return -ENOMEM;

	/* Here we are configuring what the VSI should do with the VLAN tag in
	 * the Rx packet. We can either leave the tag in the packet or put it in
	 * the Rx descriptor.
	 */
	if (ena) {
	if (ena)
		/* Strip VLAN tag from Rx packet and put it in the desc */
		ctxt.info.vlan_flags = ICE_AQ_VSI_VLAN_EMOD_STR_BOTH;
	} else {
		ctxt->info.vlan_flags = ICE_AQ_VSI_VLAN_EMOD_STR_BOTH;
	else
		/* Disable stripping. Leave tag in packet */
		ctxt.info.vlan_flags = ICE_AQ_VSI_VLAN_EMOD_NOTHING;
	}
		ctxt->info.vlan_flags = ICE_AQ_VSI_VLAN_EMOD_NOTHING;

	/* Allow all packets untagged/tagged */
	ctxt.info.vlan_flags |= ICE_AQ_VSI_VLAN_MODE_ALL;
	ctxt->info.vlan_flags |= ICE_AQ_VSI_VLAN_MODE_ALL;

	ctxt.info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);
	ctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);

	status = ice_update_vsi(hw, vsi->idx, &ctxt, NULL);
	status = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
	if (status) {
		dev_err(dev, "update VSI for VLAN strip failed, ena = %d err %d aq_err %d\n",
			ena, status, hw->adminq.sq_last_status);
		return -EIO;
		ret = -EIO;
		goto out;
	}

	vsi->info.vlan_flags = ctxt.info.vlan_flags;
	return 0;
	vsi->info.vlan_flags = ctxt->info.vlan_flags;
out:
	devm_kfree(dev, ctxt);
	return ret;
}

/**
@@ -2492,12 +2518,14 @@ void ice_vsi_dis_irq(struct ice_vsi *vsi)
 */
int ice_vsi_release(struct ice_vsi *vsi)
{
	struct ice_vf *vf = NULL;
	struct ice_pf *pf;
	struct ice_vf *vf;

	if (!vsi->back)
		return -ENODEV;
	pf = vsi->back;

	if (vsi->type == ICE_VSI_VF)
		vf = &pf->vf[vsi->vf_id];
	/* do not unregister and free netdevs while driver is in the reset
	 * recovery pending state. Since reset/rebuild happens through PF
Loading