net: skb_queue_purge_reason() optimizations
authorEric Dumazet <edumazet@google.com>
Tue, 3 Oct 2023 18:19:20 +0000 (18:19 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 5 Oct 2023 00:32:24 +0000 (17:32 -0700)
commitd86e5fbd4c965fdda72f99ccd54a1031ea4df51d
treee0ee9a23128b71d61e4836e0ef1a524e0c48f26a
parent397f70e3be01e2a62d08a12fa135d0f13fea9fb8
net: skb_queue_purge_reason() optimizations

1) Exit early if the list is empty.

2) splice the list into a local list,
   so that we block hard irqs only once.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20231003181920.3280453-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/skbuff.c