From 711bdf0b787964a836a40022fe519e608b1d63f3 Mon Sep 17 00:00:00 2001 From: Marco Crivellari Date: Tue, 9 Jun 2026 14:35:42 -0700 Subject: [PATCH 01/14] idpf: Replace use of system_unbound_wq with system_dfl_wq This patch continues the effort to refactor workqueue APIs, which has begun with the changes introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The point of the refactoring is to eventually alter the default behavior of workqueues to become unbound by default so that their workload placement is optimized by the scheduler. Before that to happen, workqueue users must be converted to the better named new workqueues with no intended behaviour changes: system_wq -> system_percpu_wq system_unbound_wq -> system_dfl_wq This way the old obsolete workqueues (system_wq, system_unbound_wq) can be removed in the future. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari Reviewed-by: Przemek Kitszel Tested-by: Samuel Salin Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-2-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c index f6b3b15364ff..7f9056404f64 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@ -2022,7 +2022,7 @@ static void idpf_tx_read_tstamp(struct idpf_tx_queue *txq, struct sk_buff *skb) /* Fetch timestamp from completion descriptor through * virtchnl msg to report to stack. */ - queue_work(system_unbound_wq, txq->tstamp_task); + queue_work(system_dfl_wq, txq->tstamp_task); break; } From e5652e6d37fecee637a54fb49e60047d9c752079 Mon Sep 17 00:00:00 2001 From: Natalia Wochtman Date: Tue, 9 Jun 2026 14:35:43 -0700 Subject: [PATCH 02/14] ice: remove redundant checks from PTP init Remove unnecessary condition checks in ice_ptp_setup_adapter() and ice_ptp_init(). They are duplicated in ice_pf_src_tmr_owned(). Change ice_ptp_setup_adapter() to return void. Reviewed-by: Przemek Kitszel Reviewed-by: Aleksandr Loktionov Signed-off-by: Natalia Wochtman Tested-by: Rinitha S (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-3-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/ice/ice_ptp.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 380833a24327..485f63134b6a 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -3058,14 +3058,9 @@ void ice_ptp_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type) dev_err(ice_pf_to_dev(pf), "PTP reset failed %d\n", err); } -static int ice_ptp_setup_adapter(struct ice_pf *pf) +static void ice_ptp_setup_adapter(struct ice_pf *pf) { - if (!ice_pf_src_tmr_owned(pf) || !ice_is_primary(&pf->hw)) - return -EPERM; - pf->adapter->ctrl_pf = pf; - - return 0; } static int ice_ptp_setup_pf(struct ice_pf *pf) @@ -3323,10 +3318,9 @@ void ice_ptp_init(struct ice_pf *pf) /* If this function owns the clock hardware, it must allocate and * configure the PTP clock device to represent it. */ - if (ice_pf_src_tmr_owned(pf) && ice_is_primary(hw)) { - err = ice_ptp_setup_adapter(pf); - if (err) - goto err_exit; + if (ice_pf_src_tmr_owned(pf)) { + ice_ptp_setup_adapter(pf); + err = ice_ptp_init_owner(pf); if (err) goto err_exit; From 8538aaea10e141457bcb13d51b0d278c697c422a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 9 Jun 2026 14:35:44 -0700 Subject: [PATCH 03/14] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test This is just a simple cleanup fix. Commit 35a2443d0910f ("iavf: Add waiting for response from PF in set mac") introduced a duplicate ether_addr_equal() check, so the current code tests the new MAC twice against the former MAC. Remove the outer ether_addr_equal() test, remnant of commit c5c922b3e09b ("iavf: fix MAC address setting for VFs when filter is rejected") Signed-off-by: Corinna Vinschen Reviewed-by: Aleksandr Loktionov Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-4-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c index 4f2defd2331b..ec234cc8bd9d 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c @@ -2550,13 +2550,11 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, case VIRTCHNL_OP_ADD_ETH_ADDR: if (!v_retval) iavf_mac_add_ok(adapter); - if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr)) - if (!ether_addr_equal(netdev->dev_addr, - adapter->hw.mac.addr)) { - netif_addr_lock_bh(netdev); - eth_hw_addr_set(netdev, adapter->hw.mac.addr); - netif_addr_unlock_bh(netdev); - } + if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr)) { + netif_addr_lock_bh(netdev); + eth_hw_addr_set(netdev, adapter->hw.mac.addr); + netif_addr_unlock_bh(netdev); + } wake_up(&adapter->vc_waitqueue); break; case VIRTCHNL_OP_GET_STATS: { From 48d588dc9f26baabe18c1efcce9240b42b02046f Mon Sep 17 00:00:00 2001 From: Jakub Raczynski Date: Tue, 9 Jun 2026 14:35:45 -0700 Subject: [PATCH 04/14] net/intel: Replace manual array size calculation with ARRAY_SIZE There are still places in the code where manual calculation of array size exist, but it is good to enforce usage of single macro through the whole code as it makes code bit more readable. While at it, beautify condition surrounding it by reversing check and remove unnecessary casting. Signed-off-by: Jakub Raczynski Reviewed-by: Dan Carpenter Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-5-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/i40e/i40e_adminq.h | 2 +- drivers/net/ethernet/intel/iavf/iavf_adminq.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.h b/drivers/net/ethernet/intel/i40e/i40e_adminq.h index 1be97a3a86ce..dcf3baec7b73 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.h @@ -109,7 +109,7 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc) -EFBIG, /* I40E_AQ_RC_EFBIG */ }; - if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0])))) + if (aq_rc >= ARRAY_SIZE(aq_to_posix)) return -ERANGE; return aq_to_posix[aq_rc]; diff --git a/drivers/net/ethernet/intel/iavf/iavf_adminq.h b/drivers/net/ethernet/intel/iavf/iavf_adminq.h index bbf5c4b3a2ae..dd2f61172157 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_adminq.h +++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.h @@ -113,7 +113,7 @@ static inline int iavf_aq_rc_to_posix(int aq_ret, int aq_rc) if (aq_ret == IAVF_ERR_ADMIN_QUEUE_TIMEOUT) return -EAGAIN; - if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0])))) + if (aq_rc >= ARRAY_SIZE(aq_to_posix)) return -ERANGE; return aq_to_posix[aq_rc]; From 06be82a0d9d7e9f0b74a53838b82174f125e2847 Mon Sep 17 00:00:00 2001 From: Piotr Kwapulinski Date: Tue, 9 Jun 2026 14:35:46 -0700 Subject: [PATCH 05/14] ixgbe: e610: remove redundant assignment Remove unnecessary code. No functional impact. Signed-off-by: Piotr Kwapulinski Reviewed-by: Aleksandr Loktionov Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-6-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c index 665a9813e251..4d8ae5b56145 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c @@ -142,20 +142,14 @@ static int ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw, IXGBE_PF_HICR); /* Read sync Admin Command response */ - if ((hicr & IXGBE_PF_HICR_SV)) { - for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++) { + if ((hicr & IXGBE_PF_HICR_SV)) + for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++) raw_desc[i] = IXGBE_READ_REG(hw, IXGBE_PF_HIDA(i)); - raw_desc[i] = raw_desc[i]; - } - } /* Read async Admin Command response */ - if ((hicr & IXGBE_PF_HICR_EV) && !(hicr & IXGBE_PF_HICR_C)) { - for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++) { + if ((hicr & IXGBE_PF_HICR_EV) && !(hicr & IXGBE_PF_HICR_C)) + for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++) raw_desc[i] = IXGBE_READ_REG(hw, IXGBE_PF_HIDA_2(i)); - raw_desc[i] = raw_desc[i]; - } - } /* Handle timeout and invalid state of HICR register */ if (hicr & IXGBE_PF_HICR_C) From 2040b8ba371bf970ef29b99b1e971f9b0e6bdc1a Mon Sep 17 00:00:00 2001 From: Aleksandr Loktionov Date: Tue, 9 Jun 2026 14:35:48 -0700 Subject: [PATCH 06/14] igb: use ktime_get_real helpers in igb_ptp_reset() Replace ktime_to_ns(ktime_get_real()) with the direct equivalent ktime_get_real_ns() and ktime_to_timespec64(ktime_get_real()) with ktime_get_real_ts64() in igb_ptp_reset(). Using the combined helpers makes the intent clearer. Suggested-by: Jacob Keller Suggested-by: Simon Horman Reviewed-by: Paul Menzel Signed-off-by: Aleksandr Loktionov Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-8-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/igb/igb_ptp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index bd85d02ecadd..638d8242b66b 100644 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c @@ -1500,12 +1500,13 @@ void igb_ptp_reset(struct igb_adapter *adapter) /* Re-initialize the timer. */ if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) { - struct timespec64 ts = ktime_to_timespec64(ktime_get_real()); + struct timespec64 ts; + ktime_get_real_ts64(&ts); igb_ptp_write_i210(adapter, &ts); } else { timecounter_init(&adapter->tc, &adapter->cc, - ktime_to_ns(ktime_get_real())); + ktime_get_real_ns()); } out: spin_unlock_irqrestore(&adapter->tmreg_lock, flags); From 1b4558e0b4e83b9d1aba1c85a69d4fba5948c5f3 Mon Sep 17 00:00:00 2001 From: Aleksandr Loktionov Date: Tue, 9 Jun 2026 14:35:49 -0700 Subject: [PATCH 07/14] e1000e: use ktime_get_real_ns() in e1000e_systim_reset() Replace ktime_to_ns(ktime_get_real()) with the direct equivalent ktime_get_real_ns() in e1000e_systim_reset(). Using the combined helper avoids the unnecessary intermediate ktime_t variable and makes the intent clearer. Suggested-by: Jacob Keller Suggested-by: Simon Horman Signed-off-by: Aleksandr Loktionov Tested-by: Avigail Dahan Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-9-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 5b7ba1594f0d..3bdeb5f0dbea 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -3943,7 +3943,7 @@ static void e1000e_systim_reset(struct e1000_adapter *adapter) /* reset the systim ns time counter */ spin_lock_irqsave(&adapter->systim_lock, flags); timecounter_init(&adapter->tc, &adapter->cc, - ktime_to_ns(ktime_get_real())); + ktime_get_real_ns()); spin_unlock_irqrestore(&adapter->systim_lock, flags); /* restore the previous hwtstamp configuration settings */ From ef298ba0f9edbe92d6178bf8377cea0f161c5f35 Mon Sep 17 00:00:00 2001 From: Daiki Harada Date: Tue, 9 Jun 2026 14:35:50 -0700 Subject: [PATCH 08/14] igb: use napi_schedule_irqoff() instead of napi_schedule() Replace napi_schedule() with napi_schedule_irqoff() in the interrupt handler path in igb driver Tested on QEMU with igb NIC emulation (-nic user,model=igb) Suggested-by: Kohei Enju Signed-off-by: Daiki Harada Reviewed-by: Aleksandr Loktionov Tested-by: Rinitha S (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-10-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/igb/igb_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 49d46670695f..a1e89a375744 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -7157,7 +7157,7 @@ static irqreturn_t igb_msix_ring(int irq, void *data) /* Write the ITR value calculated from the previous interrupt. */ igb_write_itr(q_vector); - napi_schedule(&q_vector->napi); + napi_schedule_irqoff(&q_vector->napi); return IRQ_HANDLED; } @@ -8198,7 +8198,7 @@ static irqreturn_t igb_intr_msi(int irq, void *data) if (icr & E1000_ICR_TS) igb_tsync_interrupt(adapter); - napi_schedule(&q_vector->napi); + napi_schedule_irqoff(&q_vector->napi); return IRQ_HANDLED; } @@ -8244,7 +8244,7 @@ static irqreturn_t igb_intr(int irq, void *data) if (icr & E1000_ICR_TS) igb_tsync_interrupt(adapter); - napi_schedule(&q_vector->napi); + napi_schedule_irqoff(&q_vector->napi); return IRQ_HANDLED; } From 046100cdeb98ef0c002920f46e700c70ad1d70a4 Mon Sep 17 00:00:00 2001 From: Daiki Harada Date: Tue, 9 Jun 2026 14:35:51 -0700 Subject: [PATCH 09/14] igc: use napi_schedule_irqoff() instead of napi_schedule() Replace napi_schedule() with napi_schedule_irqoff() in the interrupt handler path in igc driver Tested on Intel Corporation Ethernet Controller I226-V. Suggested-by: Kohei Enju Signed-off-by: Daiki Harada Reviewed-by: Aleksandr Loktionov Reviewed-by: Dima Ruinskiy Tested-by: Moriya Kadosh Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-11-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/igc/igc_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 89b9e1d00fc7..9143d591083f 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -5688,7 +5688,7 @@ static irqreturn_t igc_msix_ring(int irq, void *data) /* Write the ITR value calculated from the previous interrupt. */ igc_write_itr(q_vector); - napi_schedule(&q_vector->napi); + napi_schedule_irqoff(&q_vector->napi); return IRQ_HANDLED; } @@ -6059,7 +6059,7 @@ static irqreturn_t igc_intr_msi(int irq, void *data) if (icr & IGC_ICR_TS) igc_tsync_interrupt(adapter); - napi_schedule(&q_vector->napi); + napi_schedule_irqoff(&q_vector->napi); return IRQ_HANDLED; } @@ -6105,7 +6105,7 @@ static irqreturn_t igc_intr(int irq, void *data) if (icr & IGC_ICR_TS) igc_tsync_interrupt(adapter); - napi_schedule(&q_vector->napi); + napi_schedule_irqoff(&q_vector->napi); return IRQ_HANDLED; } From 4d9508d97b7bf81f71ef840607bfa2eabee1442b Mon Sep 17 00:00:00 2001 From: Matt Vollrath Date: Tue, 9 Jun 2026 14:35:52 -0700 Subject: [PATCH 10/14] e1000e: Use __napi_schedule_irqoff() The __napi_schedule_irqoff() macro is intended to bypass saving and restoring IRQ state when scheduling is requested from an IRQ handler, where hard interrupts are already disabled. Use this macro in all three interrupt handlers. This was tested on a system with an I218-V and MSI interrupts. Because this is an optimization, I was interested in measuring the impact, so I added ktime_get() time measurement to e1000_intr_msi and a print of the last sample in the watchdog task. For each test case I ran a bi-directional iperf3 to saturate the line. With some help from awk, here are the statistics. 49 samples each, all units ns previous: min 678 max 1265 mean 879.429 median 806 stddev 137.188 noirq: min 707 max 1165 mean 811.857 median 790 stddev 89.486 According to this informal comparison, the mean time to handle an interrupt from start to finish is improved by about 8% under load. Signed-off-by: Matt Vollrath Reviewed-by: Aleksandr Loktionov Tested-by: Michal Cohen Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-12-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/e1000e/netdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 3bdeb5f0dbea..808e5cddd6a9 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -1803,7 +1803,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data) adapter->total_tx_packets = 0; adapter->total_rx_bytes = 0; adapter->total_rx_packets = 0; - __napi_schedule(&adapter->napi); + __napi_schedule_irqoff(&adapter->napi); } return IRQ_HANDLED; @@ -1882,7 +1882,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data) adapter->total_tx_packets = 0; adapter->total_rx_bytes = 0; adapter->total_rx_packets = 0; - __napi_schedule(&adapter->napi); + __napi_schedule_irqoff(&adapter->napi); } return IRQ_HANDLED; @@ -1951,7 +1951,7 @@ static irqreturn_t e1000_intr_msix_rx(int __always_unused irq, void *data) if (napi_schedule_prep(&adapter->napi)) { adapter->total_rx_bytes = 0; adapter->total_rx_packets = 0; - __napi_schedule(&adapter->napi); + __napi_schedule_irqoff(&adapter->napi); } return IRQ_HANDLED; } From 4cc8566ae0d1609d888d90bf4e49b4f6ee62c1cd Mon Sep 17 00:00:00 2001 From: Agalakov Daniil Date: Tue, 9 Jun 2026 14:35:53 -0700 Subject: [PATCH 11/14] e1000: limit endianness conversion to boundary words [Why] In e1000_set_eeprom(), the eeprom_buff is allocated to hold a range of words. However, only the boundary words (the first and the last) are populated from the EEPROM if the write request is not word-aligned. The words in the middle of the buffer remain uninitialized because they are intended to be completely overwritten by the new data via memcpy(). The previous implementation had a loop that performed le16_to_cpus() on the entire buffer. This resulted in endianness conversion being performed on uninitialized memory for all interior words. Fix this by converting the endianness only for the boundary words immediately after they are successfully read from the EEPROM. Found by Linux Verification Center (linuxtesting.org) with SVACE. Co-developed-by: Iskhakov Daniil Signed-off-by: Iskhakov Daniil Signed-off-by: Agalakov Daniil Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-13-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c index 4dcbeabb3ad2..c15ad95c63c1 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c +++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c @@ -499,6 +499,9 @@ static int e1000_set_eeprom(struct net_device *netdev, if (ret_val) goto out; + /* Device's eeprom is always little-endian, word addressable */ + le16_to_cpus(&eeprom_buff[0]); + ptr++; } if ((eeprom->offset + eeprom->len) & 1) { @@ -509,11 +512,10 @@ static int e1000_set_eeprom(struct net_device *netdev, &eeprom_buff[last_word - first_word]); if (ret_val) goto out; - } - /* Device's eeprom is always little-endian, word addressable */ - for (i = 0; i < last_word - first_word + 1; i++) - le16_to_cpus(&eeprom_buff[i]); + /* Device's eeprom is always little-endian, word addressable */ + le16_to_cpus(&eeprom_buff[last_word - first_word]); + } memcpy(ptr, bytes, eeprom->len); From a5ecafcfb27baf2dba766c4fd99dbb947f4e85d8 Mon Sep 17 00:00:00 2001 From: Agalakov Daniil Date: Tue, 9 Jun 2026 14:35:54 -0700 Subject: [PATCH 12/14] e1000e: limit endianness conversion to boundary words [Why] In e1000_set_eeprom(), the eeprom_buff is allocated to hold a range of words. However, only the boundary words (the first and the last) are populated from the EEPROM if the write request is not word-aligned. The words in the middle of the buffer remain uninitialized because they are intended to be completely overwritten by the new data via memcpy(). The previous implementation had a loop that performed le16_to_cpus() on the entire buffer. This resulted in endianness conversion being performed on uninitialized memory for all interior words. Fix this by converting the endianness only for the boundary words immediately after they are successfully read from the EEPROM. Found by Linux Verification Center (linuxtesting.org) with SVACE. Co-developed-by: Iskhakov Daniil Signed-off-by: Iskhakov Daniil Signed-off-by: Agalakov Daniil Tested-by: Avigail Dahan Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-14-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/e1000e/ethtool.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index dbed30943ef4..a8b35ae41141 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c @@ -583,20 +583,25 @@ static int e1000_set_eeprom(struct net_device *netdev, /* need read/modify/write of first changed EEPROM word */ /* only the second byte of the word is being modified */ ret_val = e1000_read_nvm(hw, first_word, 1, &eeprom_buff[0]); + if (ret_val) + goto out; + + /* Device's eeprom is always little-endian, word addressable */ + le16_to_cpus(&eeprom_buff[0]); + ptr++; } - if (((eeprom->offset + eeprom->len) & 1) && (!ret_val)) + if ((eeprom->offset + eeprom->len) & 1) { /* need read/modify/write of last changed EEPROM word */ /* only the first byte of the word is being modified */ ret_val = e1000_read_nvm(hw, last_word, 1, &eeprom_buff[last_word - first_word]); + if (ret_val) + goto out; - if (ret_val) - goto out; - - /* Device's eeprom is always little-endian, word addressable */ - for (i = 0; i < last_word - first_word + 1; i++) - le16_to_cpus(&eeprom_buff[i]); + /* Device's eeprom is always little-endian, word addressable */ + le16_to_cpus(&eeprom_buff[last_word - first_word]); + } memcpy(ptr, bytes, eeprom->len); From 2904b67ba2f10ee2b490d787fdced6f8fac9ed58 Mon Sep 17 00:00:00 2001 From: Maximilian Pezzullo Date: Tue, 9 Jun 2026 14:35:55 -0700 Subject: [PATCH 13/14] igb: fix typos in comments Fix spelling errors in code comments: - e1000_nvm.c: 'likley' -> 'likely' - e1000_mac.c: 'auto-negotitation' -> 'auto-negotiation' - e1000_mbx.h: 'exra' -> 'extra' - e1000_defines.h: 'Aserted' -> 'Asserted' Signed-off-by: Maximilian Pezzullo Reviewed-by: Aleksandr Loktionov Reviewed-by: Joe Damato Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-15-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/igb/e1000_defines.h | 2 +- drivers/net/ethernet/intel/igb/e1000_mac.c | 2 +- drivers/net/ethernet/intel/igb/e1000_mbx.h | 2 +- drivers/net/ethernet/intel/igb/e1000_nvm.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h index fa028928482f..7e6f9aa2d57b 100644 --- a/drivers/net/ethernet/intel/igb/e1000_defines.h +++ b/drivers/net/ethernet/intel/igb/e1000_defines.h @@ -442,7 +442,7 @@ /* Interrupt Cause Set */ #define E1000_ICS_LSC E1000_ICR_LSC /* Link Status Change */ #define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ -#define E1000_ICS_DRSTA E1000_ICR_DRSTA /* Device Reset Aserted */ +#define E1000_ICS_DRSTA E1000_ICR_DRSTA /* Device Reset Asserted */ /* Extended Interrupt Cause Set */ /* E1000_EITR_CNT_IGNR is only for 82576 and newer */ diff --git a/drivers/net/ethernet/intel/igb/e1000_mac.c b/drivers/net/ethernet/intel/igb/e1000_mac.c index fa3dfafd2bb1..2bcce6eef0c7 100644 --- a/drivers/net/ethernet/intel/igb/e1000_mac.c +++ b/drivers/net/ethernet/intel/igb/e1000_mac.c @@ -1581,7 +1581,7 @@ s32 igb_disable_pcie_master(struct e1000_hw *hw) * igb_validate_mdi_setting - Verify MDI/MDIx settings * @hw: pointer to the HW structure * - * Verify that when not using auto-negotitation that MDI/MDIx is correctly + * Verify that when not using auto-negotiation that MDI/MDIx is correctly * set, which is forced to MDI mode only. **/ s32 igb_validate_mdi_setting(struct e1000_hw *hw) diff --git a/drivers/net/ethernet/intel/igb/e1000_mbx.h b/drivers/net/ethernet/intel/igb/e1000_mbx.h index 178e60ec71d4..9e44527f5eea 100644 --- a/drivers/net/ethernet/intel/igb/e1000_mbx.h +++ b/drivers/net/ethernet/intel/igb/e1000_mbx.h @@ -30,7 +30,7 @@ /* Indicates that VF is still clear to send requests */ #define E1000_VT_MSGTYPE_CTS 0x20000000 #define E1000_VT_MSGINFO_SHIFT 16 -/* bits 23:16 are used for exra info for certain messages */ +/* bits 23:16 are used for extra info for certain messages */ #define E1000_VT_MSGINFO_MASK (0xFF << E1000_VT_MSGINFO_SHIFT) #define E1000_VF_RESET 0x01 /* VF requests reset */ diff --git a/drivers/net/ethernet/intel/igb/e1000_nvm.c b/drivers/net/ethernet/intel/igb/e1000_nvm.c index c8638502c2be..cf4e5d0e9417 100644 --- a/drivers/net/ethernet/intel/igb/e1000_nvm.c +++ b/drivers/net/ethernet/intel/igb/e1000_nvm.c @@ -405,7 +405,7 @@ s32 igb_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) * Writes data to EEPROM at offset using SPI interface. * * If e1000_update_nvm_checksum is not called after this function , the - * EEPROM will most likley contain an invalid checksum. + * EEPROM will most likely contain an invalid checksum. **/ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) { From d4e035b3a517d26a38374e5780f904cd9b3d7c50 Mon Sep 17 00:00:00 2001 From: Maximilian Pezzullo Date: Tue, 9 Jun 2026 14:35:56 -0700 Subject: [PATCH 14/14] igc: fix typos in comments Fix spelling errors in code comments: - igc_diag.c: 'autonegotioation' -> 'autonegotiation' - igc_main.c: 'revisons' -> 'revisions' (two occurrences) Signed-off-by: Maximilian Pezzullo Reviewed-by: Aleksandr Loktionov Reviewed-by: Joe Damato Tested-by: Avigail Dahan Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260609213559.178657-16-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/intel/igc/igc_diag.c | 2 +- drivers/net/ethernet/intel/igc/igc_main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_diag.c b/drivers/net/ethernet/intel/igc/igc_diag.c index a43d7244ee70..031561fdce49 100644 --- a/drivers/net/ethernet/intel/igc/igc_diag.c +++ b/drivers/net/ethernet/intel/igc/igc_diag.c @@ -172,7 +172,7 @@ bool igc_link_test(struct igc_adapter *adapter, u64 *data) *data = 0; - /* add delay to give enough time for autonegotioation to finish */ + /* add delay to give enough time for autonegotiation to finish */ ssleep(5); link_up = igc_has_link(adapter); diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 9143d591083f..e0d719c11105 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -1797,7 +1797,7 @@ static const enum pkt_hash_types igc_rss_type_table[IGC_RSS_TYPE_MAX_TABLE] = { [IGC_RSS_TYPE_HASH_UDP_IPV6_EX] = PKT_HASH_TYPE_L4, [10] = PKT_HASH_TYPE_NONE, /* RSS Type above 9 "Reserved" by HW */ [11] = PKT_HASH_TYPE_NONE, /* keep array sized for SW bit-mask */ - [12] = PKT_HASH_TYPE_NONE, /* to handle future HW revisons */ + [12] = PKT_HASH_TYPE_NONE, /* to handle future HW revisions */ [13] = PKT_HASH_TYPE_NONE, [14] = PKT_HASH_TYPE_NONE, [15] = PKT_HASH_TYPE_NONE, @@ -7039,7 +7039,7 @@ static enum xdp_rss_hash_type igc_xdp_rss_type[IGC_RSS_TYPE_MAX_TABLE] = { [IGC_RSS_TYPE_HASH_UDP_IPV6_EX] = XDP_RSS_TYPE_L4_IPV6_UDP_EX, [10] = XDP_RSS_TYPE_NONE, /* RSS Type above 9 "Reserved" by HW */ [11] = XDP_RSS_TYPE_NONE, /* keep array sized for SW bit-mask */ - [12] = XDP_RSS_TYPE_NONE, /* to handle future HW revisons */ + [12] = XDP_RSS_TYPE_NONE, /* to handle future HW revisions */ [13] = XDP_RSS_TYPE_NONE, [14] = XDP_RSS_TYPE_NONE, [15] = XDP_RSS_TYPE_NONE,