summaryrefslogtreecommitdiff
path: root/include/net/busy_poll.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/busy_poll.h')
-rw-r--r--include/net/busy_poll.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h
index 40296ed976a9..7994455ec714 100644
--- a/include/net/busy_poll.h
+++ b/include/net/busy_poll.h
@@ -130,9 +130,10 @@ 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
- WRITE_ONCE(sk->sk_napi_id, skb->napi_id);
+ 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);
+ sk_rx_queue_update(sk, skb);
}
static inline void __sk_mark_napi_id_once(struct sock *sk, unsigned int napi_id)