提交 2b13af8a 编写于 作者: E Eric Dumazet 提交者: Jakub Kicinski

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: NEric Dumazet <edumazet@google.com>
Acked-by: NSoheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 ef57c161
...@@ -130,6 +130,7 @@ static inline void skb_mark_napi_id(struct sk_buff *skb, ...@@ -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) static inline void sk_mark_napi_id(struct sock *sk, const struct sk_buff *skb)
{ {
#ifdef CONFIG_NET_RX_BUSY_POLL #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); WRITE_ONCE(sk->sk_napi_id, skb->napi_id);
#endif #endif
sk_rx_queue_set(sk, skb); sk_rx_queue_set(sk, skb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册