Skip to content

Commit 1d3b78b

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix PCI IDs of 9000 series iwlwifi devices, from Luca Coelho. 2) bpf offload bug fixes from Jakub Kicinski. 3) Fix bpf verifier to NOP out code which is dead at run time because due to branch pruning the verifier will not explore such instructions. From Alexei Starovoitov. 4) Fix crash when deleting secondary chains in packet scheduler classifier. From Roman Kapl. 5) Fix buffer management bugs in smc, from Ursula Braun. 6) Fix regression in anycast route handling, from David Ahern. 7) Fix link settings regression in r8169, from Tobias Jakobi. 8) Add back enough UFO support so that live migration still works, from Willem de Bruijn. 9) Linearize enough packet data for the full extent to which the ipvlan code will inspect the packet headers, from Gao Feng. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (46 commits) ipvlan: Fix insufficient skb linear check for ipv6 icmp ipvlan: Fix insufficient skb linear check for arp geneve: only configure or fill UDP_ZERO_CSUM6_RX/TX info when CONFIG_IPV6 net: dsa: bcm_sf2: Clear IDDQ_GLOBAL_PWR bit for PHY net: accept UFO datagrams from tuntap and packet net: realtek: r8169: implement set_link_ksettings() net: ipv6: Fixup device for anycast routes during copy net/smc: Fix preinitialization of buf_desc in __smc_buf_create() net/smc: use sk_rcvbuf as start for rmb creation ipv6: Do not consider linkdown nexthops during multipath net: sched: fix crash when deleting secondary chains net: phy: cortina: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE bpf: fix branch pruning logic bpf: change bpf_perf_event_output arg5 type to ARG_CONST_SIZE_OR_ZERO bpf: change bpf_probe_read_str arg2 type to ARG_CONST_SIZE_OR_ZERO bpf: remove explicit handling of 0 for arg2 in bpf_probe_read bpf: introduce ARG_PTR_TO_MEM_OR_NULL i40evf: Use smp_rmb rather than read_barrier_depends fm10k: Use smp_rmb rather than read_barrier_depends igb: Use smp_rmb rather than read_barrier_depends ...
2 parents 36f20ee + 9ed3380 commit 1d3b78b

File tree

62 files changed

+995
-409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+995
-409
lines changed

drivers/net/dsa/bcm_sf2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void bcm_sf2_gphy_enable_set(struct dsa_switch *ds, bool enable)
9595
reg = reg_readl(priv, REG_SPHY_CNTRL);
9696
if (enable) {
9797
reg |= PHY_RESET;
98-
reg &= ~(EXT_PWR_DOWN | IDDQ_BIAS | CK25_DIS);
98+
reg &= ~(EXT_PWR_DOWN | IDDQ_BIAS | IDDQ_GLOBAL_PWR | CK25_DIS);
9999
reg_writel(priv, reg, REG_SPHY_CNTRL);
100100
udelay(21);
101101
reg = reg_readl(priv, REG_SPHY_CNTRL);

drivers/net/ethernet/intel/fm10k/fm10k_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ static bool fm10k_clean_tx_irq(struct fm10k_q_vector *q_vector,
12311231
break;
12321232

12331233
/* prevent any other reads prior to eop_desc */
1234-
read_barrier_depends();
1234+
smp_rmb();
12351235

12361236
/* if DD is not set pending work has not been completed */
12371237
if (!(eop_desc->flags & FM10K_TXD_FLAG_DONE))

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
#define I40E_AQ_LEN 256
9191
#define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */
9292
#define I40E_MAX_USER_PRIORITY 8
93-
#define I40E_MAX_QUEUES_PER_CH 64
9493
#define I40E_DEFAULT_TRAFFIC_CLASS BIT(0)
9594
#define I40E_DEFAULT_MSG_ENABLE 4
9695
#define I40E_QUEUE_WAIT_RETRY_LIMIT 10

drivers/net/ethernet/intel/i40e/i40e_adminq.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,12 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
613613
hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
614614
}
615615

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+
616622
/* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */
617623
if (hw->aq.api_maj_ver > 1 ||
618624
(hw->aq.api_maj_ver == 1 &&

drivers/net/ethernet/intel/i40e/i40e_common.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,8 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw)
948948
hw->pf_id = (u8)(func_rid & 0x7);
949949

950950
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;
952953

953954
status = i40e_init_nvm(hw);
954955
return status;
@@ -1268,6 +1269,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
12681269
* we don't need to do the PF Reset
12691270
*/
12701271
if (!cnt) {
1272+
u32 reg2 = 0;
12711273
if (hw->revision_id == 0)
12721274
cnt = I40E_PF_RESET_WAIT_COUNT_A0;
12731275
else
@@ -1279,6 +1281,12 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
12791281
reg = rd32(hw, I40E_PFGEN_CTRL);
12801282
if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK))
12811283
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+
}
12821290
usleep_range(1000, 2000);
12831291
}
12841292
if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) {

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 84 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,6 +2166,73 @@ i40e_aqc_broadcast_filter(struct i40e_vsi *vsi, const char *vsi_name,
21662166
return aq_ret;
21672167
}
21682168

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+
**/
2178+
static 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+
21692236
/**
21702237
* i40e_sync_vsi_filters - Update the VSI filter list to the HW
21712238
* @vsi: ptr to the VSI
@@ -2467,81 +2534,16 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
24672534
cur_promisc = (!!(vsi->current_netdev_flags & IFF_PROMISC) ||
24682535
test_bit(__I40E_VSI_OVERFLOW_PROMISC,
24692536
vsi->state));
2470-
if ((vsi->type == I40E_VSI_MAIN) &&
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+
aq_ret = i40e_set_promiscuous(pf, cur_promisc);
25372538
if (aq_ret) {
25382539
retval = i40e_aq_rc_to_posix(aq_ret,
2539-
pf->hw.aq.asq_last_status);
2540+
hw->aq.asq_last_status);
25402541
dev_info(&pf->pdev->dev,
2541-
"set brdcast promisc failed, err %s, aq_err %s\n",
2542-
i40e_stat_str(hw, aq_ret),
2543-
i40e_aq_str(hw,
2544-
hw->aq.asq_last_status));
2542+
"Setting promiscuous %s failed on %s, err %s aq_err %s\n",
2543+
cur_promisc ? "on" : "off",
2544+
vsi_name,
2545+
i40e_stat_str(hw, aq_ret),
2546+
i40e_aq_str(hw, hw->aq.asq_last_status));
25452547
}
25462548
}
25472549
out:
@@ -3964,7 +3966,7 @@ static bool i40e_clean_fdir_tx_irq(struct i40e_ring *tx_ring, int budget)
39643966
break;
39653967

39663968
/* prevent any other reads prior to eop_desc */
3967-
read_barrier_depends();
3969+
smp_rmb();
39683970

39693971
/* if the descriptor isn't done, no work yet to do */
39703972
if (!(eop_desc->cmd_type_offset_bsz &
@@ -5629,14 +5631,6 @@ static int i40e_validate_num_queues(struct i40e_pf *pf, int num_queues,
56295631
return -EINVAL;
56305632

56315633
*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-
56405634
if (vsi->current_rss_size) {
56415635
if (num_queues > vsi->current_rss_size) {
56425636
dev_dbg(&pf->pdev->dev,
@@ -9429,6 +9423,15 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
94299423
if (!lock_acquired)
94309424
rtnl_unlock();
94319425

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+
94329435
i40e_reset_all_vfs(pf, true);
94339436

94349437
/* tell the firmware that we're starting */

drivers/net/ethernet/intel/i40e/i40e_nvm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,17 @@ static i40e_status __i40e_read_nvm_word(struct i40e_hw *hw,
328328
i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
329329
u16 *data)
330330
{
331-
i40e_status ret_code;
331+
i40e_status ret_code = 0;
332332

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);
334335
if (ret_code)
335336
return ret_code;
336337

337338
ret_code = __i40e_read_nvm_word(hw, offset, data);
338339

339-
i40e_release_nvm(hw);
340+
if (hw->flags & I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK)
341+
i40e_release_nvm(hw);
340342

341343
return ret_code;
342344
}

drivers/net/ethernet/intel/i40e/i40e_txrx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
759759
break;
760760

761761
/* prevent any other reads prior to eop_desc */
762-
read_barrier_depends();
762+
smp_rmb();
763763

764764
i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);
765765
/* we have caught up to head, no work left to do */

drivers/net/ethernet/intel/i40e/i40e_type.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ struct i40e_hw {
629629
#define I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE BIT_ULL(0)
630630
#define I40E_HW_FLAG_802_1AD_CAPABLE BIT_ULL(1)
631631
#define I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE BIT_ULL(2)
632+
#define I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK BIT_ULL(3)
632633
u64 flags;
633634

634635
/* Used in set switch config AQ command */

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,18 +2218,19 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
22182218
struct i40e_mac_filter *f;
22192219

22202220
f = i40e_find_mac(vsi, al->list[i].addr);
2221-
if (!f)
2221+
if (!f) {
22222222
f = i40e_add_mac_filter(vsi, al->list[i].addr);
22232223

2224-
if (!f) {
2225-
dev_err(&pf->pdev->dev,
2226-
"Unable to add MAC filter %pM for VF %d\n",
2227-
al->list[i].addr, vf->vf_id);
2228-
ret = I40E_ERR_PARAM;
2229-
spin_unlock_bh(&vsi->mac_filter_hash_lock);
2230-
goto error_param;
2231-
} else {
2232-
vf->num_mac++;
2224+
if (!f) {
2225+
dev_err(&pf->pdev->dev,
2226+
"Unable to add MAC filter %pM for VF %d\n",
2227+
al->list[i].addr, vf->vf_id);
2228+
ret = I40E_ERR_PARAM;
2229+
spin_unlock_bh(&vsi->mac_filter_hash_lock);
2230+
goto error_param;
2231+
} else {
2232+
vf->num_mac++;
2233+
}
22332234
}
22342235
}
22352236
spin_unlock_bh(&vsi->mac_filter_hash_lock);

0 commit comments

Comments
 (0)