Commit 0d5dc1d7 authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski
Browse files

macvlan: avoid spinlock contention in macvlan_broadcast_enqueue()



Under high stress, we spend a lot of time cloning skbs,
then acquiring a spinlock, then freeing the clone because
the queue is full.

Add a shortcut to avoid these costs under pressure.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260401103809.3038139-3-edumazet@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1ef5789d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -360,6 +360,9 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port,
	struct sk_buff *nskb;
	int err = -ENOMEM;

	if (skb_queue_len_lockless(&port->bc_queue) >= bc_queue_len_used)
		goto err;

	nskb = skb_clone(skb, GFP_ATOMIC);
	if (!nskb)
		goto err;