[PATCH] net/ixgbe: don't create a delayed interrupt handler if one already exists
Burakov, Anatoly
anatoly.burakov at intel.com
Thu May 16 13:41:22 CEST 2024
On 4/18/2024 3:53 PM, edwin.brossette at 6wind.com wrote:
> From: Edwin Brossette <edwin.brossette at 6wind.com>
>
> Since link state may need some time to stabilize after a link state
> change, we cannot update the link state right after one occurs. So link
> state change interrupts (lsc) are handled after a delay. To do this, an
> alarm to call a delayed handler is programmed. This delayed handler is
> tasked with updating the link after a variable delay of one to four
> seconds which should be enough time for the link state to become stable
> again.
>
> However, a problem can occur with some models of network cards. For
> example, ixgbe_mac_X550EM_x may trigger this interrupt twice because
> another interrupt signal is received on the General Purpose Interrupt
> pin SPD0, which has the same interrupt handler. In such a case, the
> delayed interrupt handler would be programmed to be executed twice.
>
> Since we save the original interrupt mask value to restore it after the
> delayed handler is done with its work, we end up overwritting its value
> after the second alarm is programmed. Even worse: when restoring it the
> first time, the saved original mask variable is reset to 0, so we end up
> completely disabling all interrupts when trying to restore this mask
> after the second time the delayed handler is executed.
>
> Add a check on the interrupt mask value when programming the alarm for
> the delayed handler. If the bit for lsc interrupts is unset, it means an
> alarm was already programmed for the delayed handler. In this case, skip
> the alarm creation.
>
> Fixes: 9b667210700e ("net/ixgbe: fix blocked interrupts")
> Cc: stable at dpdk.org
>
> Signed-off-by: Edwin Brossette <edwin.brossette at 6wind.com>
> ---
Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
--
Thanks,
Anatoly
More information about the dev
mailing list