Skip to content

Commit a354733

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2024-10-08 (ice, i40e, igb, e1000e) This series contains updates to ice, i40e, igb, and e1000e drivers. For ice: Marcin allows driver to load, into safe mode, when DDP package is missing or corrupted and adjusts the netif_is_ice() check to account for when the device is in safe mode. He also fixes an out-of-bounds issue when MSI-X are increased for VFs. Wojciech clears FDB entries on reset to match the hardware state. For i40e: Aleksandr adds locking around MACVLAN filters to prevent memory leaks due to concurrency issues. For igb: Mohamed Khalfella adds a check to not attempt to bring up an already running interface on non-fatal PCIe errors. For e1000e: Vitaly changes board type for I219 to more closely match the hardware and stop PHY issues. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: e1000e: change I219 (19) devices to ADP igb: Do not bring the device up after non-fatal error i40e: Fix macvlan leak by synchronizing access to mac_filter_hash ice: Fix increasing MSI-X on VF ice: Flush FDB entries before reset ice: Fix netif_is_ice() in Safe Mode ice: Fix entering Safe Mode ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 5151a35 + 9d9e534 commit a354733

File tree

11 files changed

+31
-35
lines changed

11 files changed

+31
-35
lines changed

drivers/net/ethernet/intel/e1000e/hw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ struct e1000_hw;
108108
#define E1000_DEV_ID_PCH_RPL_I219_V22 0x0DC8
109109
#define E1000_DEV_ID_PCH_MTP_I219_LM18 0x550A
110110
#define E1000_DEV_ID_PCH_MTP_I219_V18 0x550B
111-
#define E1000_DEV_ID_PCH_MTP_I219_LM19 0x550C
112-
#define E1000_DEV_ID_PCH_MTP_I219_V19 0x550D
111+
#define E1000_DEV_ID_PCH_ADP_I219_LM19 0x550C
112+
#define E1000_DEV_ID_PCH_ADP_I219_V19 0x550D
113113
#define E1000_DEV_ID_PCH_LNP_I219_LM20 0x550E
114114
#define E1000_DEV_ID_PCH_LNP_I219_V20 0x550F
115115
#define E1000_DEV_ID_PCH_LNP_I219_LM21 0x5510

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7899,10 +7899,10 @@ static const struct pci_device_id e1000_pci_tbl[] = {
78997899
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V17), board_pch_adp },
79007900
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM22), board_pch_adp },
79017901
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V22), board_pch_adp },
7902+
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM19), board_pch_adp },
7903+
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V19), board_pch_adp },
79027904
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM18), board_pch_mtp },
79037905
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V18), board_pch_mtp },
7904-
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM19), board_pch_mtp },
7905-
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V19), board_pch_mtp },
79067906
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM20), board_pch_mtp },
79077907
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V20), board_pch_mtp },
79087908
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM21), board_pch_mtp },

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,7 @@ struct i40e_mac_filter *i40e_add_mac_filter(struct i40e_vsi *vsi,
17341734
struct hlist_node *h;
17351735
int bkt;
17361736

1737+
lockdep_assert_held(&vsi->mac_filter_hash_lock);
17371738
if (vsi->info.pvid)
17381739
return i40e_add_filter(vsi, macaddr,
17391740
le16_to_cpu(vsi->info.pvid));

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,8 +2213,10 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
22132213
vfres->vsi_res[0].qset_handle
22142214
= le16_to_cpu(vsi->info.qs_handle[0]);
22152215
if (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_USO) && !vf->pf_set_mac) {
2216+
spin_lock_bh(&vsi->mac_filter_hash_lock);
22162217
i40e_del_mac_filter(vsi, vf->default_lan_addr.addr);
22172218
eth_zero_addr(vf->default_lan_addr.addr);
2219+
spin_unlock_bh(&vsi->mac_filter_hash_lock);
22182220
}
22192221
ether_addr_copy(vfres->vsi_res[0].default_mac_addr,
22202222
vf->default_lan_addr.addr);

drivers/net/ethernet/intel/ice/ice_eswitch_br.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,13 @@ ice_eswitch_br_switchdev_event(struct notifier_block *nb,
582582
return NOTIFY_DONE;
583583
}
584584

585-
static void ice_eswitch_br_fdb_flush(struct ice_esw_br *bridge)
585+
void ice_eswitch_br_fdb_flush(struct ice_esw_br *bridge)
586586
{
587587
struct ice_esw_br_fdb_entry *entry, *tmp;
588588

589+
if (!bridge)
590+
return;
591+
589592
list_for_each_entry_safe(entry, tmp, &bridge->fdb_list, list)
590593
ice_eswitch_br_fdb_entry_notify_and_cleanup(bridge, entry);
591594
}

drivers/net/ethernet/intel/ice/ice_eswitch_br.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@ void
117117
ice_eswitch_br_offloads_deinit(struct ice_pf *pf);
118118
int
119119
ice_eswitch_br_offloads_init(struct ice_pf *pf);
120+
void ice_eswitch_br_fdb_flush(struct ice_esw_br *bridge);
120121

121122
#endif /* _ICE_ESWITCH_BR_H_ */

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ ice_indr_setup_tc_cb(struct net_device *netdev, struct Qdisc *sch,
8787

8888
bool netif_is_ice(const struct net_device *dev)
8989
{
90-
return dev && (dev->netdev_ops == &ice_netdev_ops);
90+
return dev && (dev->netdev_ops == &ice_netdev_ops ||
91+
dev->netdev_ops == &ice_netdev_safe_mode_ops);
9192
}
9293

9394
/**
@@ -520,25 +521,6 @@ static void ice_pf_dis_all_vsi(struct ice_pf *pf, bool locked)
520521
pf->vf_agg_node[node].num_vsis = 0;
521522
}
522523

523-
/**
524-
* ice_clear_sw_switch_recipes - clear switch recipes
525-
* @pf: board private structure
526-
*
527-
* Mark switch recipes as not created in sw structures. There are cases where
528-
* rules (especially advanced rules) need to be restored, either re-read from
529-
* hardware or added again. For example after the reset. 'recp_created' flag
530-
* prevents from doing that and need to be cleared upfront.
531-
*/
532-
static void ice_clear_sw_switch_recipes(struct ice_pf *pf)
533-
{
534-
struct ice_sw_recipe *recp;
535-
u8 i;
536-
537-
recp = pf->hw.switch_info->recp_list;
538-
for (i = 0; i < ICE_MAX_NUM_RECIPES; i++)
539-
recp[i].recp_created = false;
540-
}
541-
542524
/**
543525
* ice_prepare_for_reset - prep for reset
544526
* @pf: board private structure
@@ -575,8 +557,9 @@ ice_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
575557
mutex_unlock(&pf->vfs.table_lock);
576558

577559
if (ice_is_eswitch_mode_switchdev(pf)) {
578-
if (reset_type != ICE_RESET_PFR)
579-
ice_clear_sw_switch_recipes(pf);
560+
rtnl_lock();
561+
ice_eswitch_br_fdb_flush(pf->eswitch.br_offloads->bridge);
562+
rtnl_unlock();
580563
}
581564

582565
/* release ADQ specific HW and SW resources */
@@ -4767,14 +4750,12 @@ int ice_init_dev(struct ice_pf *pf)
47674750
ice_init_feature_support(pf);
47684751

47694752
err = ice_init_ddp_config(hw, pf);
4770-
if (err)
4771-
return err;
47724753

47734754
/* if ice_init_ddp_config fails, ICE_FLAG_ADV_FEATURES bit won't be
47744755
* set in pf->state, which will cause ice_is_safe_mode to return
47754756
* true
47764757
*/
4777-
if (ice_is_safe_mode(pf)) {
4758+
if (err || ice_is_safe_mode(pf)) {
47784759
/* we already got function/device capabilities but these don't
47794760
* reflect what the driver needs to do in safe mode. Instead of
47804761
* adding conditional logic everywhere to ignore these

drivers/net/ethernet/intel/ice/ice_sriov.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
11211121
if (vf->first_vector_idx < 0)
11221122
goto unroll;
11231123

1124-
if (ice_vf_reconfig_vsi(vf) || ice_vf_init_host_cfg(vf, vsi)) {
1124+
vsi->req_txq = queues;
1125+
vsi->req_rxq = queues;
1126+
1127+
if (ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT)) {
11251128
/* Try to rebuild with previous values */
11261129
needs_rebuild = true;
11271130
goto unroll;
@@ -1150,8 +1153,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
11501153
}
11511154

11521155
if (needs_rebuild) {
1153-
ice_vf_reconfig_vsi(vf);
1154-
ice_vf_init_host_cfg(vf, vsi);
1156+
vsi->req_txq = prev_queues;
1157+
vsi->req_rxq = prev_queues;
1158+
1159+
ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
11551160
}
11561161

11571162
ice_ena_vf_mappings(vf);

drivers/net/ethernet/intel/ice/ice_vf_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ static void ice_vf_pre_vsi_rebuild(struct ice_vf *vf)
256256
*
257257
* It brings the VSI down and then reconfigures it with the hardware.
258258
*/
259-
int ice_vf_reconfig_vsi(struct ice_vf *vf)
259+
static int ice_vf_reconfig_vsi(struct ice_vf *vf)
260260
{
261261
struct ice_vsi *vsi = ice_get_vf_vsi(vf);
262262
struct ice_pf *pf = vf->pf;

drivers/net/ethernet/intel/ice/ice_vf_lib_private.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#warning "Only include ice_vf_lib_private.h in CONFIG_PCI_IOV virtualization files"
2424
#endif
2525

26-
int ice_vf_reconfig_vsi(struct ice_vf *vf);
2726
void ice_initialize_vf_entry(struct ice_vf *vf);
2827
void ice_dis_vf_qs(struct ice_vf *vf);
2928
int ice_check_vf_init(struct ice_vf *vf);

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9651,6 +9651,10 @@ static void igb_io_resume(struct pci_dev *pdev)
96519651
struct igb_adapter *adapter = netdev_priv(netdev);
96529652

96539653
if (netif_running(netdev)) {
9654+
if (!test_bit(__IGB_DOWN, &adapter->state)) {
9655+
dev_dbg(&pdev->dev, "Resuming from non-fatal error, do nothing.\n");
9656+
return;
9657+
}
96549658
if (igb_up(adapter)) {
96559659
dev_err(&pdev->dev, "igb_up failed after reset\n");
96569660
return;

0 commit comments

Comments
 (0)