Commit 2b13af8a authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski
Browse files

net: avoid dirtying sk->sk_napi_id



sk_napi_id is located in a cache line that can be kept read mostly.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ef57c161
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ static inline void skb_mark_napi_id(struct sk_buff *skb,
static inline void sk_mark_napi_id(struct sock *sk, const struct sk_buff *skb)
{
#ifdef CONFIG_NET_RX_BUSY_POLL
	if (unlikely(READ_ONCE(sk->sk_napi_id) != skb->napi_id))
		WRITE_ONCE(sk->sk_napi_id, skb->napi_id);
#endif
	sk_rx_queue_set(sk, skb);