Patch "igc: Fix infinite initialization loop with early XDP redirect" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    igc: Fix infinite initialization loop with early XDP redirect

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     igc-fix-infinite-initialization-loop-with-early-xdp-.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 40791e0e293682146831d563a7df7c58d6f912b6
Author: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxx>
Date:   Wed Sep 13 11:06:15 2023 -0700

    igc: Fix infinite initialization loop with early XDP redirect
    
    [ Upstream commit cb47b1f679c4d83a5fa5f1852e472f844e41a3da ]
    
    When an XDP redirect happens before the link is ready, that
    transmission will not finish and will timeout, causing an adapter
    reset. If the redirects do not stop, the adapter will not stop
    resetting.
    
    Wait for the driver to signal that there's a carrier before allowing
    transmissions to proceed.
    
    Previous code was relying that when __IGC_DOWN is cleared, the NIC is
    ready to transmit as all the queues are ready, what happens is that
    the carrier presence will only be signaled later, after the watchdog
    workqueue has a chance to run. And during this interval (between
    clearing __IGC_DOWN and the watchdog running) if any transmission
    happens the timeout is emitted (detected by igc_tx_timeout()) which
    causes the reset, with the potential for the infinite loop.
    
    Fixes: 4ff320361092 ("igc: Add support for XDP_REDIRECT action")
    Reported-by: Ferenc Fejes <ferenc.fejes@xxxxxxxxxxxx>
    Closes: https://lore.kernel.org/netdev/0caf33cf6adb3a5bf137eeaa20e89b167c9986d5.camel@xxxxxxxxxxxx/
    Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxx>
    Tested-by: Ferenc Fejes <ferenc.fejes@xxxxxxxxxxxx>
    Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@xxxxxxxxx>
    Tested-by: Naama Meir <naamax.meir@xxxxxxxxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index a8c24a1c12b43..6185566fbb98c 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6271,7 +6271,7 @@ static int igc_xdp_xmit(struct net_device *dev, int num_frames,
 	struct igc_ring *ring;
 	int i, drops;
 
-	if (unlikely(test_bit(__IGC_DOWN, &adapter->state)))
+	if (unlikely(!netif_carrier_ok(dev)))
 		return -ENETDOWN;
 
 	if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK))



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux