DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [DPDK/ethdev Bug 2149] net/axgbe: AN state machine and PHY mode change run in EAL interrupt thread
@ 2026-11-19 16:46 bugzilla
  0 siblings, 0 replies; only message in thread
From: bugzilla @ 2026-11-19 16:46 UTC (permalink / raw)
  To: dev

https://bugs.dpdk.org/show_bug.cgi?id=2149

            Bug ID: 2149
           Summary: net/axgbe: AN state machine and PHY mode change run in
                    EAL interrupt thread
           Product: DPDK
           Version: 26.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: ethdev
          Assignee: dev@dpdk.org
          Reporter: stephen@networkplumber.org
  Target Milestone: ---

Found while reviewing latest axgbe changes. The problem with busy waiting
in interrupt thread is that it will then block all other interrupts from
occurring from other devices.


The axgbe interrupt callback runs the full autonegotiation state
machine, including PHY mode changes, directly on the EAL interrupt
thread. That path busy-waits on firmware and hardware for hundreds of
milliseconds, and up to several seconds on timeout.

Call path:

  axgbe_dev_interrupt_handler()              axgbe_ethdev.c:316
    pdata->phy_if.an_isr()
      axgbe_an73_isr()                       axgbe_mdio.c:660
        pthread_mutex_lock(&pdata->an_mutex)
        axgbe_an73_state_machine()
          axgbe_an73_incompat_link()
            axgbe_switch_mode() -> phy_impl.set_mode()
              axgbe_phy_perform_ratechange()  axgbe_phy_impl.c:1561
                mailbox poll: rte_delay_us(1500) x 500 (750 ms max)
                axgbe_rx_adaptation(): rte_delay_ms(200)

PHY access from this context also goes through
axgbe_phy_get_comm_ownership(), which polls the hardware I2C/MDIO
mutex with rte_delay_us(100) for up to 5 seconds while holding
phy_mutex.

Impact:

- The EAL interrupt thread is shared across all devices. While axgbe
  is busy-waiting, LSC/RMV/mailbox interrupts for every other port and
  PMD in the process are stalled.
- EAL alarm callbacks are dispatched from the same thread and are
  delayed the same way.
- Application threads calling link_update/dev_start block on an_mutex
  for the same duration.

The Linux amd-xgbe driver, which this PMD is derived from, does not do
this work in the ISR. It defers it with
queue_work(pdata->an_workqueue, &pdata->an_irq_work). The DPDK port
collapsed that into the interrupt callback.

Suggested fix:

The interrupt callback should only read and clear the AN interrupt
status into pdata->an_int and wake a per-port control thread
(rte_thread_create_internal_control) that runs the state machine and
mode change. That matches the Linux design and keeps the existing
mutexes meaningful (AN worker vs application control path).

Deferring with rte_eal_alarm_set() is not sufficient, since alarms run
on the same EAL interrupt thread.

Other PMDs whose interrupt callbacks reach rte_delay_* in PHY or
firmware code probably have the same problem and should be audited.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-19 16:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 16:46 [DPDK/ethdev Bug 2149] net/axgbe: AN state machine and PHY mode change run in EAL interrupt thread bugzilla

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