On Tue, Sep 22, 2026 at 11:35:57AM +0000, Sergey Temerkhanov wrote:
> When enabling or disabling an XDP program requires a queue
> reconfiguration, ixgbe_xdp_setup() swaps in the new program with
> xchg() before calling ixgbe_setup_tc(). If ixgbe_setup_tc() fails,
> the adapter was left pointing at the new program even though the
> reconfiguration did not complete, leaking the reference to the old
> program and leaving inconsistent state.
>
> ixgbe_setup_tc() may have already reconfigured the queues for the new
> program before failing. The XDP ring layout then no longer matches the
> previous program, for example when removing a program has removed the
> XDP TX rings. Restore the previous program and rebuild the queues for
> it so adapter->xdp_prog remains consistent with the ring configuration.
> Otherwise, a later open could run XDP without XDP TX rings and
> dereference a NULL ring. ixgbe_setup_tc() handles the device having
> been left down by the failed reconfiguration.
>
> Fixes: 3fe1d0a48d21 ("ixgbe: XDP: fix checker warning from rcu pointer")
> Signed-off-by: Sergey Temerkhanov <[email protected]>
> Reviewed-by: Przemyslaw Korba <[email protected]>
Reviewed-by: Simon Horman <[email protected]>