aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-11-23 12:53:38 -0500
committerDavid S. Miller <davem@davemloft.net>2017-11-23 12:53:38 -0500
commit003cd77027f13cdcd745e4429c7d1370eb57e09f (patch)
tree16a6abcfef664b34dcabd4e97712e71d19ea763f
parent4b52d010113e11006a389f2a8315167ede9e0b10 (diff)
parentf72271e2a0ae4277d53c4053f5eed8bb346ba38a (diff)
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Fixes 2017-11-21 This series contains fixes for igb/vf, ixgbe/vf, i40e/vf and fm10k. Jake fixes a regression issue with older firmware, where we were using the NVM lock to synchronize NVM reads for all devices and firmware versions, yet this caused issues with older firmware prior to version 1.5. Fixed this by only grabbing the lock for newer devices and firmware version 1.5 or newer. Zijie Pan fixes the calculation of the i40e VF MAC addresses, where it was possible to increment to the next MAC entry without calling i40e_add_mac_filter(). Amritha removes the upper limit of 64 queues on a channel VSI since the upper bound is determined by the VSI's num_queue_pairs. Filip fixes an issue during FLR resets, where should have been checking for upcoming core reset and if so, just return with I40E_ERR_NOT_READY. Alan fixes the notifying clients of l2 parameters by copying the parameters to the client instance struct and re-organizes the priority in which the client tasks fire so that if the flag for notifying l2 params is set, it will trigger before the client open task. Also fixed the promiscuous settings after reset for all the VSI's. Brian King from IBM fixes an issue seen on Power systems which would result in skb list corruption and eventual kernel oops. Brian provides the same fix for nearly all our drivers, to replace the read_barrier_depends with smp_rmb() to ensure loads are ordered with respect to the load of tx_buffer->next_to_watch. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_main.c2
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e.h1
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_adminq.c6
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_common.c10
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c165
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_nvm.c8
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_txrx.c2
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_type.h1
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c21
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_txrx.c2
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_client.c38
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c10
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c2
-rw-r--r--drivers/net/ethernet/intel/igbvf/netdev.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c2
16 files changed, 154 insertions, 120 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index dbd69310f263..538b42d5c187 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -1231,7 +1231,7 @@ static bool fm10k_clean_tx_irq(struct fm10k_q_vector *q_vector,
1231 break; 1231 break;
1232 1232
1233 /* prevent any other reads prior to eop_desc */ 1233 /* prevent any other reads prior to eop_desc */
1234 read_barrier_depends(); 1234 smp_rmb();
1235 1235
1236 /* if DD is not set pending work has not been completed */ 1236 /* if DD is not set pending work has not been completed */
1237 if (!(eop_desc->flags & FM10K_TXD_FLAG_DONE)) 1237 if (!(eop_desc->flags & FM10K_TXD_FLAG_DONE))
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 5829715fa342..e019baa905c5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -90,7 +90,6 @@
90#define I40E_AQ_LEN 256 90#define I40E_AQ_LEN 256
91#define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */ 91#define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */
92#define I40E_MAX_USER_PRIORITY 8 92#define I40E_MAX_USER_PRIORITY 8
93#define I40E_MAX_QUEUES_PER_CH 64
94#define I40E_DEFAULT_TRAFFIC_CLASS BIT(0) 93#define I40E_DEFAULT_TRAFFIC_CLASS BIT(0)
95#define I40E_DEFAULT_MSG_ENABLE 4 94#define I40E_DEFAULT_MSG_ENABLE 4
96#define I40E_QUEUE_WAIT_RETRY_LIMIT 10 95#define I40E_QUEUE_WAIT_RETRY_LIMIT 10
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index 9dcb2a961197..9af74253c3f7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -613,6 +613,12 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
613 hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; 613 hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
614 } 614 }
615 615
616 /* Newer versions of firmware require lock when reading the NVM */
617 if (hw->aq.api_maj_ver > 1 ||
618 (hw->aq.api_maj_ver == 1 &&
619 hw->aq.api_min_ver >= 5))
620 hw->flags |= I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK;
621
616 /* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */ 622 /* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */
617 if (hw->aq.api_maj_ver > 1 || 623 if (hw->aq.api_maj_ver > 1 ||
618 (hw->aq.api_maj_ver == 1 && 624 (hw->aq.api_maj_ver == 1 &&
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 0203665cb53c..095965f268bd 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -948,7 +948,8 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw)
948 hw->pf_id = (u8)(func_rid & 0x7); 948 hw->pf_id = (u8)(func_rid & 0x7);
949 949
950 if (hw->mac.type == I40E_MAC_X722) 950 if (hw->mac.type == I40E_MAC_X722)
951 hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE; 951 hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE |
952 I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK;
952 953
953 status = i40e_init_nvm(hw); 954 status = i40e_init_nvm(hw);
954 return status; 955 return status;
@@ -1268,6 +1269,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
1268 * we don't need to do the PF Reset 1269 * we don't need to do the PF Reset
1269 */ 1270 */
1270 if (!cnt) { 1271 if (!cnt) {
1272 u32 reg2 = 0;
1271 if (hw->revision_id == 0) 1273 if (hw->revision_id == 0)
1272 cnt = I40E_PF_RESET_WAIT_COUNT_A0; 1274 cnt = I40E_PF_RESET_WAIT_COUNT_A0;
1273 else 1275 else
@@ -1279,6 +1281,12 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
1279 reg = rd32(hw, I40E_PFGEN_CTRL); 1281 reg = rd32(hw, I40E_PFGEN_CTRL);
1280 if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK)) 1282 if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK))
1281 break; 1283 break;
1284 reg2 = rd32(hw, I40E_GLGEN_RSTAT);
1285 if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) {
1286 hw_dbg(hw, "Core reset upcoming. Skipping PF reset request.\n");
1287 hw_dbg(hw, "I40E_GLGEN_RSTAT = 0x%x\n", reg2);
1288 return I40E_ERR_NOT_READY;
1289 }
1282 usleep_range(1000, 2000); 1290 usleep_range(1000, 2000);
1283 } 1291 }
1284 if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { 1292 if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) {
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 4a964d6e4a9e..4c08cc86463e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2167,6 +2167,73 @@ i40e_aqc_broadcast_filter(struct i40e_vsi *vsi, const char *vsi_name,
2167} 2167}
2168 2168
2169/** 2169/**
2170 * i40e_set_promiscuous - set promiscuous mode
2171 * @pf: board private structure
2172 * @promisc: promisc on or off
2173 *
2174 * There are different ways of setting promiscuous mode on a PF depending on
2175 * what state/environment we're in. This identifies and sets it appropriately.
2176 * Returns 0 on success.
2177 **/
2178static int i40e_set_promiscuous(struct i40e_pf *pf, bool promisc)
2179{
2180 struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
2181 struct i40e_hw *hw = &pf->hw;
2182 i40e_status aq_ret;
2183
2184 if (vsi->type == I40E_VSI_MAIN &&
2185 pf->lan_veb != I40E_NO_VEB &&
2186 !(pf->flags & I40E_FLAG_MFP_ENABLED)) {
2187 /* set defport ON for Main VSI instead of true promisc
2188 * this way we will get all unicast/multicast and VLAN
2189 * promisc behavior but will not get VF or VMDq traffic
2190 * replicated on the Main VSI.
2191 */
2192 if (promisc)
2193 aq_ret = i40e_aq_set_default_vsi(hw,
2194 vsi->seid,
2195 NULL);
2196 else
2197 aq_ret = i40e_aq_clear_default_vsi(hw,
2198 vsi->seid,
2199 NULL);
2200 if (aq_ret) {
2201 dev_info(&pf->pdev->dev,
2202 "Set default VSI failed, err %s, aq_err %s\n",
2203 i40e_stat_str(hw, aq_ret),
2204 i40e_aq_str(hw, hw->aq.asq_last_status));
2205 }
2206 } else {
2207 aq_ret = i40e_aq_set_vsi_unicast_promiscuous(
2208 hw,
2209 vsi->seid,
2210 promisc, NULL,
2211 true);
2212 if (aq_ret) {
2213 dev_info(&pf->pdev->dev,
2214 "set unicast promisc failed, err %s, aq_err %s\n",
2215 i40e_stat_str(hw, aq_ret),
2216 i40e_aq_str(hw, hw->aq.asq_last_status));
2217 }
2218 aq_ret = i40e_aq_set_vsi_multicast_promiscuous(
2219 hw,
2220 vsi->seid,
2221 promisc, NULL);
2222 if (aq_ret) {
2223 dev_info(&pf->pdev->dev,
2224 "set multicast promisc failed, err %s, aq_err %s\n",
2225 i40e_stat_str(hw, aq_ret),
2226 i40e_aq_str(hw, hw->aq.asq_last_status));
2227 }
2228 }
2229
2230 if (!aq_ret)
2231 pf->cur_promisc = promisc;
2232
2233 return aq_ret;
2234}
2235
2236/**
2170 * i40e_sync_vsi_filters - Update the VSI filter list to the HW 2237 * i40e_sync_vsi_filters - Update the VSI filter list to the HW
2171 * @vsi: ptr to the VSI 2238 * @vsi: ptr to the VSI
2172 * 2239 *
@@ -2467,81 +2534,16 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
2467 cur_promisc = (!!(vsi->current_netdev_flags & IFF_PROMISC) || 2534 cur_promisc = (!!(vsi->current_netdev_flags & IFF_PROMISC) ||
2468 test_bit(__I40E_VSI_OVERFLOW_PROMISC, 2535 test_bit(__I40E_VSI_OVERFLOW_PROMISC,
2469 vsi->state)); 2536 vsi->state));
2470 if ((vsi->type == I40E_VSI_MAIN) && 2537 aq_ret = i40e_set_promiscuous(pf, cur_promisc);
2471 (pf->lan_veb != I40E_NO_VEB) &&
2472 !(pf->flags & I40E_FLAG_MFP_ENABLED)) {
2473 /* set defport ON for Main VSI instead of true promisc
2474 * this way we will get all unicast/multicast and VLAN
2475 * promisc behavior but will not get VF or VMDq traffic
2476 * replicated on the Main VSI.
2477 */
2478 if (pf->cur_promisc != cur_promisc) {
2479 pf->cur_promisc = cur_promisc;
2480 if (cur_promisc)
2481 aq_ret =
2482 i40e_aq_set_default_vsi(hw,
2483 vsi->seid,
2484 NULL);
2485 else
2486 aq_ret =
2487 i40e_aq_clear_default_vsi(hw,
2488 vsi->seid,
2489 NULL);
2490 if (aq_ret) {
2491 retval = i40e_aq_rc_to_posix(aq_ret,
2492 hw->aq.asq_last_status);
2493 dev_info(&pf->pdev->dev,
2494 "Set default VSI failed on %s, err %s, aq_err %s\n",
2495 vsi_name,
2496 i40e_stat_str(hw, aq_ret),
2497 i40e_aq_str(hw,
2498 hw->aq.asq_last_status));
2499 }
2500 }
2501 } else {
2502 aq_ret = i40e_aq_set_vsi_unicast_promiscuous(
2503 hw,
2504 vsi->seid,
2505 cur_promisc, NULL,
2506 true);
2507 if (aq_ret) {
2508 retval =
2509 i40e_aq_rc_to_posix(aq_ret,
2510 hw->aq.asq_last_status);
2511 dev_info(&pf->pdev->dev,
2512 "set unicast promisc failed on %s, err %s, aq_err %s\n",
2513 vsi_name,
2514 i40e_stat_str(hw, aq_ret),
2515 i40e_aq_str(hw,
2516 hw->aq.asq_last_status));
2517 }
2518 aq_ret = i40e_aq_set_vsi_multicast_promiscuous(
2519 hw,
2520 vsi->seid,
2521 cur_promisc, NULL);
2522 if (aq_ret) {
2523 retval =
2524 i40e_aq_rc_to_posix(aq_ret,
2525 hw->aq.asq_last_status);
2526 dev_info(&pf->pdev->dev,
2527 "set multicast promisc failed on %s, err %s, aq_err %s\n",
2528 vsi_name,
2529 i40e_stat_str(hw, aq_ret),
2530 i40e_aq_str(hw,
2531 hw->aq.asq_last_status));
2532 }
2533 }
2534 aq_ret = i40e_aq_set_vsi_broadcast(&vsi->back->hw,
2535 vsi->seid,
2536 cur_promisc, NULL);
2537 if (aq_ret) { 2538 if (aq_ret) {
2538 retval = i40e_aq_rc_to_posix(aq_ret, 2539 retval = i40e_aq_rc_to_posix(aq_ret,
2539 pf->hw.aq.asq_last_status); 2540 hw->aq.asq_last_status);
2540 dev_info(&pf->pdev->dev, 2541 dev_info(&pf->pdev->dev,
2541 "set brdcast promisc failed, err %s, aq_err %s\n", 2542 "Setting promiscuous %s failed on %s, err %s aq_err %s\n",
2542 i40e_stat_str(hw, aq_ret), 2543 cur_promisc ? "on" : "off",
2543 i40e_aq_str(hw, 2544 vsi_name,
2544 hw->aq.asq_last_status)); 2545 i40e_stat_str(hw, aq_ret),
2546 i40e_aq_str(hw, hw->aq.asq_last_status));
2545 } 2547 }
2546 } 2548 }
2547out: 2549out:
@@ -3964,7 +3966,7 @@ static bool i40e_clean_fdir_tx_irq(struct i40e_ring *tx_ring, int budget)
3964 break; 3966 break;
3965 3967
3966 /* prevent any other reads prior to eop_desc */ 3968 /* prevent any other reads prior to eop_desc */
3967 read_barrier_depends(); 3969 smp_rmb();
3968 3970
3969 /* if the descriptor isn't done, no work yet to do */ 3971 /* if the descriptor isn't done, no work yet to do */
3970 if (!(eop_desc->cmd_type_offset_bsz & 3972 if (!(eop_desc->cmd_type_offset_bsz &
@@ -5629,14 +5631,6 @@ static int i40e_validate_num_queues(struct i40e_pf *pf, int num_queues,
5629 return -EINVAL; 5631 return -EINVAL;
5630 5632
5631 *reconfig_rss = false; 5633 *reconfig_rss = false;
5632
5633 if (num_queues > I40E_MAX_QUEUES_PER_CH) {
5634 dev_err(&pf->pdev->dev,
5635 "Failed to create VMDq VSI. User requested num_queues (%d) > I40E_MAX_QUEUES_PER_VSI (%u)\n",
5636 num_queues, I40E_MAX_QUEUES_PER_CH);
5637 return -EINVAL;
5638 }
5639
5640 if (vsi->current_rss_size) { 5634 if (vsi->current_rss_size) {
5641 if (num_queues > vsi->current_rss_size) { 5635 if (num_queues > vsi->current_rss_size) {
5642 dev_dbg(&pf->pdev->dev, 5636 dev_dbg(&pf->pdev->dev,
@@ -9429,6 +9423,15 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
9429 if (!lock_acquired) 9423 if (!lock_acquired)
9430 rtnl_unlock(); 9424 rtnl_unlock();
9431 9425
9426 /* Restore promiscuous settings */
9427 ret = i40e_set_promiscuous(pf, pf->cur_promisc);
9428 if (ret)
9429 dev_warn(&pf->pdev->dev,
9430 "Failed to restore promiscuous setting: %s, err %s aq_err %s\n",
9431 pf->cur_promisc ? "on" : "off",
9432 i40e_stat_str(&pf->hw, ret),
9433 i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
9434
9432 i40e_reset_all_vfs(pf, true); 9435 i40e_reset_all_vfs(pf, true);
9433 9436
9434 /* tell the firmware that we're starting */ 9437 /* tell the firmware that we're starting */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
index 0ccab0a5d717..7689c2ee0d46 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@ -328,15 +328,17 @@ static i40e_status __i40e_read_nvm_word(struct i40e_hw *hw,
328i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset, 328i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
329 u16 *data) 329 u16 *data)
330{ 330{
331 i40e_status ret_code; 331 i40e_status ret_code = 0;
332 332
333 ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ); 333 if (hw->flags & I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK)
334 ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
334 if (ret_code) 335 if (ret_code)
335 return ret_code; 336 return ret_code;
336 337
337 ret_code = __i40e_read_nvm_word(hw, offset, data); 338 ret_code = __i40e_read_nvm_word(hw, offset, data);
338 339
339 i40e_release_nvm(hw); 340 if (hw->flags & I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK)
341 i40e_release_nvm(hw);
340 342
341 return ret_code; 343 return ret_code;
342} 344}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index d6d352a6e6ea..4566d66ffc7c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -759,7 +759,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
759 break; 759 break;
760 760
761 /* prevent any other reads prior to eop_desc */ 761 /* prevent any other reads prior to eop_desc */
762 read_barrier_depends(); 762 smp_rmb();
763 763
764 i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf); 764 i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);
765 /* we have caught up to head, no work left to do */ 765 /* we have caught up to head, no work left to do */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 00d4833e9925..0e8568719b4e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -629,6 +629,7 @@ struct i40e_hw {
629#define I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE BIT_ULL(0) 629#define I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE BIT_ULL(0)
630#define I40E_HW_FLAG_802_1AD_CAPABLE BIT_ULL(1) 630#define I40E_HW_FLAG_802_1AD_CAPABLE BIT_ULL(1)
631#define I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE BIT_ULL(2) 631#define I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE BIT_ULL(2)
632#define I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK BIT_ULL(3)
632 u64 flags; 633 u64 flags;
633 634
634 /* Used in set switch config AQ command */ 635 /* Used in set switch config AQ command */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index f8a794b72462..a3dc9b932946 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2218,18 +2218,19 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
2218 struct i40e_mac_filter *f; 2218 struct i40e_mac_filter *f;
2219 2219
2220 f = i40e_find_mac(vsi, al->list[i].addr); 2220 f = i40e_find_mac(vsi, al->list[i].addr);
2221 if (!f) 2221 if (!f) {
2222 f = i40e_add_mac_filter(vsi, al->list[i].addr); 2222 f = i40e_add_mac_filter(vsi, al->list[i].addr);
2223 2223
2224 if (!f) { 2224 if (!f) {
2225 dev_err(&pf->pdev->dev, 2225 dev_err(&pf->pdev->dev,
2226 "Unable to add MAC filter %pM for VF %d\n", 2226 "Unable to add MAC filter %pM for VF %d\n",
2227 al->list[i].addr, vf->vf_id); 2227 al->list[i].addr, vf->vf_id);
2228 ret = I40E_ERR_PARAM; 2228 ret = I40E_ERR_PARAM;
2229 spin_unlock_bh(&vsi->mac_filter_hash_lock); 2229 spin_unlock_bh(&vsi->mac_filter_hash_lock);
2230 goto error_param; 2230 goto error_param;
2231 } else { 2231 } else {
2232 vf->num_mac++; 2232 vf->num_mac++;
2233 }
2233 } 2234 }
2234 } 2235 }
2235 spin_unlock_bh(&vsi->mac_filter_hash_lock); 2236 spin_unlock_bh(&vsi->mac_filter_hash_lock);
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index fe817e2b6fef..50864f99446d 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -179,7 +179,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
179 break; 179 break;
180 180
181 /* prevent any other reads prior to eop_desc */ 181 /* prevent any other reads prior to eop_desc */
182 read_barrier_depends(); 182 smp_rmb();
183 183
184 i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf); 184 i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);
185 /* if the descriptor isn't done, no work yet to do */ 185 /* if the descriptor isn't done, no work yet to do */
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_client.c b/drivers/net/ethernet/intel/i40evf/i40evf_client.c
index d8131139565e..da60ce12b33d 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_client.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_client.c
@@ -26,6 +26,26 @@ static struct i40e_ops i40evf_lan_ops = {
26}; 26};
27 27
28/** 28/**
29 * i40evf_client_get_params - retrieve relevant client parameters
30 * @vsi: VSI with parameters
31 * @params: client param struct
32 **/
33static
34void i40evf_client_get_params(struct i40e_vsi *vsi, struct i40e_params *params)
35{
36 int i;
37
38 memset(params, 0, sizeof(struct i40e_params));
39 params->mtu = vsi->netdev->mtu;
40 params->link_up = vsi->back->link_up;
41
42 for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
43 params->qos.prio_qos[i].tc = 0;
44 params->qos.prio_qos[i].qs_handle = vsi->qs_handle;
45 }
46}
47
48/**
29 * i40evf_notify_client_message - call the client message receive callback 49 * i40evf_notify_client_message - call the client message receive callback
30 * @vsi: the VSI associated with this client 50 * @vsi: the VSI associated with this client
31 * @msg: message buffer 51 * @msg: message buffer
@@ -66,10 +86,6 @@ void i40evf_notify_client_l2_params(struct i40e_vsi *vsi)
66 return; 86 return;
67 87
68 cinst = vsi->back->cinst; 88 cinst = vsi->back->cinst;
69 memset(&params, 0, sizeof(params));
70 params.mtu = vsi->netdev->mtu;
71 params.link_up = vsi->back->link_up;
72 params.qos.prio_qos[0].qs_handle = vsi->qs_handle;
73 89
74 if (!cinst || !cinst->client || !cinst->client->ops || 90 if (!cinst || !cinst->client || !cinst->client->ops ||
75 !cinst->client->ops->l2_param_change) { 91 !cinst->client->ops->l2_param_change) {
@@ -77,6 +93,8 @@ void i40evf_notify_client_l2_params(struct i40e_vsi *vsi)
77 "Cannot locate client instance l2_param_change function\n"); 93 "Cannot locate client instance l2_param_change function\n");
78 return; 94 return;
79 } 95 }
96 i40evf_client_get_params(vsi, &params);
97 cinst->lan_info.params = params;
80 cinst->client->ops->l2_param_change(&cinst->lan_info, cinst->client, 98 cinst->client->ops->l2_param_change(&cinst->lan_info, cinst->client,
81 &params); 99 &params);
82} 100}
@@ -166,9 +184,9 @@ static struct i40e_client_instance *
166i40evf_client_add_instance(struct i40evf_adapter *adapter) 184i40evf_client_add_instance(struct i40evf_adapter *adapter)
167{ 185{
168 struct i40e_client_instance *cinst = NULL; 186 struct i40e_client_instance *cinst = NULL;
169 struct netdev_hw_addr *mac = NULL;
170 struct i40e_vsi *vsi = &adapter->vsi; 187 struct i40e_vsi *vsi = &adapter->vsi;
171 int i; 188 struct netdev_hw_addr *mac = NULL;
189 struct i40e_params params;
172 190
173 if (!vf_registered_client) 191 if (!vf_registered_client)
174 goto out; 192 goto out;
@@ -192,18 +210,14 @@ i40evf_client_add_instance(struct i40evf_adapter *adapter)
192 cinst->lan_info.version.major = I40EVF_CLIENT_VERSION_MAJOR; 210 cinst->lan_info.version.major = I40EVF_CLIENT_VERSION_MAJOR;
193 cinst->lan_info.version.minor = I40EVF_CLIENT_VERSION_MINOR; 211 cinst->lan_info.version.minor = I40EVF_CLIENT_VERSION_MINOR;
194 cinst->lan_info.version.build = I40EVF_CLIENT_VERSION_BUILD; 212 cinst->lan_info.version.build = I40EVF_CLIENT_VERSION_BUILD;
213 i40evf_client_get_params(vsi, &params);
214 cinst->lan_info.params = params;
195 set_bit(__I40E_CLIENT_INSTANCE_NONE, &cinst->state); 215 set_bit(__I40E_CLIENT_INSTANCE_NONE, &cinst->state);
196 216
197 cinst->lan_info.msix_count = adapter->num_iwarp_msix; 217 cinst->lan_info.msix_count = adapter->num_iwarp_msix;
198 cinst->lan_info.msix_entries = 218 cinst->lan_info.msix_entries =
199 &adapter->msix_entries[adapter->iwarp_base_vector]; 219 &adapter->msix_entries[adapter->iwarp_base_vector];
200 220
201 for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
202 cinst->lan_info.params.qos.prio_qos[i].tc = 0;
203 cinst->lan_info.params.qos.prio_qos[i].qs_handle =
204 vsi->qs_handle;
205 }
206
207 mac = list_first_entry(&cinst->lan_info.netdev->dev_addrs.list, 221 mac = list_first_entry(&cinst->lan_info.netdev->dev_addrs.list,
208 struct netdev_hw_addr, list); 222 struct netdev_hw_addr, list);
209 if (mac) 223 if (mac)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index ca2ebdbd24d7..7b2a4eba92e2 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2110,6 +2110,11 @@ static void i40evf_client_task(struct work_struct *work)
2110 adapter->flags &= ~I40EVF_FLAG_SERVICE_CLIENT_REQUESTED; 2110 adapter->flags &= ~I40EVF_FLAG_SERVICE_CLIENT_REQUESTED;
2111 goto out; 2111 goto out;
2112 } 2112 }
2113 if (adapter->flags & I40EVF_FLAG_CLIENT_NEEDS_L2_PARAMS) {
2114 i40evf_notify_client_l2_params(&adapter->vsi);
2115 adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_L2_PARAMS;
2116 goto out;
2117 }
2113 if (adapter->flags & I40EVF_FLAG_CLIENT_NEEDS_CLOSE) { 2118 if (adapter->flags & I40EVF_FLAG_CLIENT_NEEDS_CLOSE) {
2114 i40evf_notify_client_close(&adapter->vsi, false); 2119 i40evf_notify_client_close(&adapter->vsi, false);
2115 adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_CLOSE; 2120 adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_CLOSE;
@@ -2118,11 +2123,6 @@ static void i40evf_client_task(struct work_struct *work)
2118 if (adapter->flags & I40EVF_FLAG_CLIENT_NEEDS_OPEN) { 2123 if (adapter->flags & I40EVF_FLAG_CLIENT_NEEDS_OPEN) {
2119 i40evf_notify_client_open(&adapter->vsi); 2124 i40evf_notify_client_open(&adapter->vsi);
2120 adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_OPEN; 2125 adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_OPEN;
2121 goto out;
2122 }
2123 if (adapter->flags & I40EVF_FLAG_CLIENT_NEEDS_L2_PARAMS) {
2124 i40evf_notify_client_l2_params(&adapter->vsi);
2125 adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_L2_PARAMS;
2126 } 2126 }
2127out: 2127out:
2128 clear_bit(__I40EVF_IN_CLIENT_TASK, &adapter->crit_section); 2128 clear_bit(__I40EVF_IN_CLIENT_TASK, &adapter->crit_section);
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index e94d3c256667..c208753ff5b7 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7317,7 +7317,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector, int napi_budget)
7317 break; 7317 break;
7318 7318
7319 /* prevent any other reads prior to eop_desc */ 7319 /* prevent any other reads prior to eop_desc */
7320 read_barrier_depends(); 7320 smp_rmb();
7321 7321
7322 /* if DD is not set pending work has not been completed */ 7322 /* if DD is not set pending work has not been completed */
7323 if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD))) 7323 if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD)))
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 713e8df23744..4214c1519a87 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -810,7 +810,7 @@ static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring)
810 break; 810 break;
811 811
812 /* prevent any other reads prior to eop_desc */ 812 /* prevent any other reads prior to eop_desc */
813 read_barrier_depends(); 813 smp_rmb();
814 814
815 /* if DD is not set pending work has not been completed */ 815 /* if DD is not set pending work has not been completed */
816 if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD))) 816 if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD)))
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index ca06c3cc2ca8..62a18914f00f 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1192,7 +1192,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
1192 break; 1192 break;
1193 1193
1194 /* prevent any other reads prior to eop_desc */ 1194 /* prevent any other reads prior to eop_desc */
1195 read_barrier_depends(); 1195 smp_rmb();
1196 1196
1197 /* if DD is not set pending work has not been completed */ 1197 /* if DD is not set pending work has not been completed */
1198 if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD))) 1198 if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)))
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index feed11bc9ddf..1f4a69134ade 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -326,7 +326,7 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector,
326 break; 326 break;
327 327
328 /* prevent any other reads prior to eop_desc */ 328 /* prevent any other reads prior to eop_desc */
329 read_barrier_depends(); 329 smp_rmb();
330 330
331 /* if DD is not set pending work has not been completed */ 331 /* if DD is not set pending work has not been completed */
332 if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD))) 332 if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)))