aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-04-03 12:40:50 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-03 12:40:50 -0400
commit5c5e0ad3f9dca572198f3ad6fbf7dc2e647bcf0c (patch)
treefd7f4425db75396da262f4b9de2eb0650708b69f
parente79d8429aac95a5cbe4c235795c7cd554c91f924 (diff)
parent42d255ce43e1dbe28b5907ec276cd88330952661 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2015-04-03 This series contains updates to i40e and i40evf only. Anjali provides a fix for verifying outer UDP receive checksum. Also adds helpful information to display when figuring out the cause of HMC errors. Mitch provides a fix to prevent a malicious or buggy VF driver from sending an invalid index into the VSI array which could panic the host. Cleans up the code where a function was moved, but the message did not follow. Adds protection to the VLAN filter list, same as the MAC filter list, to protect from corruption if the watchdog happens to run at the same time as a VLAN filter is being added/deleted. Jesse changes several memcpy() statements to struct assignments which are type safe and preferable. Fixed a bug when skb allocation fails, where we should not continue using the skb pointer. Also fixed a void function in FCoE which should not be returning anything. Greg fixes both i40e and i40evf to set the Ethernet protocol correctly when transmit VLAN offloads are disabled. Shannon fixes up VLAN messages when ports are added or removed, which were giving bogus index info. Also aligned the message text style with other messages in the driver. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e.h1
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c8
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_fcoe.c3
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c82
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_txrx.c18
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c113
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h2
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_txrx.c43
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c67
9 files changed, 202 insertions, 135 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 1c8bd7c152c2..33c35d3b7420 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -628,6 +628,7 @@ extern const char i40e_driver_name[];
628extern const char i40e_driver_version_str[]; 628extern const char i40e_driver_version_str[];
629void i40e_do_reset_safe(struct i40e_pf *pf, u32 reset_flags); 629void i40e_do_reset_safe(struct i40e_pf *pf, u32 reset_flags);
630void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags); 630void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags);
631struct i40e_vsi *i40e_find_vsi_from_id(struct i40e_pf *pf, u16 id);
631void i40e_update_stats(struct i40e_vsi *vsi); 632void i40e_update_stats(struct i40e_vsi *vsi);
632void i40e_update_eth_stats(struct i40e_vsi *vsi); 633void i40e_update_eth_stats(struct i40e_vsi *vsi);
633struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi); 634struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c
index 400fb28db576..bd5079d5c1b6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c
@@ -178,6 +178,10 @@ void i40e_dcbnl_set_all(struct i40e_vsi *vsi)
178 if (!(pf->flags & I40E_FLAG_DCB_ENABLED)) 178 if (!(pf->flags & I40E_FLAG_DCB_ENABLED))
179 return; 179 return;
180 180
181 /* MFP mode but not an iSCSI PF so return */
182 if ((pf->flags & I40E_FLAG_MFP_ENABLED) && !(pf->hw.func_caps.iscsi))
183 return;
184
181 dcbxcfg = &hw->local_dcbx_config; 185 dcbxcfg = &hw->local_dcbx_config;
182 186
183 /* Set up all the App TLVs if DCBx is negotiated */ 187 /* Set up all the App TLVs if DCBx is negotiated */
@@ -282,6 +286,10 @@ void i40e_dcbnl_flush_apps(struct i40e_pf *pf,
282 struct i40e_dcb_app_priority_table app; 286 struct i40e_dcb_app_priority_table app;
283 int i; 287 int i;
284 288
289 /* MFP mode but not an iSCSI PF so return */
290 if ((pf->flags & I40E_FLAG_MFP_ENABLED) && !(pf->hw.func_caps.iscsi))
291 return;
292
285 for (i = 0; i < old_cfg->numapps; i++) { 293 for (i = 0; i < old_cfg->numapps; i++) {
286 app = old_cfg->app[i]; 294 app = old_cfg->app[i];
287 /* The APP is not available anymore delete it */ 295 /* The APP is not available anymore delete it */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
index 1ca48458e668..1803afeef23e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
@@ -1306,8 +1306,7 @@ static void i40e_fcoe_tx_map(struct i40e_ring *tx_ring,
1306 /* MACLEN is ether header length in words not bytes */ 1306 /* MACLEN is ether header length in words not bytes */
1307 td_offset |= (maclen >> 1) << I40E_TX_DESC_LENGTH_MACLEN_SHIFT; 1307 td_offset |= (maclen >> 1) << I40E_TX_DESC_LENGTH_MACLEN_SHIFT;
1308 1308
1309 return i40e_tx_map(tx_ring, skb, first, tx_flags, hdr_len, 1309 i40e_tx_map(tx_ring, skb, first, tx_flags, hdr_len, td_cmd, td_offset);
1310 td_cmd, td_offset);
1311} 1310}
1312 1311
1313/** 1312/**
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 845bceeda645..63de3f4b7a94 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -38,8 +38,8 @@ static const char i40e_driver_string[] =
38#define DRV_KERN "-k" 38#define DRV_KERN "-k"
39 39
40#define DRV_VERSION_MAJOR 1 40#define DRV_VERSION_MAJOR 1
41#define DRV_VERSION_MINOR 2 41#define DRV_VERSION_MINOR 3
42#define DRV_VERSION_BUILD 43 42#define DRV_VERSION_BUILD 1
43#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ 43#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
44 __stringify(DRV_VERSION_MINOR) "." \ 44 __stringify(DRV_VERSION_MINOR) "." \
45 __stringify(DRV_VERSION_BUILD) DRV_KERN 45 __stringify(DRV_VERSION_BUILD) DRV_KERN
@@ -250,6 +250,22 @@ static int i40e_put_lump(struct i40e_lump_tracking *pile, u16 index, u16 id)
250} 250}
251 251
252/** 252/**
253 * i40e_find_vsi_from_id - searches for the vsi with the given id
254 * @pf - the pf structure to search for the vsi
255 * @id - id of the vsi it is searching for
256 **/
257struct i40e_vsi *i40e_find_vsi_from_id(struct i40e_pf *pf, u16 id)
258{
259 int i;
260
261 for (i = 0; i < pf->num_alloc_vsi; i++)
262 if (pf->vsi[i] && (pf->vsi[i]->id == id))
263 return pf->vsi[i];
264
265 return NULL;
266}
267
268/**
253 * i40e_service_event_schedule - Schedule the service task to wake up 269 * i40e_service_event_schedule - Schedule the service task to wake up
254 * @pf: board private structure 270 * @pf: board private structure
255 * 271 *
@@ -1969,7 +1985,7 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi)
1969 I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH; 1985 I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH;
1970 1986
1971 ctxt.seid = vsi->seid; 1987 ctxt.seid = vsi->seid;
1972 memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); 1988 ctxt.info = vsi->info;
1973 ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); 1989 ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
1974 if (ret) { 1990 if (ret) {
1975 dev_info(&vsi->back->pdev->dev, 1991 dev_info(&vsi->back->pdev->dev,
@@ -1998,7 +2014,7 @@ void i40e_vlan_stripping_disable(struct i40e_vsi *vsi)
1998 I40E_AQ_VSI_PVLAN_EMOD_NOTHING; 2014 I40E_AQ_VSI_PVLAN_EMOD_NOTHING;
1999 2015
2000 ctxt.seid = vsi->seid; 2016 ctxt.seid = vsi->seid;
2001 memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); 2017 ctxt.info = vsi->info;
2002 ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); 2018 ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
2003 if (ret) { 2019 if (ret) {
2004 dev_info(&vsi->back->pdev->dev, 2020 dev_info(&vsi->back->pdev->dev,
@@ -2282,7 +2298,7 @@ int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid)
2282 I40E_AQ_VSI_PVLAN_EMOD_STR; 2298 I40E_AQ_VSI_PVLAN_EMOD_STR;
2283 2299
2284 ctxt.seid = vsi->seid; 2300 ctxt.seid = vsi->seid;
2285 memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); 2301 ctxt.info = vsi->info;
2286 aq_ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); 2302 aq_ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
2287 if (aq_ret) { 2303 if (aq_ret) {
2288 dev_info(&vsi->back->pdev->dev, 2304 dev_info(&vsi->back->pdev->dev,
@@ -3197,6 +3213,9 @@ static irqreturn_t i40e_intr(int irq, void *data)
3197 if (icr0 & I40E_PFINT_ICR0_HMC_ERR_MASK) { 3213 if (icr0 & I40E_PFINT_ICR0_HMC_ERR_MASK) {
3198 icr0 &= ~I40E_PFINT_ICR0_HMC_ERR_MASK; 3214 icr0 &= ~I40E_PFINT_ICR0_HMC_ERR_MASK;
3199 dev_info(&pf->pdev->dev, "HMC error interrupt\n"); 3215 dev_info(&pf->pdev->dev, "HMC error interrupt\n");
3216 dev_info(&pf->pdev->dev, "HMC error info 0x%x, HMC error data 0x%x\n",
3217 rd32(hw, I40E_PFHMC_ERRORINFO),
3218 rd32(hw, I40E_PFHMC_ERRORDATA));
3200 } 3219 }
3201 3220
3202 if (icr0 & I40E_PFINT_ICR0_TIMESYNC_MASK) { 3221 if (icr0 & I40E_PFINT_ICR0_TIMESYNC_MASK) {
@@ -4392,7 +4411,7 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
4392 ctxt.pf_num = vsi->back->hw.pf_id; 4411 ctxt.pf_num = vsi->back->hw.pf_id;
4393 ctxt.vf_num = 0; 4412 ctxt.vf_num = 0;
4394 ctxt.uplink_seid = vsi->uplink_seid; 4413 ctxt.uplink_seid = vsi->uplink_seid;
4395 memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); 4414 ctxt.info = vsi->info;
4396 i40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, false); 4415 i40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, false);
4397 4416
4398 /* Update the VSI after updating the VSI queue-mapping information */ 4417 /* Update the VSI after updating the VSI queue-mapping information */
@@ -5220,9 +5239,8 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
5220 goto exit; 5239 goto exit;
5221 } 5240 }
5222 5241
5223 memset(&tmp_dcbx_cfg, 0, sizeof(tmp_dcbx_cfg));
5224 /* Store the old configuration */ 5242 /* Store the old configuration */
5225 memcpy(&tmp_dcbx_cfg, &hw->local_dcbx_config, sizeof(tmp_dcbx_cfg)); 5243 tmp_dcbx_cfg = hw->local_dcbx_config;
5226 5244
5227 /* Reset the old DCBx configuration data */ 5245 /* Reset the old DCBx configuration data */
5228 memset(&hw->local_dcbx_config, 0, sizeof(hw->local_dcbx_config)); 5246 memset(&hw->local_dcbx_config, 0, sizeof(hw->local_dcbx_config));
@@ -5782,11 +5800,9 @@ static void i40e_handle_link_event(struct i40e_pf *pf,
5782 struct i40e_hw *hw = &pf->hw; 5800 struct i40e_hw *hw = &pf->hw;
5783 struct i40e_aqc_get_link_status *status = 5801 struct i40e_aqc_get_link_status *status =
5784 (struct i40e_aqc_get_link_status *)&e->desc.params.raw; 5802 (struct i40e_aqc_get_link_status *)&e->desc.params.raw;
5785 struct i40e_link_status *hw_link_info = &hw->phy.link_info;
5786 5803
5787 /* save off old link status information */ 5804 /* save off old link status information */
5788 memcpy(&pf->hw.phy.link_info_old, hw_link_info, 5805 hw->phy.link_info_old = hw->phy.link_info;
5789 sizeof(pf->hw.phy.link_info_old));
5790 5806
5791 /* Do a new status request to re-enable LSE reporting 5807 /* Do a new status request to re-enable LSE reporting
5792 * and load new status information into the hw struct 5808 * and load new status information into the hw struct
@@ -6608,7 +6624,6 @@ static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
6608{ 6624{
6609 struct i40e_hw *hw = &pf->hw; 6625 struct i40e_hw *hw = &pf->hw;
6610 i40e_status ret; 6626 i40e_status ret;
6611 u8 filter_index;
6612 __be16 port; 6627 __be16 port;
6613 int i; 6628 int i;
6614 6629
@@ -6621,22 +6636,20 @@ static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
6621 if (pf->pending_vxlan_bitmap & (1 << i)) { 6636 if (pf->pending_vxlan_bitmap & (1 << i)) {
6622 pf->pending_vxlan_bitmap &= ~(1 << i); 6637 pf->pending_vxlan_bitmap &= ~(1 << i);
6623 port = pf->vxlan_ports[i]; 6638 port = pf->vxlan_ports[i];
6624 ret = port ? 6639 if (port)
6625 i40e_aq_add_udp_tunnel(hw, ntohs(port), 6640 ret = i40e_aq_add_udp_tunnel(hw, ntohs(port),
6626 I40E_AQC_TUNNEL_TYPE_VXLAN, 6641 I40E_AQC_TUNNEL_TYPE_VXLAN,
6627 &filter_index, NULL) 6642 NULL, NULL);
6628 : i40e_aq_del_udp_tunnel(hw, i, NULL); 6643 else
6644 ret = i40e_aq_del_udp_tunnel(hw, i, NULL);
6629 6645
6630 if (ret) { 6646 if (ret) {
6631 dev_info(&pf->pdev->dev, "Failed to execute AQ command for %s port %d with index %d\n", 6647 dev_info(&pf->pdev->dev,
6632 port ? "adding" : "deleting", 6648 "%s vxlan port %d, index %d failed, err %d, aq_err %d\n",
6633 ntohs(port), port ? i : i); 6649 port ? "add" : "delete",
6634 6650 ntohs(port), i, ret,
6651 pf->hw.aq.asq_last_status);
6635 pf->vxlan_ports[i] = 0; 6652 pf->vxlan_ports[i] = 0;
6636 } else {
6637 dev_info(&pf->pdev->dev, "%s port %d with AQ command with index %d\n",
6638 port ? "Added" : "Deleted",
6639 ntohs(port), port ? i : filter_index);
6640 } 6653 }
6641 } 6654 }
6642 } 6655 }
@@ -7829,7 +7842,8 @@ static void i40e_add_vxlan_port(struct net_device *netdev,
7829 7842
7830 /* Check if port already exists */ 7843 /* Check if port already exists */
7831 if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) { 7844 if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
7832 netdev_info(netdev, "Port %d already offloaded\n", ntohs(port)); 7845 netdev_info(netdev, "vxlan port %d already offloaded\n",
7846 ntohs(port));
7833 return; 7847 return;
7834 } 7848 }
7835 7849
@@ -7837,7 +7851,7 @@ static void i40e_add_vxlan_port(struct net_device *netdev,
7837 next_idx = i40e_get_vxlan_port_idx(pf, 0); 7851 next_idx = i40e_get_vxlan_port_idx(pf, 0);
7838 7852
7839 if (next_idx == I40E_MAX_PF_UDP_OFFLOAD_PORTS) { 7853 if (next_idx == I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
7840 netdev_info(netdev, "Maximum number of UDP ports reached, not adding port %d\n", 7854 netdev_info(netdev, "maximum number of vxlan UDP ports reached, not adding port %d\n",
7841 ntohs(port)); 7855 ntohs(port));
7842 return; 7856 return;
7843 } 7857 }
@@ -7845,8 +7859,9 @@ static void i40e_add_vxlan_port(struct net_device *netdev,
7845 /* New port: add it and mark its index in the bitmap */ 7859 /* New port: add it and mark its index in the bitmap */
7846 pf->vxlan_ports[next_idx] = port; 7860 pf->vxlan_ports[next_idx] = port;
7847 pf->pending_vxlan_bitmap |= (1 << next_idx); 7861 pf->pending_vxlan_bitmap |= (1 << next_idx);
7848
7849 pf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC; 7862 pf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC;
7863
7864 dev_info(&pf->pdev->dev, "adding vxlan port %d\n", ntohs(port));
7850} 7865}
7851 7866
7852/** 7867/**
@@ -7874,12 +7889,13 @@ static void i40e_del_vxlan_port(struct net_device *netdev,
7874 * and make it pending 7889 * and make it pending
7875 */ 7890 */
7876 pf->vxlan_ports[idx] = 0; 7891 pf->vxlan_ports[idx] = 0;
7877
7878 pf->pending_vxlan_bitmap |= (1 << idx); 7892 pf->pending_vxlan_bitmap |= (1 << idx);
7879
7880 pf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC; 7893 pf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC;
7894
7895 dev_info(&pf->pdev->dev, "deleting vxlan port %d\n",
7896 ntohs(port));
7881 } else { 7897 } else {
7882 netdev_warn(netdev, "Port %d was not found, not deleting\n", 7898 netdev_warn(netdev, "vxlan port %d was not found, not deleting\n",
7883 ntohs(port)); 7899 ntohs(port));
7884 } 7900 }
7885} 7901}
@@ -8269,7 +8285,7 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
8269 ret, pf->hw.aq.asq_last_status); 8285 ret, pf->hw.aq.asq_last_status);
8270 return -ENOENT; 8286 return -ENOENT;
8271 } 8287 }
8272 memcpy(&vsi->info, &ctxt.info, sizeof(ctxt.info)); 8288 vsi->info = ctxt.info;
8273 vsi->info.valid_sections = 0; 8289 vsi->info.valid_sections = 0;
8274 8290
8275 vsi->seid = ctxt.seid; 8291 vsi->seid = ctxt.seid;
@@ -8403,7 +8419,7 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
8403 ret = -ENOENT; 8419 ret = -ENOENT;
8404 goto err; 8420 goto err;
8405 } 8421 }
8406 memcpy(&vsi->info, &ctxt.info, sizeof(ctxt.info)); 8422 vsi->info = ctxt.info;
8407 vsi->info.valid_sections = 0; 8423 vsi->info.valid_sections = 0;
8408 vsi->seid = ctxt.seid; 8424 vsi->seid = ctxt.seid;
8409 vsi->id = ctxt.vsi_number; 8425 vsi->id = ctxt.vsi_number;
@@ -10210,6 +10226,8 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)
10210 set_bit(__I40E_DOWN, &pf->state); 10226 set_bit(__I40E_DOWN, &pf->state);
10211 del_timer_sync(&pf->service_timer); 10227 del_timer_sync(&pf->service_timer);
10212 cancel_work_sync(&pf->service_task); 10228 cancel_work_sync(&pf->service_task);
10229 i40e_fdir_teardown(pf);
10230
10213 rtnl_lock(); 10231 rtnl_lock();
10214 i40e_prep_for_reset(pf); 10232 i40e_prep_for_reset(pf);
10215 rtnl_unlock(); 10233 rtnl_unlock();
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 9b11f2e7e361..d8989f9d1798 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1565,8 +1565,11 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, int budget)
1565 if (likely(!skb)) { 1565 if (likely(!skb)) {
1566 skb = netdev_alloc_skb_ip_align(rx_ring->netdev, 1566 skb = netdev_alloc_skb_ip_align(rx_ring->netdev,
1567 rx_ring->rx_hdr_len); 1567 rx_ring->rx_hdr_len);
1568 if (!skb) 1568 if (!skb) {
1569 rx_ring->rx_stats.alloc_buff_failed++; 1569 rx_ring->rx_stats.alloc_buff_failed++;
1570 break;
1571 }
1572
1570 /* initialize queue mapping */ 1573 /* initialize queue mapping */
1571 skb_record_rx_queue(skb, rx_ring->queue_index); 1574 skb_record_rx_queue(skb, rx_ring->queue_index);
1572 /* we are reusing so sync this buffer for CPU use */ 1575 /* we are reusing so sync this buffer for CPU use */
@@ -2054,6 +2057,19 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb,
2054 __be16 protocol = skb->protocol; 2057 __be16 protocol = skb->protocol;
2055 u32 tx_flags = 0; 2058 u32 tx_flags = 0;
2056 2059
2060 if (protocol == htons(ETH_P_8021Q) &&
2061 !(tx_ring->netdev->features & NETIF_F_HW_VLAN_CTAG_TX)) {
2062 /* When HW VLAN acceleration is turned off by the user the
2063 * stack sets the protocol to 8021q so that the driver
2064 * can take any steps required to support the SW only
2065 * VLAN handling. In our case the driver doesn't need
2066 * to take any further steps so just set the protocol
2067 * to the encapsulated ethertype.
2068 */
2069 skb->protocol = vlan_get_protocol(skb);
2070 goto out;
2071 }
2072
2057 /* if we have a HW VLAN tag being added, default to the HW one */ 2073 /* if we have a HW VLAN tag being added, default to the HW one */
2058 if (skb_vlan_tag_present(skb)) { 2074 if (skb_vlan_tag_present(skb)) {
2059 tx_flags |= skb_vlan_tag_get(skb) << I40E_TX_FLAGS_VLAN_SHIFT; 2075 tx_flags |= skb_vlan_tag_get(skb) << I40E_TX_FLAGS_VLAN_SHIFT;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 0a93684130b9..4d69e1f04901 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -53,11 +53,12 @@ static inline void i40e_vc_disable_vf(struct i40e_pf *pf, struct i40e_vf *vf)
53 * 53 *
54 * check for the valid VSI id 54 * check for the valid VSI id
55 **/ 55 **/
56static inline bool i40e_vc_isvalid_vsi_id(struct i40e_vf *vf, u8 vsi_id) 56static inline bool i40e_vc_isvalid_vsi_id(struct i40e_vf *vf, u16 vsi_id)
57{ 57{
58 struct i40e_pf *pf = vf->pf; 58 struct i40e_pf *pf = vf->pf;
59 struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id);
59 60
60 return pf->vsi[vsi_id]->vf_id == vf->vf_id; 61 return (vsi && (vsi->vf_id == vf->vf_id));
61} 62}
62 63
63/** 64/**
@@ -68,12 +69,13 @@ static inline bool i40e_vc_isvalid_vsi_id(struct i40e_vf *vf, u8 vsi_id)
68 * 69 *
69 * check for the valid queue id 70 * check for the valid queue id
70 **/ 71 **/
71static inline bool i40e_vc_isvalid_queue_id(struct i40e_vf *vf, u8 vsi_id, 72static inline bool i40e_vc_isvalid_queue_id(struct i40e_vf *vf, u16 vsi_id,
72 u8 qid) 73 u8 qid)
73{ 74{
74 struct i40e_pf *pf = vf->pf; 75 struct i40e_pf *pf = vf->pf;
76 struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id);
75 77
76 return qid < pf->vsi[vsi_id]->alloc_queue_pairs; 78 return (vsi && (qid < vsi->alloc_queue_pairs));
77} 79}
78 80
79/** 81/**
@@ -95,18 +97,21 @@ static inline bool i40e_vc_isvalid_vector_id(struct i40e_vf *vf, u8 vector_id)
95/** 97/**
96 * i40e_vc_get_pf_queue_id 98 * i40e_vc_get_pf_queue_id
97 * @vf: pointer to the VF info 99 * @vf: pointer to the VF info
98 * @vsi_idx: index of VSI in PF struct 100 * @vsi_id: id of VSI as provided by the FW
99 * @vsi_queue_id: vsi relative queue id 101 * @vsi_queue_id: vsi relative queue id
100 * 102 *
101 * return PF relative queue id 103 * return PF relative queue id
102 **/ 104 **/
103static u16 i40e_vc_get_pf_queue_id(struct i40e_vf *vf, u8 vsi_idx, 105static u16 i40e_vc_get_pf_queue_id(struct i40e_vf *vf, u16 vsi_id,
104 u8 vsi_queue_id) 106 u8 vsi_queue_id)
105{ 107{
106 struct i40e_pf *pf = vf->pf; 108 struct i40e_pf *pf = vf->pf;
107 struct i40e_vsi *vsi = pf->vsi[vsi_idx]; 109 struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id);
108 u16 pf_queue_id = I40E_QUEUE_END_OF_LIST; 110 u16 pf_queue_id = I40E_QUEUE_END_OF_LIST;
109 111
112 if (!vsi)
113 return pf_queue_id;
114
110 if (le16_to_cpu(vsi->info.mapping_flags) & 115 if (le16_to_cpu(vsi->info.mapping_flags) &
111 I40E_AQ_VSI_QUE_MAP_NONCONTIG) 116 I40E_AQ_VSI_QUE_MAP_NONCONTIG)
112 pf_queue_id = 117 pf_queue_id =
@@ -121,12 +126,12 @@ static u16 i40e_vc_get_pf_queue_id(struct i40e_vf *vf, u8 vsi_idx,
121/** 126/**
122 * i40e_config_irq_link_list 127 * i40e_config_irq_link_list
123 * @vf: pointer to the VF info 128 * @vf: pointer to the VF info
124 * @vsi_idx: index of VSI in PF struct 129 * @vsi_id: id of VSI as given by the FW
125 * @vecmap: irq map info 130 * @vecmap: irq map info
126 * 131 *
127 * configure irq link list from the map 132 * configure irq link list from the map
128 **/ 133 **/
129static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_idx, 134static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,
130 struct i40e_virtchnl_vector_map *vecmap) 135 struct i40e_virtchnl_vector_map *vecmap)
131{ 136{
132 unsigned long linklistmap = 0, tempmap; 137 unsigned long linklistmap = 0, tempmap;
@@ -171,7 +176,7 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_idx,
171 I40E_VIRTCHNL_SUPPORTED_QTYPES)); 176 I40E_VIRTCHNL_SUPPORTED_QTYPES));
172 vsi_queue_id = next_q/I40E_VIRTCHNL_SUPPORTED_QTYPES; 177 vsi_queue_id = next_q/I40E_VIRTCHNL_SUPPORTED_QTYPES;
173 qtype = next_q%I40E_VIRTCHNL_SUPPORTED_QTYPES; 178 qtype = next_q%I40E_VIRTCHNL_SUPPORTED_QTYPES;
174 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_idx, vsi_queue_id); 179 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id, vsi_queue_id);
175 reg = ((qtype << I40E_VPINT_LNKLSTN_FIRSTQ_TYPE_SHIFT) | pf_queue_id); 180 reg = ((qtype << I40E_VPINT_LNKLSTN_FIRSTQ_TYPE_SHIFT) | pf_queue_id);
176 181
177 wr32(hw, reg_idx, reg); 182 wr32(hw, reg_idx, reg);
@@ -198,7 +203,7 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_idx,
198 (I40E_MAX_VSI_QP * I40E_VIRTCHNL_SUPPORTED_QTYPES)) { 203 (I40E_MAX_VSI_QP * I40E_VIRTCHNL_SUPPORTED_QTYPES)) {
199 vsi_queue_id = next_q / I40E_VIRTCHNL_SUPPORTED_QTYPES; 204 vsi_queue_id = next_q / I40E_VIRTCHNL_SUPPORTED_QTYPES;
200 qtype = next_q % I40E_VIRTCHNL_SUPPORTED_QTYPES; 205 qtype = next_q % I40E_VIRTCHNL_SUPPORTED_QTYPES;
201 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_idx, 206 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id,
202 vsi_queue_id); 207 vsi_queue_id);
203 } else { 208 } else {
204 pf_queue_id = I40E_QUEUE_END_OF_LIST; 209 pf_queue_id = I40E_QUEUE_END_OF_LIST;
@@ -221,24 +226,26 @@ irq_list_done:
221/** 226/**
222 * i40e_config_vsi_tx_queue 227 * i40e_config_vsi_tx_queue
223 * @vf: pointer to the VF info 228 * @vf: pointer to the VF info
224 * @vsi_idx: index of VSI in PF struct 229 * @vsi_id: id of VSI as provided by the FW
225 * @vsi_queue_id: vsi relative queue index 230 * @vsi_queue_id: vsi relative queue index
226 * @info: config. info 231 * @info: config. info
227 * 232 *
228 * configure tx queue 233 * configure tx queue
229 **/ 234 **/
230static int i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_idx, 235static int i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_id,
231 u16 vsi_queue_id, 236 u16 vsi_queue_id,
232 struct i40e_virtchnl_txq_info *info) 237 struct i40e_virtchnl_txq_info *info)
233{ 238{
234 struct i40e_pf *pf = vf->pf; 239 struct i40e_pf *pf = vf->pf;
235 struct i40e_hw *hw = &pf->hw; 240 struct i40e_hw *hw = &pf->hw;
236 struct i40e_hmc_obj_txq tx_ctx; 241 struct i40e_hmc_obj_txq tx_ctx;
242 struct i40e_vsi *vsi;
237 u16 pf_queue_id; 243 u16 pf_queue_id;
238 u32 qtx_ctl; 244 u32 qtx_ctl;
239 int ret = 0; 245 int ret = 0;
240 246
241 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_idx, vsi_queue_id); 247 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id, vsi_queue_id);
248 vsi = i40e_find_vsi_from_id(pf, vsi_id);
242 249
243 /* clear the context structure first */ 250 /* clear the context structure first */
244 memset(&tx_ctx, 0, sizeof(struct i40e_hmc_obj_txq)); 251 memset(&tx_ctx, 0, sizeof(struct i40e_hmc_obj_txq));
@@ -246,7 +253,7 @@ static int i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_idx,
246 /* only set the required fields */ 253 /* only set the required fields */
247 tx_ctx.base = info->dma_ring_addr / 128; 254 tx_ctx.base = info->dma_ring_addr / 128;
248 tx_ctx.qlen = info->ring_len; 255 tx_ctx.qlen = info->ring_len;
249 tx_ctx.rdylist = le16_to_cpu(pf->vsi[vsi_idx]->info.qs_handle[0]); 256 tx_ctx.rdylist = le16_to_cpu(vsi->info.qs_handle[0]);
250 tx_ctx.rdylist_act = 0; 257 tx_ctx.rdylist_act = 0;
251 tx_ctx.head_wb_ena = info->headwb_enabled; 258 tx_ctx.head_wb_ena = info->headwb_enabled;
252 tx_ctx.head_wb_addr = info->dma_headwb_addr; 259 tx_ctx.head_wb_addr = info->dma_headwb_addr;
@@ -288,13 +295,13 @@ error_context:
288/** 295/**
289 * i40e_config_vsi_rx_queue 296 * i40e_config_vsi_rx_queue
290 * @vf: pointer to the VF info 297 * @vf: pointer to the VF info
291 * @vsi_idx: index of VSI in PF struct 298 * @vsi_id: id of VSI as provided by the FW
292 * @vsi_queue_id: vsi relative queue index 299 * @vsi_queue_id: vsi relative queue index
293 * @info: config. info 300 * @info: config. info
294 * 301 *
295 * configure rx queue 302 * configure rx queue
296 **/ 303 **/
297static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_idx, 304static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_id,
298 u16 vsi_queue_id, 305 u16 vsi_queue_id,
299 struct i40e_virtchnl_rxq_info *info) 306 struct i40e_virtchnl_rxq_info *info)
300{ 307{
@@ -304,7 +311,7 @@ static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_idx,
304 u16 pf_queue_id; 311 u16 pf_queue_id;
305 int ret = 0; 312 int ret = 0;
306 313
307 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_idx, vsi_queue_id); 314 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id, vsi_queue_id);
308 315
309 /* clear the context structure first */ 316 /* clear the context structure first */
310 memset(&rx_ctx, 0, sizeof(struct i40e_hmc_obj_rxq)); 317 memset(&rx_ctx, 0, sizeof(struct i40e_hmc_obj_rxq));
@@ -401,7 +408,7 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type)
401 } 408 }
402 if (type == I40E_VSI_SRIOV) { 409 if (type == I40E_VSI_SRIOV) {
403 u8 brdcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 410 u8 brdcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
404 vf->lan_vsi_index = vsi->idx; 411 vf->lan_vsi_idx = vsi->idx;
405 vf->lan_vsi_id = vsi->id; 412 vf->lan_vsi_id = vsi->id;
406 /* If the port VLAN has been configured and then the 413 /* If the port VLAN has been configured and then the
407 * VF driver was removed then the VSI port VLAN 414 * VF driver was removed then the VSI port VLAN
@@ -466,8 +473,8 @@ static void i40e_enable_vf_mappings(struct i40e_vf *vf)
466 wr32(hw, I40E_VPLAN_MAPENA(vf->vf_id), reg); 473 wr32(hw, I40E_VPLAN_MAPENA(vf->vf_id), reg);
467 474
468 /* map PF queues to VF queues */ 475 /* map PF queues to VF queues */
469 for (j = 0; j < pf->vsi[vf->lan_vsi_index]->alloc_queue_pairs; j++) { 476 for (j = 0; j < pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; j++) {
470 u16 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_index, j); 477 u16 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_id, j);
471 reg = (qid & I40E_VPLAN_QTABLE_QINDEX_MASK); 478 reg = (qid & I40E_VPLAN_QTABLE_QINDEX_MASK);
472 wr32(hw, I40E_VPLAN_QTABLE(total_queue_pairs, vf->vf_id), reg); 479 wr32(hw, I40E_VPLAN_QTABLE(total_queue_pairs, vf->vf_id), reg);
473 total_queue_pairs++; 480 total_queue_pairs++;
@@ -475,13 +482,13 @@ static void i40e_enable_vf_mappings(struct i40e_vf *vf)
475 482
476 /* map PF queues to VSI */ 483 /* map PF queues to VSI */
477 for (j = 0; j < 7; j++) { 484 for (j = 0; j < 7; j++) {
478 if (j * 2 >= pf->vsi[vf->lan_vsi_index]->alloc_queue_pairs) { 485 if (j * 2 >= pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs) {
479 reg = 0x07FF07FF; /* unused */ 486 reg = 0x07FF07FF; /* unused */
480 } else { 487 } else {
481 u16 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_index, 488 u16 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_id,
482 j * 2); 489 j * 2);
483 reg = qid; 490 reg = qid;
484 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_index, 491 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_id,
485 (j * 2) + 1); 492 (j * 2) + 1);
486 reg |= qid << 16; 493 reg |= qid << 16;
487 } 494 }
@@ -525,9 +532,9 @@ static void i40e_free_vf_res(struct i40e_vf *vf)
525 int i, msix_vf; 532 int i, msix_vf;
526 533
527 /* free vsi & disconnect it from the parent uplink */ 534 /* free vsi & disconnect it from the parent uplink */
528 if (vf->lan_vsi_index) { 535 if (vf->lan_vsi_idx) {
529 i40e_vsi_release(pf->vsi[vf->lan_vsi_index]); 536 i40e_vsi_release(pf->vsi[vf->lan_vsi_idx]);
530 vf->lan_vsi_index = 0; 537 vf->lan_vsi_idx = 0;
531 vf->lan_vsi_id = 0; 538 vf->lan_vsi_id = 0;
532 } 539 }
533 msix_vf = pf->hw.func_caps.num_msix_vectors_vf; 540 msix_vf = pf->hw.func_caps.num_msix_vectors_vf;
@@ -582,7 +589,7 @@ static int i40e_alloc_vf_res(struct i40e_vf *vf)
582 ret = i40e_alloc_vsi_res(vf, I40E_VSI_SRIOV); 589 ret = i40e_alloc_vsi_res(vf, I40E_VSI_SRIOV);
583 if (ret) 590 if (ret)
584 goto error_alloc; 591 goto error_alloc;
585 total_queue_pairs += pf->vsi[vf->lan_vsi_index]->alloc_queue_pairs; 592 total_queue_pairs += pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs;
586 set_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps); 593 set_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
587 594
588 /* store the total qps number for the runtime 595 /* store the total qps number for the runtime
@@ -692,10 +699,10 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
692 wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg); 699 wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg);
693 700
694 /* On initial reset, we won't have any queues */ 701 /* On initial reset, we won't have any queues */
695 if (vf->lan_vsi_index == 0) 702 if (vf->lan_vsi_idx == 0)
696 goto complete_reset; 703 goto complete_reset;
697 704
698 i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_index], false); 705 i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_idx], false);
699complete_reset: 706complete_reset:
700 /* reallocate VF resources to reset the VSI state */ 707 /* reallocate VF resources to reset the VSI state */
701 i40e_free_vf_res(vf); 708 i40e_free_vf_res(vf);
@@ -732,6 +739,8 @@ void i40e_free_vfs(struct i40e_pf *pf)
732 */ 739 */
733 if (!pci_vfs_assigned(pf->pdev)) 740 if (!pci_vfs_assigned(pf->pdev))
734 pci_disable_sriov(pf->pdev); 741 pci_disable_sriov(pf->pdev);
742 else
743 dev_warn(&pf->pdev->dev, "VFs are assigned - not disabling SR-IOV\n");
735 744
736 msleep(20); /* let any messages in transit get finished up */ 745 msleep(20); /* let any messages in transit get finished up */
737 746
@@ -761,9 +770,6 @@ void i40e_free_vfs(struct i40e_pf *pf)
761 bit_idx = (hw->func_caps.vf_base_id + vf_id) % 32; 770 bit_idx = (hw->func_caps.vf_base_id + vf_id) % 32;
762 wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), (1 << bit_idx)); 771 wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), (1 << bit_idx));
763 } 772 }
764 } else {
765 dev_warn(&pf->pdev->dev,
766 "unable to disable SR-IOV because VFs are assigned.\n");
767 } 773 }
768 clear_bit(__I40E_VF_DISABLE, &pf->state); 774 clear_bit(__I40E_VF_DISABLE, &pf->state);
769} 775}
@@ -1017,18 +1023,18 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf)
1017 } 1023 }
1018 1024
1019 vfres->vf_offload_flags = I40E_VIRTCHNL_VF_OFFLOAD_L2; 1025 vfres->vf_offload_flags = I40E_VIRTCHNL_VF_OFFLOAD_L2;
1020 vsi = pf->vsi[vf->lan_vsi_index]; 1026 vsi = pf->vsi[vf->lan_vsi_idx];
1021 if (!vsi->info.pvid) 1027 if (!vsi->info.pvid)
1022 vfres->vf_offload_flags |= I40E_VIRTCHNL_VF_OFFLOAD_VLAN; 1028 vfres->vf_offload_flags |= I40E_VIRTCHNL_VF_OFFLOAD_VLAN;
1023 1029
1024 vfres->num_vsis = num_vsis; 1030 vfres->num_vsis = num_vsis;
1025 vfres->num_queue_pairs = vf->num_queue_pairs; 1031 vfres->num_queue_pairs = vf->num_queue_pairs;
1026 vfres->max_vectors = pf->hw.func_caps.num_msix_vectors_vf; 1032 vfres->max_vectors = pf->hw.func_caps.num_msix_vectors_vf;
1027 if (vf->lan_vsi_index) { 1033 if (vf->lan_vsi_idx) {
1028 vfres->vsi_res[i].vsi_id = vf->lan_vsi_index; 1034 vfres->vsi_res[i].vsi_id = vf->lan_vsi_id;
1029 vfres->vsi_res[i].vsi_type = I40E_VSI_SRIOV; 1035 vfres->vsi_res[i].vsi_type = I40E_VSI_SRIOV;
1030 vfres->vsi_res[i].num_queue_pairs = 1036 vfres->vsi_res[i].num_queue_pairs =
1031 pf->vsi[vf->lan_vsi_index]->alloc_queue_pairs; 1037 pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs;
1032 memcpy(vfres->vsi_res[i].default_mac_addr, 1038 memcpy(vfres->vsi_res[i].default_mac_addr,
1033 vf->default_lan_addr.addr, ETH_ALEN); 1039 vf->default_lan_addr.addr, ETH_ALEN);
1034 i++; 1040 i++;
@@ -1080,14 +1086,14 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf,
1080 bool allmulti = false; 1086 bool allmulti = false;
1081 i40e_status aq_ret; 1087 i40e_status aq_ret;
1082 1088
1089 vsi = i40e_find_vsi_from_id(pf, info->vsi_id);
1083 if (!test_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states) || 1090 if (!test_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states) ||
1084 !test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps) || 1091 !test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps) ||
1085 !i40e_vc_isvalid_vsi_id(vf, info->vsi_id) || 1092 !i40e_vc_isvalid_vsi_id(vf, info->vsi_id) ||
1086 (pf->vsi[info->vsi_id]->type != I40E_VSI_FCOE)) { 1093 (vsi->type != I40E_VSI_FCOE)) {
1087 aq_ret = I40E_ERR_PARAM; 1094 aq_ret = I40E_ERR_PARAM;
1088 goto error_param; 1095 goto error_param;
1089 } 1096 }
1090 vsi = pf->vsi[info->vsi_id];
1091 if (info->flags & I40E_FLAG_VF_MULTICAST_PROMISC) 1097 if (info->flags & I40E_FLAG_VF_MULTICAST_PROMISC)
1092 allmulti = true; 1098 allmulti = true;
1093 aq_ret = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, 1099 aq_ret = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid,
@@ -1149,7 +1155,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
1149 } 1155 }
1150 } 1156 }
1151 /* set vsi num_queue_pairs in use to num configured by VF */ 1157 /* set vsi num_queue_pairs in use to num configured by VF */
1152 pf->vsi[vf->lan_vsi_index]->num_queue_pairs = qci->num_queue_pairs; 1158 pf->vsi[vf->lan_vsi_idx]->num_queue_pairs = qci->num_queue_pairs;
1153 1159
1154error_param: 1160error_param:
1155 /* send the response to the VF */ 1161 /* send the response to the VF */
@@ -1250,7 +1256,8 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
1250 aq_ret = I40E_ERR_PARAM; 1256 aq_ret = I40E_ERR_PARAM;
1251 goto error_param; 1257 goto error_param;
1252 } 1258 }
1253 if (i40e_vsi_control_rings(pf->vsi[vsi_id], true)) 1259
1260 if (i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_idx], true))
1254 aq_ret = I40E_ERR_TIMEOUT; 1261 aq_ret = I40E_ERR_TIMEOUT;
1255error_param: 1262error_param:
1256 /* send the response to the VF */ 1263 /* send the response to the VF */
@@ -1272,7 +1279,6 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
1272 struct i40e_virtchnl_queue_select *vqs = 1279 struct i40e_virtchnl_queue_select *vqs =
1273 (struct i40e_virtchnl_queue_select *)msg; 1280 (struct i40e_virtchnl_queue_select *)msg;
1274 struct i40e_pf *pf = vf->pf; 1281 struct i40e_pf *pf = vf->pf;
1275 u16 vsi_id = vqs->vsi_id;
1276 i40e_status aq_ret = 0; 1282 i40e_status aq_ret = 0;
1277 1283
1278 if (!test_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states)) { 1284 if (!test_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states)) {
@@ -1289,7 +1295,8 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
1289 aq_ret = I40E_ERR_PARAM; 1295 aq_ret = I40E_ERR_PARAM;
1290 goto error_param; 1296 goto error_param;
1291 } 1297 }
1292 if (i40e_vsi_control_rings(pf->vsi[vsi_id], false)) 1298
1299 if (i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_idx], false))
1293 aq_ret = I40E_ERR_TIMEOUT; 1300 aq_ret = I40E_ERR_TIMEOUT;
1294 1301
1295error_param: 1302error_param:
@@ -1327,7 +1334,7 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
1327 goto error_param; 1334 goto error_param;
1328 } 1335 }
1329 1336
1330 vsi = pf->vsi[vqs->vsi_id]; 1337 vsi = pf->vsi[vf->lan_vsi_idx];
1331 if (!vsi) { 1338 if (!vsi) {
1332 aq_ret = I40E_ERR_PARAM; 1339 aq_ret = I40E_ERR_PARAM;
1333 goto error_param; 1340 goto error_param;
@@ -1405,7 +1412,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
1405 if (ret) 1412 if (ret)
1406 goto error_param; 1413 goto error_param;
1407 } 1414 }
1408 vsi = pf->vsi[vsi_id]; 1415 vsi = pf->vsi[vf->lan_vsi_idx];
1409 1416
1410 /* add new addresses to the list */ 1417 /* add new addresses to the list */
1411 for (i = 0; i < al->num_elements; i++) { 1418 for (i = 0; i < al->num_elements; i++) {
@@ -1473,7 +1480,7 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
1473 goto error_param; 1480 goto error_param;
1474 } 1481 }
1475 } 1482 }
1476 vsi = pf->vsi[vsi_id]; 1483 vsi = pf->vsi[vf->lan_vsi_idx];
1477 1484
1478 /* delete addresses from the list */ 1485 /* delete addresses from the list */
1479 for (i = 0; i < al->num_elements; i++) 1486 for (i = 0; i < al->num_elements; i++)
@@ -1523,7 +1530,7 @@ static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
1523 goto error_param; 1530 goto error_param;
1524 } 1531 }
1525 } 1532 }
1526 vsi = pf->vsi[vsi_id]; 1533 vsi = pf->vsi[vf->lan_vsi_idx];
1527 if (vsi->info.pvid) { 1534 if (vsi->info.pvid) {
1528 aq_ret = I40E_ERR_PARAM; 1535 aq_ret = I40E_ERR_PARAM;
1529 goto error_param; 1536 goto error_param;
@@ -1576,7 +1583,7 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
1576 } 1583 }
1577 } 1584 }
1578 1585
1579 vsi = pf->vsi[vsi_id]; 1586 vsi = pf->vsi[vf->lan_vsi_idx];
1580 if (vsi->info.pvid) { 1587 if (vsi->info.pvid) {
1581 aq_ret = I40E_ERR_PARAM; 1588 aq_ret = I40E_ERR_PARAM;
1582 goto error_param; 1589 goto error_param;
@@ -1965,7 +1972,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
1965 } 1972 }
1966 1973
1967 vf = &(pf->vf[vf_id]); 1974 vf = &(pf->vf[vf_id]);
1968 vsi = pf->vsi[vf->lan_vsi_index]; 1975 vsi = pf->vsi[vf->lan_vsi_idx];
1969 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) { 1976 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) {
1970 dev_err(&pf->pdev->dev, 1977 dev_err(&pf->pdev->dev,
1971 "Uninitialized VF %d\n", vf_id); 1978 "Uninitialized VF %d\n", vf_id);
@@ -2039,7 +2046,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
2039 } 2046 }
2040 2047
2041 vf = &(pf->vf[vf_id]); 2048 vf = &(pf->vf[vf_id]);
2042 vsi = pf->vsi[vf->lan_vsi_index]; 2049 vsi = pf->vsi[vf->lan_vsi_idx];
2043 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) { 2050 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) {
2044 dev_err(&pf->pdev->dev, "Uninitialized VF %d\n", vf_id); 2051 dev_err(&pf->pdev->dev, "Uninitialized VF %d\n", vf_id);
2045 ret = -EINVAL; 2052 ret = -EINVAL;
@@ -2152,7 +2159,7 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
2152 } 2159 }
2153 2160
2154 vf = &(pf->vf[vf_id]); 2161 vf = &(pf->vf[vf_id]);
2155 vsi = pf->vsi[vf->lan_vsi_index]; 2162 vsi = pf->vsi[vf->lan_vsi_idx];
2156 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) { 2163 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) {
2157 dev_err(&pf->pdev->dev, "Uninitialized VF %d.\n", vf_id); 2164 dev_err(&pf->pdev->dev, "Uninitialized VF %d.\n", vf_id);
2158 ret = -EINVAL; 2165 ret = -EINVAL;
@@ -2226,7 +2233,7 @@ int i40e_ndo_get_vf_config(struct net_device *netdev,
2226 2233
2227 vf = &(pf->vf[vf_id]); 2234 vf = &(pf->vf[vf_id]);
2228 /* first vsi is always the LAN vsi */ 2235 /* first vsi is always the LAN vsi */
2229 vsi = pf->vsi[vf->lan_vsi_index]; 2236 vsi = pf->vsi[vf->lan_vsi_idx];
2230 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) { 2237 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) {
2231 dev_err(&pf->pdev->dev, "Uninitialized VF %d\n", vf_id); 2238 dev_err(&pf->pdev->dev, "Uninitialized VF %d\n", vf_id);
2232 ret = -EINVAL; 2239 ret = -EINVAL;
@@ -2350,7 +2357,7 @@ int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable)
2350 2357
2351 vf->spoofchk = enable; 2358 vf->spoofchk = enable;
2352 memset(&ctxt, 0, sizeof(ctxt)); 2359 memset(&ctxt, 0, sizeof(ctxt));
2353 ctxt.seid = pf->vsi[vf->lan_vsi_index]->seid; 2360 ctxt.seid = pf->vsi[vf->lan_vsi_idx]->seid;
2354 ctxt.pf_num = pf->hw.pf_id; 2361 ctxt.pf_num = pf->hw.pf_id;
2355 ctxt.info.valid_sections = cpu_to_le16(I40E_AQ_VSI_PROP_SECURITY_VALID); 2362 ctxt.info.valid_sections = cpu_to_le16(I40E_AQ_VSI_PROP_SECURITY_VALID);
2356 if (enable) 2363 if (enable)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
index 9c3a41040835..09043c1aae54 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
@@ -88,7 +88,7 @@ struct i40e_vf {
88 * When assigned, these will be non-zero, because VSI 0 is always 88 * When assigned, these will be non-zero, because VSI 0 is always
89 * the main LAN VSI for the PF. 89 * the main LAN VSI for the PF.
90 */ 90 */
91 u8 lan_vsi_index; /* index into PF struct */ 91 u8 lan_vsi_idx; /* index into PF struct */
92 u8 lan_vsi_id; /* ID as used by firmware */ 92 u8 lan_vsi_id; /* ID as used by firmware */
93 93
94 u8 num_queue_pairs; /* num of qps assigned to VF vsis */ 94 u8 num_queue_pairs; /* num of qps assigned to VF vsis */
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index f41da5d8047b..e2ddb30e96f5 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -915,9 +915,7 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
915 * so the total length of IPv4 header is IHL*4 bytes 915 * so the total length of IPv4 header is IHL*4 bytes
916 * The UDP_0 bit *may* bet set if the *inner* header is UDP 916 * The UDP_0 bit *may* bet set if the *inner* header is UDP
917 */ 917 */
918 if (ipv4_tunnel && 918 if (ipv4_tunnel) {
919 (decoded.inner_prot != I40E_RX_PTYPE_INNER_PROT_UDP) &&
920 !(rx_status & (1 << I40E_RX_DESC_STATUS_UDP_0_SHIFT))) {
921 skb->transport_header = skb->mac_header + 919 skb->transport_header = skb->mac_header +
922 sizeof(struct ethhdr) + 920 sizeof(struct ethhdr) +
923 (ip_hdr(skb)->ihl * 4); 921 (ip_hdr(skb)->ihl * 4);
@@ -927,15 +925,19 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
927 skb->protocol == htons(ETH_P_8021AD)) 925 skb->protocol == htons(ETH_P_8021AD))
928 ? VLAN_HLEN : 0; 926 ? VLAN_HLEN : 0;
929 927
930 rx_udp_csum = udp_csum(skb); 928 if ((ip_hdr(skb)->protocol == IPPROTO_UDP) &&
931 iph = ip_hdr(skb); 929 (udp_hdr(skb)->check != 0)) {
932 csum = csum_tcpudp_magic( 930 rx_udp_csum = udp_csum(skb);
933 iph->saddr, iph->daddr, 931 iph = ip_hdr(skb);
934 (skb->len - skb_transport_offset(skb)), 932 csum = csum_tcpudp_magic(iph->saddr, iph->daddr,
935 IPPROTO_UDP, rx_udp_csum); 933 (skb->len -
934 skb_transport_offset(skb)),
935 IPPROTO_UDP, rx_udp_csum);
936 936
937 if (udp_hdr(skb)->check != csum) 937 if (udp_hdr(skb)->check != csum)
938 goto checksum_fail; 938 goto checksum_fail;
939
940 } /* else its GRE and so no outer UDP header */
939 } 941 }
940 942
941 skb->ip_summed = CHECKSUM_UNNECESSARY; 943 skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -1038,8 +1040,11 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, int budget)
1038 if (likely(!skb)) { 1040 if (likely(!skb)) {
1039 skb = netdev_alloc_skb_ip_align(rx_ring->netdev, 1041 skb = netdev_alloc_skb_ip_align(rx_ring->netdev,
1040 rx_ring->rx_hdr_len); 1042 rx_ring->rx_hdr_len);
1041 if (!skb) 1043 if (!skb) {
1042 rx_ring->rx_stats.alloc_buff_failed++; 1044 rx_ring->rx_stats.alloc_buff_failed++;
1045 break;
1046 }
1047
1043 /* initialize queue mapping */ 1048 /* initialize queue mapping */
1044 skb_record_rx_queue(skb, rx_ring->queue_index); 1049 skb_record_rx_queue(skb, rx_ring->queue_index);
1045 /* we are reusing so sync this buffer for CPU use */ 1050 /* we are reusing so sync this buffer for CPU use */
@@ -1365,6 +1370,19 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb,
1365 __be16 protocol = skb->protocol; 1370 __be16 protocol = skb->protocol;
1366 u32 tx_flags = 0; 1371 u32 tx_flags = 0;
1367 1372
1373 if (protocol == htons(ETH_P_8021Q) &&
1374 !(tx_ring->netdev->features & NETIF_F_HW_VLAN_CTAG_TX)) {
1375 /* When HW VLAN acceleration is turned off by the user the
1376 * stack sets the protocol to 8021q so that the driver
1377 * can take any steps required to support the SW only
1378 * VLAN handling. In our case the driver doesn't need
1379 * to take any further steps so just set the protocol
1380 * to the encapsulated ethertype.
1381 */
1382 skb->protocol = vlan_get_protocol(skb);
1383 goto out;
1384 }
1385
1368 /* if we have a HW VLAN tag being added, default to the HW one */ 1386 /* if we have a HW VLAN tag being added, default to the HW one */
1369 if (skb_vlan_tag_present(skb)) { 1387 if (skb_vlan_tag_present(skb)) {
1370 tx_flags |= skb_vlan_tag_get(skb) << I40E_TX_FLAGS_VLAN_SHIFT; 1388 tx_flags |= skb_vlan_tag_get(skb) << I40E_TX_FLAGS_VLAN_SHIFT;
@@ -1381,6 +1399,7 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb,
1381 tx_flags |= I40E_TX_FLAGS_SW_VLAN; 1399 tx_flags |= I40E_TX_FLAGS_SW_VLAN;
1382 } 1400 }
1383 1401
1402out:
1384 *flags = tx_flags; 1403 *flags = tx_flags;
1385 return 0; 1404 return 0;
1386} 1405}
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index b08efafee1ae..6d5f3b21c68a 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -664,13 +664,21 @@ i40evf_vlan_filter *i40evf_find_vlan(struct i40evf_adapter *adapter, u16 vlan)
664static struct 664static struct
665i40evf_vlan_filter *i40evf_add_vlan(struct i40evf_adapter *adapter, u16 vlan) 665i40evf_vlan_filter *i40evf_add_vlan(struct i40evf_adapter *adapter, u16 vlan)
666{ 666{
667 struct i40evf_vlan_filter *f; 667 struct i40evf_vlan_filter *f = NULL;
668 int count = 50;
669
670 while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,
671 &adapter->crit_section)) {
672 udelay(1);
673 if (--count == 0)
674 goto out;
675 }
668 676
669 f = i40evf_find_vlan(adapter, vlan); 677 f = i40evf_find_vlan(adapter, vlan);
670 if (!f) { 678 if (!f) {
671 f = kzalloc(sizeof(*f), GFP_ATOMIC); 679 f = kzalloc(sizeof(*f), GFP_ATOMIC);
672 if (!f) 680 if (!f)
673 return NULL; 681 goto clearout;
674 682
675 f->vlan = vlan; 683 f->vlan = vlan;
676 684
@@ -680,6 +688,9 @@ i40evf_vlan_filter *i40evf_add_vlan(struct i40evf_adapter *adapter, u16 vlan)
680 adapter->aq_required |= I40EVF_FLAG_AQ_ADD_VLAN_FILTER; 688 adapter->aq_required |= I40EVF_FLAG_AQ_ADD_VLAN_FILTER;
681 } 689 }
682 690
691clearout:
692 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);
693out:
683 return f; 694 return f;
684} 695}
685 696
@@ -691,12 +702,21 @@ i40evf_vlan_filter *i40evf_add_vlan(struct i40evf_adapter *adapter, u16 vlan)
691static void i40evf_del_vlan(struct i40evf_adapter *adapter, u16 vlan) 702static void i40evf_del_vlan(struct i40evf_adapter *adapter, u16 vlan)
692{ 703{
693 struct i40evf_vlan_filter *f; 704 struct i40evf_vlan_filter *f;
705 int count = 50;
706
707 while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,
708 &adapter->crit_section)) {
709 udelay(1);
710 if (--count == 0)
711 return;
712 }
694 713
695 f = i40evf_find_vlan(adapter, vlan); 714 f = i40evf_find_vlan(adapter, vlan);
696 if (f) { 715 if (f) {
697 f->remove = true; 716 f->remove = true;
698 adapter->aq_required |= I40EVF_FLAG_AQ_DEL_VLAN_FILTER; 717 adapter->aq_required |= I40EVF_FLAG_AQ_DEL_VLAN_FILTER;
699 } 718 }
719 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);
700} 720}
701 721
702/** 722/**
@@ -1415,41 +1435,22 @@ restart_watchdog:
1415} 1435}
1416 1436
1417/** 1437/**
1418 * next_queue - increment to next available tx queue 1438 * i40evf_configure_rss - Prepare for RSS
1419 * @adapter: board private structure
1420 * @j: queue counter
1421 *
1422 * Helper function for RSS programming to increment through available
1423 * queus. Returns the next queue value.
1424 **/
1425static int next_queue(struct i40evf_adapter *adapter, int j)
1426{
1427 j += 1;
1428
1429 return j >= adapter->num_active_queues ? 0 : j;
1430}
1431
1432/**
1433 * i40evf_configure_rss - Prepare for RSS if used
1434 * @adapter: board private structure 1439 * @adapter: board private structure
1435 **/ 1440 **/
1436static void i40evf_configure_rss(struct i40evf_adapter *adapter) 1441static void i40evf_configure_rss(struct i40evf_adapter *adapter)
1437{ 1442{
1438 u32 rss_key[I40E_VFQF_HKEY_MAX_INDEX + 1]; 1443 u32 rss_key[I40E_VFQF_HKEY_MAX_INDEX + 1];
1439 struct i40e_hw *hw = &adapter->hw; 1444 struct i40e_hw *hw = &adapter->hw;
1445 u32 cqueue = 0;
1440 u32 lut = 0; 1446 u32 lut = 0;
1441 int i, j; 1447 int i, j;
1442 u64 hena; 1448 u64 hena;
1443 1449
1444 /* No RSS for single queue. */
1445 if (adapter->num_active_queues == 1) {
1446 wr32(hw, I40E_VFQF_HENA(0), 0);
1447 wr32(hw, I40E_VFQF_HENA(1), 0);
1448 return;
1449 }
1450
1451 /* Hash type is configured by the PF - we just supply the key */ 1450 /* Hash type is configured by the PF - we just supply the key */
1452 netdev_rss_key_fill(rss_key, sizeof(rss_key)); 1451 netdev_rss_key_fill(rss_key, sizeof(rss_key));
1452
1453 /* Fill out hash function seed */
1453 for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++) 1454 for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
1454 wr32(hw, I40E_VFQF_HKEY(i), rss_key[i]); 1455 wr32(hw, I40E_VFQF_HKEY(i), rss_key[i]);
1455 1456
@@ -1459,16 +1460,14 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter)
1459 wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32)); 1460 wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32));
1460 1461
1461 /* Populate the LUT with max no. of queues in round robin fashion */ 1462 /* Populate the LUT with max no. of queues in round robin fashion */
1462 j = adapter->num_active_queues;
1463 for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { 1463 for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
1464 j = next_queue(adapter, j); 1464 lut = 0;
1465 lut = j; 1465 for (j = 0; j < 4; j++) {
1466 j = next_queue(adapter, j); 1466 if (cqueue == adapter->vsi_res->num_queue_pairs)
1467 lut |= j << 8; 1467 cqueue = 0;
1468 j = next_queue(adapter, j); 1468 lut |= ((cqueue) << (8 * j));
1469 lut |= j << 16; 1469 cqueue++;
1470 j = next_queue(adapter, j); 1470 }
1471 lut |= j << 24;
1472 wr32(hw, I40E_VFQF_HLUT(i), lut); 1471 wr32(hw, I40E_VFQF_HLUT(i), lut);
1473 } 1472 }
1474 i40e_flush(hw); 1473 i40e_flush(hw);