mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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 commitb013840810("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:89ed5b5190("af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET") Signed-off-by: Eric Dumazet <[email protected]> Cc: Neil Horman <[email protected]> Cc: Daniel Borkmann <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
1fbfb483c1
commit
b5b2d42bb3
1 changed files with 1 additions and 2 deletions
|
|
@ -2461,8 +2461,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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue