Skip to content

Commit 2607c09

Browse files
committed
Merge branch '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2026-04-06 (idpf, ice, ixgbe, ixgbevf, igb, e1000) Emil converts to use spinlock_t for virtchnl transactions to make consistent use of the xn_bm_lock when accessing the free_xn_bm bitmap, while also avoiding nested raw/bh spinlock issue on PREEMPT_RT kernels. He also sets payload size before calling the async handler, to make sure it doesn't error out prematurely due to invalid size check for idpf. Kohei Enju changes WARN_ON for missing PTP control PF to a dev_info() on ice as there are cases where this is expected and acceptable. Petr Oros fixes conditions in which error paths failed to call ice_ptp_port_phy_restart() breaking PTP functionality on ice. Alex significantly reduces reporting of driver information, and time under RTNL locl, on ixgbe e610 devices by reducing reads of flash info only on events that could change it. Michal Schmidt adds missing Hyper-V op on ixgbevf. Alex Dvoretsky removes call to napi_synchronize() in igb_down() to resolve a deadlock. Agalakov Daniil adds error check on e1000 for failed EEPROM read. * '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: e1000: check return value of e1000_read_eeprom igb: remove napi_synchronize() in igb_down() ixgbevf: add missing negotiate_features op to Hyper-V ops table ixgbe: stop re-reading flash on every get_drvinfo for e610 ice: fix PTP timestamping broken by SyncE code on E825C ice: ptp: don't WARN when controlling PF is unavailable idpf: set the payload size before calling the async handler idpf: improve locking around idpf_vc_xn_push_free() idpf: fix PREEMPT_RT raw/bh spinlock nesting for async VC handling ==================== Link: https://patch.msgid.link/20260406213038.444732-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 30f3b76 + d3baa34 commit 2607c09

10 files changed

Lines changed: 67 additions & 33 deletions

File tree

drivers/net/ethernet/intel/e1000/e1000_ethtool.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,14 +496,19 @@ static int e1000_set_eeprom(struct net_device *netdev,
496496
*/
497497
ret_val = e1000_read_eeprom(hw, first_word, 1,
498498
&eeprom_buff[0]);
499+
if (ret_val)
500+
goto out;
501+
499502
ptr++;
500503
}
501-
if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) {
504+
if ((eeprom->offset + eeprom->len) & 1) {
502505
/* need read/modify/write of last changed EEPROM word
503506
* only the first byte of the word is being modified
504507
*/
505508
ret_val = e1000_read_eeprom(hw, last_word, 1,
506509
&eeprom_buff[last_word - first_word]);
510+
if (ret_val)
511+
goto out;
507512
}
508513

509514
/* Device's eeprom is always little-endian, word addressable */
@@ -522,6 +527,7 @@ static int e1000_set_eeprom(struct net_device *netdev,
522527
if ((ret_val == 0) && (first_word <= EEPROM_CHECKSUM_REG))
523528
e1000_update_eeprom_checksum(hw);
524529

530+
out:
525531
kfree(eeprom_buff);
526532
return ret_val;
527533
}

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

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,12 +1296,10 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
12961296
if (pf->hw.reset_ongoing)
12971297
return;
12981298

1299-
if (hw->mac_type == ICE_MAC_GENERIC_3K_E825) {
1299+
if (hw->mac_type == ICE_MAC_GENERIC_3K_E825 &&
1300+
test_bit(ICE_FLAG_DPLL, pf->flags)) {
13001301
int pin, err;
13011302

1302-
if (!test_bit(ICE_FLAG_DPLL, pf->flags))
1303-
return;
1304-
13051303
mutex_lock(&pf->dplls.lock);
13061304
for (pin = 0; pin < ICE_SYNCE_CLK_NUM; pin++) {
13071305
enum ice_synce_clk clk_pin;
@@ -1314,15 +1312,19 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
13141312
port_num,
13151313
&active,
13161314
clk_pin);
1317-
if (WARN_ON_ONCE(err)) {
1318-
mutex_unlock(&pf->dplls.lock);
1319-
return;
1315+
if (err) {
1316+
dev_err_once(ice_pf_to_dev(pf),
1317+
"Failed to read SyncE bypass mux for pin %d, err %d\n",
1318+
pin, err);
1319+
break;
13201320
}
13211321

13221322
err = ice_tspll_cfg_synce_ethdiv_e825c(hw, clk_pin);
1323-
if (active && WARN_ON_ONCE(err)) {
1324-
mutex_unlock(&pf->dplls.lock);
1325-
return;
1323+
if (active && err) {
1324+
dev_err_once(ice_pf_to_dev(pf),
1325+
"Failed to configure SyncE ETH divider for pin %d, err %d\n",
1326+
pin, err);
1327+
break;
13261328
}
13271329
}
13281330
mutex_unlock(&pf->dplls.lock);
@@ -3080,7 +3082,13 @@ static int ice_ptp_setup_pf(struct ice_pf *pf)
30803082
struct ice_ptp *ctrl_ptp = ice_get_ctrl_ptp(pf);
30813083
struct ice_ptp *ptp = &pf->ptp;
30823084

3083-
if (WARN_ON(!ctrl_ptp) || pf->hw.mac_type == ICE_MAC_UNKNOWN)
3085+
if (!ctrl_ptp) {
3086+
dev_info(ice_pf_to_dev(pf),
3087+
"PTP unavailable: no controlling PF\n");
3088+
return -EOPNOTSUPP;
3089+
}
3090+
3091+
if (pf->hw.mac_type == ICE_MAC_UNKNOWN)
30843092
return -ENODEV;
30853093

30863094
INIT_LIST_HEAD(&ptp->port.list_node);

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,26 +287,21 @@ int idpf_send_mb_msg(struct idpf_adapter *adapter, struct idpf_ctlq_info *asq,
287287
return err;
288288
}
289289

290-
/* API for virtchnl "transaction" support ("xn" for short).
291-
*
292-
* We are reusing the completion lock to serialize the accesses to the
293-
* transaction state for simplicity, but it could be its own separate synchro
294-
* as well. For now, this API is only used from within a workqueue context;
295-
* raw_spin_lock() is enough.
296-
*/
290+
/* API for virtchnl "transaction" support ("xn" for short). */
291+
297292
/**
298293
* idpf_vc_xn_lock - Request exclusive access to vc transaction
299294
* @xn: struct idpf_vc_xn* to access
300295
*/
301296
#define idpf_vc_xn_lock(xn) \
302-
raw_spin_lock(&(xn)->completed.wait.lock)
297+
spin_lock(&(xn)->lock)
303298

304299
/**
305300
* idpf_vc_xn_unlock - Release exclusive access to vc transaction
306301
* @xn: struct idpf_vc_xn* to access
307302
*/
308303
#define idpf_vc_xn_unlock(xn) \
309-
raw_spin_unlock(&(xn)->completed.wait.lock)
304+
spin_unlock(&(xn)->lock)
310305

311306
/**
312307
* idpf_vc_xn_release_bufs - Release reference to reply buffer(s) and
@@ -338,6 +333,7 @@ static void idpf_vc_xn_init(struct idpf_vc_xn_manager *vcxn_mngr)
338333
xn->state = IDPF_VC_XN_IDLE;
339334
xn->idx = i;
340335
idpf_vc_xn_release_bufs(xn);
336+
spin_lock_init(&xn->lock);
341337
init_completion(&xn->completed);
342338
}
343339

@@ -406,7 +402,9 @@ static void idpf_vc_xn_push_free(struct idpf_vc_xn_manager *vcxn_mngr,
406402
struct idpf_vc_xn *xn)
407403
{
408404
idpf_vc_xn_release_bufs(xn);
405+
spin_lock_bh(&vcxn_mngr->xn_bm_lock);
409406
set_bit(xn->idx, vcxn_mngr->free_xn_bm);
407+
spin_unlock_bh(&vcxn_mngr->xn_bm_lock);
410408
}
411409

412410
/**
@@ -617,6 +615,10 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter,
617615
err = -ENXIO;
618616
goto out_unlock;
619617
case IDPF_VC_XN_ASYNC:
618+
/* Set reply_sz from the actual payload so that async_handler
619+
* can evaluate the response.
620+
*/
621+
xn->reply_sz = ctlq_msg->data_len;
620622
err = idpf_vc_xn_forward_async(adapter, xn, ctlq_msg);
621623
idpf_vc_xn_unlock(xn);
622624
return err;

drivers/net/ethernet/intel/idpf/idpf_virtchnl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ typedef int (*async_vc_cb) (struct idpf_adapter *, struct idpf_vc_xn *,
4242
* struct idpf_vc_xn - Data structure representing virtchnl transactions
4343
* @completed: virtchnl event loop uses that to signal when a reply is
4444
* available, uses kernel completion API
45-
* @state: virtchnl event loop stores the data below, protected by the
46-
* completion's lock.
45+
* @lock: protects the transaction state fields below
46+
* @state: virtchnl event loop stores the data below, protected by @lock
4747
* @reply_sz: Original size of reply, may be > reply_buf.iov_len; it will be
4848
* truncated on its way to the receiver thread according to
4949
* reply_buf.iov_len.
@@ -58,6 +58,7 @@ typedef int (*async_vc_cb) (struct idpf_adapter *, struct idpf_vc_xn *,
5858
*/
5959
struct idpf_vc_xn {
6060
struct completion completed;
61+
spinlock_t lock;
6162
enum idpf_vc_xn_state state;
6263
size_t reply_sz;
6364
struct kvec reply;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,9 +2203,8 @@ void igb_down(struct igb_adapter *adapter)
22032203

22042204
for (i = 0; i < adapter->num_q_vectors; i++) {
22052205
if (adapter->q_vector[i]) {
2206-
napi_synchronize(&adapter->q_vector[i]->napi);
2207-
igb_set_queue_napi(adapter, i, NULL);
22082206
napi_disable(&adapter->q_vector[i]->napi);
2207+
igb_set_queue_napi(adapter, i, NULL);
22092208
}
22102209
}
22112210

drivers/net/ethernet/intel/ixgbe/devlink/devlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ static int ixgbe_devlink_reload_empr_finish(struct devlink *devlink,
474474
adapter->flags2 &= ~(IXGBE_FLAG2_API_MISMATCH |
475475
IXGBE_FLAG2_FW_ROLLBACK);
476476

477-
return 0;
477+
return ixgbe_refresh_fw_version(adapter);
478478
}
479479

480480
static const struct devlink_ops ixgbe_devlink_ops = {

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter);
973973
bool ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
974974
u16 subdevice_id);
975975
void ixgbe_set_fw_version_e610(struct ixgbe_adapter *adapter);
976-
void ixgbe_refresh_fw_version(struct ixgbe_adapter *adapter);
976+
int ixgbe_refresh_fw_version(struct ixgbe_adapter *adapter);
977977
#ifdef CONFIG_PCI_IOV
978978
void ixgbe_full_sync_mac_table(struct ixgbe_adapter *adapter);
979979
#endif

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,23 +1155,24 @@ static int ixgbe_set_eeprom(struct net_device *netdev,
11551155
return ret_val;
11561156
}
11571157

1158-
void ixgbe_refresh_fw_version(struct ixgbe_adapter *adapter)
1158+
int ixgbe_refresh_fw_version(struct ixgbe_adapter *adapter)
11591159
{
11601160
struct ixgbe_hw *hw = &adapter->hw;
1161+
int err;
1162+
1163+
err = ixgbe_get_flash_data(hw);
1164+
if (err)
1165+
return err;
11611166

1162-
ixgbe_get_flash_data(hw);
11631167
ixgbe_set_fw_version_e610(adapter);
1168+
return 0;
11641169
}
11651170

11661171
static void ixgbe_get_drvinfo(struct net_device *netdev,
11671172
struct ethtool_drvinfo *drvinfo)
11681173
{
11691174
struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev);
11701175

1171-
/* need to refresh info for e610 in case fw reloads in runtime */
1172-
if (adapter->hw.mac.type == ixgbe_mac_e610)
1173-
ixgbe_refresh_fw_version(adapter);
1174-
11751176
strscpy(drvinfo->driver, ixgbe_driver_name, sizeof(drvinfo->driver));
11761177

11771178
strscpy(drvinfo->fw_version, adapter->eeprom_id,

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6289,6 +6289,16 @@ void ixgbe_reinit_locked(struct ixgbe_adapter *adapter)
62896289
if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)
62906290
msleep(2000);
62916291
ixgbe_up(adapter);
6292+
6293+
/* E610 has no FW event to notify all PFs of an EMPR reset, so
6294+
* refresh the FW version here to pick up any new FW version after
6295+
* a hardware reset (e.g. EMPR triggered by another PF's devlink
6296+
* reload). ixgbe_refresh_fw_version() updates both hw->flash and
6297+
* adapter->eeprom_id so ethtool -i reports the correct string.
6298+
*/
6299+
if (adapter->hw.mac.type == ixgbe_mac_e610)
6300+
(void)ixgbe_refresh_fw_version(adapter);
6301+
62926302
clear_bit(__IXGBE_RESETTING, &adapter->state);
62936303
}
62946304

drivers/net/ethernet/intel/ixgbevf/vf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,12 @@ static int ixgbevf_negotiate_features_vf(struct ixgbe_hw *hw, u32 *pf_features)
709709
return err;
710710
}
711711

712+
static int ixgbevf_hv_negotiate_features_vf(struct ixgbe_hw *hw,
713+
u32 *pf_features)
714+
{
715+
return -EOPNOTSUPP;
716+
}
717+
712718
/**
713719
* ixgbevf_set_vfta_vf - Set/Unset VLAN filter table address
714720
* @hw: pointer to the HW structure
@@ -1142,6 +1148,7 @@ static const struct ixgbe_mac_operations ixgbevf_hv_mac_ops = {
11421148
.setup_link = ixgbevf_setup_mac_link_vf,
11431149
.check_link = ixgbevf_hv_check_mac_link_vf,
11441150
.negotiate_api_version = ixgbevf_hv_negotiate_api_version_vf,
1151+
.negotiate_features = ixgbevf_hv_negotiate_features_vf,
11451152
.set_rar = ixgbevf_hv_set_rar_vf,
11461153
.update_mc_addr_list = ixgbevf_hv_update_mc_addr_list_vf,
11471154
.update_xcast_mode = ixgbevf_hv_update_xcast_mode,

0 commit comments

Comments
 (0)