Patch "af_packet: do not call packet_read_pending() from tpacket_destruct_skb()" has been added to the 6.9-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

    af_packet: do not call packet_read_pending() from tpacket_destruct_skb()

to the 6.9-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:
     af_packet-do-not-call-packet_read_pending-from-tpack.patch
and it can be found in the queue-6.9 subdirectory.

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



commit bf08a871c7ebb334eda7d479a17555d8663f63e3
Author: Eric Dumazet <edumazet@xxxxxxxxxx>
Date:   Wed May 15 16:33:58 2024 +0000

    af_packet: do not call packet_read_pending() from tpacket_destruct_skb()
    
    [ Upstream commit 581073f626e387d3e7eed55c48c8495584ead7ba ]
    
    trafgen performance considerably sank on hosts with many cores
    after the blamed commit.
    
    packet_read_pending() is very expensive, and calling it
    in af_packet fast path defeats Daniel intent in commit
    b013840810c2 ("packet: use percpu mmap tx frame pending refcount")
    
    tpacket_destruct_skb() makes room for one packet, we can immediately
    wakeup a producer, no need to completely drain the tx ring.
    
    Fixes: 89ed5b519004 ("af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET")
    Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Cc: Neil Horman <nhorman@xxxxxxxxxxxxx>
    Cc: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
    Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240515163358.4105915-1-edumazet@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 18f616f487eaa..150451ddd7553 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2522,8 +2522,7 @@ static void tpacket_destruct_skb(struct sk_buff *skb)
 		ts = __packet_set_timestamp(po, ph, skb);
 		__packet_set_status(po, ph, TP_STATUS_AVAILABLE | ts);
 
-		if (!packet_read_pending(&po->tx_ring))
-			complete(&po->skb_completion);
+		complete(&po->skb_completion);
 	}
 
 	sock_wfree(skb);




[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