Patch "tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring" has been added to the 6.6-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

    tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring

to the 6.6-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:
     tsnep-fix-xdp_ring_need_wakeup-for-empty-fill-ring.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 43d7a55fe424e183b51503d870bf52d919e36ee3
Author: Gerhard Engleder <gerhard@xxxxxxxxxxxxxxxxxxxxx>
Date:   Tue Jan 23 21:09:18 2024 +0100

    tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring
    
    [ Upstream commit 9a91c05f4bd6f6bdd6b8f90445e0da92e3ac956c ]
    
    The fill ring of the XDP socket may contain not enough buffers to
    completey fill the RX queue during socket creation. In this case the
    flag XDP_RING_NEED_WAKEUP is not set as this flag is only set if the RX
    queue is not completely filled during polling.
    
    Set XDP_RING_NEED_WAKEUP flag also if RX queue is not completely filled
    during XDP socket creation.
    
    Fixes: 3fc2333933fd ("tsnep: Add XDP socket zero-copy RX support")
    Signed-off-by: Gerhard Engleder <gerhard@xxxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c
index 9fea97671f4b..08e113e785a7 100644
--- a/drivers/net/ethernet/engleder/tsnep_main.c
+++ b/drivers/net/ethernet/engleder/tsnep_main.c
@@ -1711,6 +1711,19 @@ static void tsnep_rx_reopen_xsk(struct tsnep_rx *rx)
 			allocated--;
 		}
 	}
+
+	/* set need wakeup flag immediately if ring is not filled completely,
+	 * first polling would be too late as need wakeup signalisation would
+	 * be delayed for an indefinite time
+	 */
+	if (xsk_uses_need_wakeup(rx->xsk_pool)) {
+		int desc_available = tsnep_rx_desc_available(rx);
+
+		if (desc_available)
+			xsk_set_rx_need_wakeup(rx->xsk_pool);
+		else
+			xsk_clear_rx_need_wakeup(rx->xsk_pool);
+	}
 }
 
 static bool tsnep_pending(struct tsnep_queue *queue)




[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