public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2 0/4] Fix i40e/ice/iavf VF bonding after netdev lock changes
@ 2026-04-07 16:52 Jose Ignacio Tornos Martinez
  2026-04-07 16:52 ` [PATCH net v2 1/4] iavf: return EBUSY if reset in progress or not ready during MAC change Jose Ignacio Tornos Martinez
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jose Ignacio Tornos Martinez @ 2026-04-07 16:52 UTC (permalink / raw)
  To: netdev
  Cc: intel-wired-lan, jesse.brandeburg, anthony.l.nguyen, davem,
	edumazet, kuba, pabeni, Jose Ignacio Tornos Martinez

This series fixes VF bonding failures introduced by commit ad7c7b2172c3
("net: hold netdev instance lock during sysfs operations").

When adding VFs to a bond immediately after setting trust mode, MAC
address changes fail with -EAGAIN, preventing bonding setup. This
affects both i40e (700-series) and ice (800-series) Intel NICs.

The core issue is lock contention: iavf_set_mac() is now called with the
netdev lock held and waits for MAC change completion while holding it.
However, both the watchdog task that sends the request and the adminq_task
that processes PF responses also need this lock, creating a deadlock where
neither can run, causing timeouts.

Additionally, setting VF trust triggers an unnecessary ~10 second VF reset
in i40e driver that delays bonding setup, even though filter
synchronization happens naturally during normal VF operation. For ice
driver, the delay is not so big, but in the same way the operation is not
necessary.

This series:
1. Adds safety guard to prevent MAC changes during reset or early
   initialization (before VF is ready)
2. Eliminates unnecessary VF reset when setting trust in i40e
3. Fixes lock contention by polling admin queue synchronously
4. Eliminates unnecessary VF reset when setting trust in ice

The key fix (patch 3/4) implements a synchronous MAC change operation
similar to the approach used for ndo_change_mtu deadlock fix:
https://lore.kernel.org/intel-wired-lan/20260211191855.1532226-1-poros@redhat.com/ 
Instead of scheduling work and waiting, it:

- Sends the virtchnl message directly (not via watchdog)
- Polls the admin queue hardware directly for responses
- Processes all messages inline (including non-MAC messages)
- Returns when complete or times out

This allows the operation to complete synchronously while holding
netdev_lock, without relying on watchdog or adminq_task. A new generic
iavf_poll_virtchnl_response() function is introduced that can be reused
for future synchronous virtchnl operations.

The function can sleep for up to 2.5 seconds polling hardware, but this
is acceptable since netdev_lock is per-device and only serializes
operations on the same interface.

Testing shows VF bonding now works reliably in ~5 seconds vs 15+ seconds
before (i40e), without timeouts or errors (i40e and ice).

Tested on Intel 700-series (i40e) and 800-series (ice) dual-port NICs
with iavf driver.

Thanks to Jan Tluka <jtluka@redhat.com> and Yuying Ma <yuma@redhat.com> for
reporting the issues.

Jose Ignacio Tornos Martinez (4):
  iavf: return EBUSY if reset in progress during MAC change
  i40e: skip unnecessary VF reset when setting trust
  iavf: send MAC change request synchronously
  ice: skip unnecessary VF reset when setting trust

---
v2:
  - Patch 1: Add state check to prevent MAC changes during early
    initialization (before __IAVF_DOWN state)
  - Patch 3: Use synchronous polling approach instead of dropping lock,
    following the pattern from ndo_change_mtu deadlock fix
  - Introduce generic iavf_poll_virtchnl_response() for code reuse
  - Add patch 4/4 to fix the same trust reset issue in ice driver
  - Add testing confirmation for both i40e and ice hardware
  - No changes to patch 2 from v1
v1: https://lore.kernel.org/netdev/20260406112057.906685-1-jtornosm@redhat.com/

 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 17 ++-
 drivers/net/ethernet/intel/iavf/iavf.h             |  2 +-
 drivers/net/ethernet/intel/iavf/iavf_main.c        | 98 +++++++++++++++++-
 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c    | 15 +--
 drivers/net/ethernet/intel/ice/ice_sriov.c         | 15 ++-
 5 files changed, 123 insertions(+), 24 deletions(-)

--
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-07 16:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 16:52 [PATCH net v2 0/4] Fix i40e/ice/iavf VF bonding after netdev lock changes Jose Ignacio Tornos Martinez
2026-04-07 16:52 ` [PATCH net v2 1/4] iavf: return EBUSY if reset in progress or not ready during MAC change Jose Ignacio Tornos Martinez
2026-04-07 16:52 ` [PATCH net v2 2/4] i40e: skip unnecessary VF reset when setting trust Jose Ignacio Tornos Martinez
2026-04-07 16:52 ` [PATCH net v2 3/4] iavf: send MAC change request synchronously Jose Ignacio Tornos Martinez
2026-04-07 16:52 ` [PATCH net v2 4/4] ice: skip unnecessary VF reset when setting trust Jose Ignacio Tornos Martinez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox