* [PATCH iwl-net v5 0/4] ixgbe: four bug fixes
@ 2026-05-15 19:04 Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 1/4] ixgbe: fix SWFW semaphore timeout for X550 family Aleksandr Loktionov
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Aleksandr Loktionov @ 2026-05-15 19:04 UTC (permalink / raw)
To: intel-wired-lan, anthony.l.nguyen, aleksandr.loktionov; +Cc: netdev
Four fixes for the ixgbe driver, covering a SWFW semaphore timeout
miscalculation, a false-success return in the cls_u32 nexthdr path,
an adaptive-ITR u8 overflow, and wrong bit positions in the UP-to-TC
register normalisation.
Patch 1 fixes a timeout too short for X550 family FW update operations,
which caused spurious EBUSY failures during module-update and SR-dump
commands.
Patches 2-4 fix correctness bugs with user-visible effects: a cls_u32
nexthdr offload path that silently dropped filter-install errors, an
adaptive-ITR path that corrupted the mode flag via u8 truncation, and
a UP-to-TC validation loop that cleared only UP1 regardless of which
user priority was out of bounds.
Patch 3 reworks the ITR write-back to keep the mode flag
(IXGBE_ITR_ADAPTIVE_LATENCY, bit 7) and the usec delay in separate
operands until the final store, and clamps the delay to
[IXGBE_ITR_ADAPTIVE_MIN_USECS, IXGBE_ITR_ADAPTIVE_MAX_USECS] via
clamp_val().
Patch 4 corrects the Fixes: tag to 8b1c0b24d9af ("ixgbe: configure
minimal packet buffers to support TC") per Simon Horman.
Changes in v5:
- DROPPED "ixgbe: call ixgbe_setup_fc() before fc_enable() after NVM
update" (was 2/5 in v4).
ixgbe_setup_fc_e610() is documented as an init-time-only operation.
Calling it unconditionally from ixgbe_watchdog_update_link() on
every link-up event causes it to issue an ACI set_phy_cfg command
with IXGBE_ACI_PHY_ENA_AUTO_LINK_UPDT on E610 (Linkville) devices.
That flag instructs the firmware to re-initialise the PHY, which
immediately drops the link; the resulting link-up triggers another
watchdog call, which issues another set_phy_cfg, creating a rapid
reset loop during early init. The E610 firmware's fault-detection
logic sets IXGBE_GL_MNG_FWSM_RECOVERY_M in response, causing all
E610 ports to report "Firmware recovery mode detected. Limiting
functionality." and enumerate no network interfaces.
A correct fix must gate the setup_fc() call on an actual NVM-update
event rather than on every link-up; that rework will be sent as a
separate series once the interaction with the E610 ACI PHY-config
path is fully understood.
- 1/4 (was 1/5), 2/4 (was 3/5), 3/4 (was 4/5), 4/4 (was 5/5):
renumbered only; no code or commit-message change.
Changes in v4:
- DROPPED "ixgbe: add bounds check for debugfs register access"
(was 2/6 in v3). The WARN_ON_ONCE(reg > IXGBE_HFDR) guard added
to ixgbe_read_reg() fires on legitimate driver code paths on
X550EM_a / E610 (LKV): probe reads IXGBE_EEC(hw), which on those
parts resolves to IXGBE_EEC_X550EM_a == 0x15FF8, exceeding
IXGBE_HFDR == 0x15FE8. IXGBE_LINKS_10G_LANE_SYNC (0x17000) is
another in-driver register beyond IXGBE_HFDR. The premise of the
patch -- that IXGBE_HFDR is the highest valid MMIO offset -- is
incorrect, so the read-side guard cannot be retained as written,
and the debugfs-side bound suffers from the same wrong ceiling.
A correct debugfs-only bound (against pci_resource_len(BAR0)) will
be sent separately if/when needed; that work is outside the scope
of these -net fixes. Reported by Larysa Zaremba.
- 1/5 (was 1/6), 2/5 (was 3/6), 3/5 (was 4/6), 4/5 (was 5/6),
5/5 (was 6/6): renumbered only; no code or commit-message change.
Changes in v3:
- cover: removed Patch 1 squash-history description.
- 1/6: add Reviewed-by: Simon Horman, Reviewed-by: Jacob Keller.
- 2/6: add Reviewed-by: Simon Horman; no code change.
- 3/6: add backplane-link guard in ixgbe_watchdog_update_link().
- 4/6: add Reviewed-by: Simon Horman; no code change.
- 5/6: rework clamping -- use clamp_val() with mode and delay as
separate operands; clamp to [IXGBE_ITR_ADAPTIVE_MIN_USECS,
IXGBE_ITR_ADAPTIVE_MAX_USECS].
- 6/6: correct Fixes: tag to 8b1c0b24d9af; add Reviewed-by:
Simon Horman.
Changes in v2:
- 1/6: Squash two patches; fix commit msg ("200ms" -> "1s"); three
explicit mac.type == comparisons instead of range check.
- 2/6: Add Fixes: tag; reroute from iwl-next to iwl-net.
- 3/6: Add Fixes: tag; reroute to iwl-net; skip fc_enable() when
setup_fc() fails to avoid committing stale FC state.
- 4/6: Add Fixes: tag; reroute from iwl-next to iwl-net.
- 5/6: Add proper [N/M] patch numbering.
- 6/6: Reroute to iwl-net; swap to (expr >> ..) & MASK operand order.
---
Aleksandr Loktionov (4):
ixgbe: fix SWFW semaphore timeout for X550 family
ixgbe: fix cls_u32 nexthdr path returning success when no entry installed
ixgbe: fix ITR value overflow in adaptive interrupt throttling
ixgbe: fix integer overflow and wrong bit position in ixgbe_validate_rtr()
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 +++++++++--------
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | 8 ++++++++
2 files changed, 17 insertions(+), 8 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH iwl-net v5 1/4] ixgbe: fix SWFW semaphore timeout for X550 family
2026-05-15 19:04 [PATCH iwl-net v5 0/4] ixgbe: four bug fixes Aleksandr Loktionov
@ 2026-05-15 19:04 ` Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 2/4] ixgbe: fix cls_u32 nexthdr path returning success when no entry installed Aleksandr Loktionov
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Aleksandr Loktionov @ 2026-05-15 19:04 UTC (permalink / raw)
To: intel-wired-lan, anthony.l.nguyen, aleksandr.loktionov
Cc: netdev, Simon Horman, Jacob Keller
According to FW documentation, the most time-consuming FW operation is
Shadow RAM (SR) dump which takes up to 3.2 seconds. For X550 family
devices the module-update FW command can take over 4.5 s. The default
semaphore loop runs 200 iterations with a 5 ms sleep each, giving a
maximum wait of 1 s -- not "200 ms" as previously stated in error.
This is insufficient for X550 family FW update operations and causes
spurious EBUSY failures.
Extend the SW/FW semaphore timeout from 1 s to 5 s (1000 iterations x
5 ms) for all three X550 variants: ixgbe_mac_X550, ixgbe_mac_X550EM_x,
and ixgbe_mac_x550em_a. All three share the same FW and exhibit the
same worst-case latency. Use three explicit mac.type comparisons rather
than a range check so future MAC additions are not inadvertently
captured.
The timeout variable is set immediately before the loop so the intent
is clear, with an inline comment stating the resulting maximum delay.
Fixes: 030eaece2d77 ("ixgbe: Add x550 SW/FW semaphore support")
Suggested-by: Soumen Karmakar <soumen.karmakar@intel.com>
Suggested-by: Marta Plantykow <marta.a.plantykow@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
---
v2 -> v3:
- Add Reviewed-by: Simon Horman, Reviewed-by: Jacob Keller; no code
change (Jacob suggested read_poll_timeout() but accepted as-is).
v1 -> v2:
- Squash with 0015 (X550EM extension); fix commit message ("200ms" was
wrong, actual default is 1 s); replace >= / <= range check with three
explicit mac.type == comparisons per Tony Nguyen.
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
index e67e2fe..a3c8f51 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
@@ -577,6 +577,15 @@ int ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask)
swmask |= swi2c_mask;
fwmask |= swi2c_mask << 2;
+ /* Extend to 5 s (1000 x 5 ms) for X550 family; default is 1 s
+ * (200 x 5 ms). FW SR-dump takes up to 3.2 s; module-update up
+ * to 4.5 s.
+ */
+ if (hw->mac.type == ixgbe_mac_X550 ||
+ hw->mac.type == ixgbe_mac_X550EM_x ||
+ hw->mac.type == ixgbe_mac_x550em_a)
+ timeout = 1000;
+
for (i = 0; i < timeout; i++) {
/* SW NVM semaphore bit is used for access to all
* SW_FW_SYNC bits (not just NVM)
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH iwl-net v5 2/4] ixgbe: fix cls_u32 nexthdr path returning success when no entry installed
2026-05-15 19:04 [PATCH iwl-net v5 0/4] ixgbe: four bug fixes Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 1/4] ixgbe: fix SWFW semaphore timeout for X550 family Aleksandr Loktionov
@ 2026-05-15 19:04 ` Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 3/4] ixgbe: fix ITR value overflow in adaptive interrupt throttling Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 4/4] ixgbe: fix integer overflow and wrong bit position in ixgbe_validate_rtr() Aleksandr Loktionov
3 siblings, 0 replies; 5+ messages in thread
From: Aleksandr Loktionov @ 2026-05-15 19:04 UTC (permalink / raw)
To: intel-wired-lan, anthony.l.nguyen, aleksandr.loktionov
Cc: netdev, Simon Horman, Marcin Szycik
ixgbe_configure_clsu32() returns 0 (success) after the nexthdr loop
even when ixgbe_clsu32_build_input() fails for every candidate entry
and no jump-table slot is actually programmed. Callers that test the
return value would then falsely believe the filter was installed.
The variable 'err' already tracks the last ixgbe_clsu32_build_input()
return value; if the loop completes with a successful break, err is 0.
If all attempts failed, err holds the last failure code. Change the
unconditional 'return 0' to 'return err' so errors are propagated
correctly.
Fixes: 1cdaaf5405ba ("ixgbe: Match on multiple headers for cls_u32 offloads")
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
---
v2 -> v3:
- Add Reviewed-by: Simon Horman; no code change.
v1 -> v2:
- Add Fixes: tag; reroute from iwl-next to iwl-net (false-success
return is a user-visible correctness bug, not a cleanup).
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 210c7b9..6e7f8a9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -10311,7 +10311,7 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
kfree(jump);
}
}
- return 0;
+ return err;
}
input = kzalloc_obj(*input);
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH iwl-net v5 3/4] ixgbe: fix ITR value overflow in adaptive interrupt throttling
2026-05-15 19:04 [PATCH iwl-net v5 0/4] ixgbe: four bug fixes Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 1/4] ixgbe: fix SWFW semaphore timeout for X550 family Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 2/4] ixgbe: fix cls_u32 nexthdr path returning success when no entry installed Aleksandr Loktionov
@ 2026-05-15 19:04 ` Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 4/4] ixgbe: fix integer overflow and wrong bit position in ixgbe_validate_rtr() Aleksandr Loktionov
3 siblings, 0 replies; 5+ messages in thread
From: Aleksandr Loktionov @ 2026-05-15 19:04 UTC (permalink / raw)
To: intel-wired-lan, anthony.l.nguyen, aleksandr.loktionov
Cc: netdev, Simon Horman
ixgbe_update_itr() packs a mode flag (IXGBE_ITR_ADAPTIVE_LATENCY,
bit 7) and a usecs delay (bits [6:0]) into an unsigned int, then
stores the combined value in ring_container->itr which is declared as
u8. Values above 0xFF wrap on truncation, corrupting both the delay
and the mode flag on the next readback.
Keep the mode bit (IXGBE_ITR_ADAPTIVE_LATENCY) and the usec delay as
separate operands in the final store expression. Clamp only the usecs
portion to [IXGBE_ITR_ADAPTIVE_MIN_USECS, IXGBE_ITR_ADAPTIVE_MAX_USECS]
using clamp_val() so that:
- overflow cannot bleed into the mode bit (bit 7),
- the delay cannot exceed 126 us (IXGBE_ITR_ADAPTIVE_MAX_USECS),
- the delay cannot drop below 10 us (IXGBE_ITR_ADAPTIVE_MIN_USECS).
Fixes: b4ded8327fea ("ixgbe: Update adaptive ITR algorithm")
Cc: stable@vger.kernel.org
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
---
v2 -> v3:
- Use clamp_val() instead of min_t() to also guard the lower bound
(IXGBE_ITR_ADAPTIVE_MIN_USECS); keep mode and delay as separate
operands until final store; use IXGBE_ITR_ADAPTIVE_MAX_USECS (126)
as upper bound instead of IXGBE_ITR_ADAPTIVE_LATENCY - 1 (127)
(Simon Horman).
v1 -> v2:
- Add proper [N/M] numbering so patchwork tracks it as part of the set;
no code change.
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 10 +++++++---
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 210c7b9..9f3ae21 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2886,11 +2886,17 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector,
IXGBE_ITR_ADAPTIVE_MIN_INC * 64) *
IXGBE_ITR_ADAPTIVE_MIN_INC;
break;
}
clear_counts:
- /* write back value */
- ring_container->itr = itr;
+ /* Separate mode bit (IXGBE_ITR_ADAPTIVE_LATENCY) from usec delay;
+ * clamp delay to [MIN_USECS, MAX_USECS] before storing to prevent
+ * u8 truncation from corrupting the mode flag or delay on readback.
+ */
+ ring_container->itr = (itr & IXGBE_ITR_ADAPTIVE_LATENCY) |
+ clamp_val(itr & ~IXGBE_ITR_ADAPTIVE_LATENCY,
+ IXGBE_ITR_ADAPTIVE_MIN_USECS,
+ IXGBE_ITR_ADAPTIVE_MAX_USECS);
/* next update should occur within next jiffy */
ring_container->next_update = next_update + 1;
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH iwl-net v5 4/4] ixgbe: fix integer overflow and wrong bit position in ixgbe_validate_rtr()
2026-05-15 19:04 [PATCH iwl-net v5 0/4] ixgbe: four bug fixes Aleksandr Loktionov
` (2 preceding siblings ...)
2026-05-15 19:04 ` [PATCH iwl-net v5 3/4] ixgbe: fix ITR value overflow in adaptive interrupt throttling Aleksandr Loktionov
@ 2026-05-15 19:04 ` Aleksandr Loktionov
3 siblings, 0 replies; 5+ messages in thread
From: Aleksandr Loktionov @ 2026-05-15 19:04 UTC (permalink / raw)
To: intel-wired-lan, anthony.l.nguyen, aleksandr.loktionov
Cc: netdev, Simon Horman
Two bugs in the same loop in ixgbe_validate_rtr():
1. The 3-bit traffic-class field was extracted by shifting a u32 and
assigning the result directly to a u8. For user priority 0 this is
harmless; for UP[5..7] the shift leaves bits [15..21] in the u32
which are then silently truncated when stored in u8. Mask with
IXGBE_RTRUP2TC_UP_MASK before the assignment so only the intended
3 bits are kept.
2. When clearing an out-of-bounds entry the mask was always shifted by
the fixed constant IXGBE_RTRUP2TC_UP_SHIFT (== 3), regardless of
which loop iteration was being processed. This means only UP1 (bit
position 3) was ever cleared; UP0,2..7 (positions 0, 6, 9, ..., 21)
were left unreset, so invalid TC mappings persisted in hardware and
could mis-steer received packets to the wrong traffic class.
Use i * IXGBE_RTRUP2TC_UP_SHIFT to target the correct 3-bit field
for each iteration.
Swap the operand order in the mask expression to place the constant
on the right per kernel coding style (noted by David Laight).
Fixes: 8b1c0b24d9af ("ixgbe: configure minimal packet buffers to support TC")
Cc: stable@vger.kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
v2 -> v3:
- Correct Fixes: tag to 8b1c0b24d9af ("ixgbe: configure minimal packet
buffers to support TC") -- the previously used e7589eab9291 predates
the buggy code path (Simon Horman); add Reviewed-by: Simon Horman.
v1 -> v2:
- Add Fixes: tag; reroute to iwl-net (wrong bit positions cause packet
mis-steering); swap to (reg >> ...) & MASK operand order per David
Laight.
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 210c7b9..c9e4f12 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9772,11 +9772,12 @@ static void ixgbe_validate_rtr(struct ixgbe_adapter *adapter, u8 tc)
rsave = reg;
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
- u8 up2tc = reg >> (i * IXGBE_RTRUP2TC_UP_SHIFT);
+ u8 up2tc = (reg >> (i * IXGBE_RTRUP2TC_UP_SHIFT)) &
+ IXGBE_RTRUP2TC_UP_MASK;
/* If up2tc is out of bounds default to zero */
if (up2tc > tc)
- reg &= ~(0x7 << IXGBE_RTRUP2TC_UP_SHIFT);
+ reg &= ~(IXGBE_RTRUP2TC_UP_MASK << (i * IXGBE_RTRUP2TC_UP_SHIFT));
}
if (reg != rsave)
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-15 19:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 19:04 [PATCH iwl-net v5 0/4] ixgbe: four bug fixes Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 1/4] ixgbe: fix SWFW semaphore timeout for X550 family Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 2/4] ixgbe: fix cls_u32 nexthdr path returning success when no entry installed Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 3/4] ixgbe: fix ITR value overflow in adaptive interrupt throttling Aleksandr Loktionov
2026-05-15 19:04 ` [PATCH iwl-net v5 4/4] ixgbe: fix integer overflow and wrong bit position in ixgbe_validate_rtr() Aleksandr Loktionov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox