summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStefano Jordhani <sjordhani@gmail.com>2025-02-14 21:17:51 +0300
committerJakub Kicinski <kuba@kernel.org>2025-02-18 03:43:04 +0300
commitb9d752105e5fdcbd9d0126d61da2f6df4a18560f (patch)
treea87dee46dd7c0b4ba212d26457418bf95597fd9e /include
parentb706d9f06874c1b246772fcebd764887eecb53b5 (diff)
downloadlinux-b9d752105e5fdcbd9d0126d61da2f6df4a18560f.tar.xz
net: use napi_id_valid helper
In commit 6597e8d35851 ("netdev-genl: Elide napi_id when not present"), napi_id_valid function was added. Use the helper to refactor open-coded checks in the source. Suggested-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Stefano Jordhani <sjordhani@gmail.com> Reviewed-by: Joe Damato <jdamato@fastly.com> Reviewed-by: Jens Axboe <axboe@kernel.dk> # for iouring Link: https://patch.msgid.link/20250214181801.931-1-sjordhani@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/busy_poll.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h
index 741fa7754700..cab6146a510a 100644
--- a/include/net/busy_poll.h
+++ b/include/net/busy_poll.h
@@ -119,7 +119,7 @@ static inline void sk_busy_loop(struct sock *sk, int nonblock)
#ifdef CONFIG_NET_RX_BUSY_POLL
unsigned int napi_id = READ_ONCE(sk->sk_napi_id);
- if (napi_id >= MIN_NAPI_ID)
+ if (napi_id_valid(napi_id))
napi_busy_loop(napi_id, nonblock ? NULL : sk_busy_loop_end, sk,
READ_ONCE(sk->sk_prefer_busy_poll),
READ_ONCE(sk->sk_busy_poll_budget) ?: BUSY_POLL_BUDGET);
@@ -134,7 +134,7 @@ static inline void skb_mark_napi_id(struct sk_buff *skb,
/* If the skb was already marked with a valid NAPI ID, avoid overwriting
* it.
*/
- if (skb->napi_id < MIN_NAPI_ID)
+ if (!napi_id_valid(skb->napi_id))
skb->napi_id = napi->napi_id;
#endif
}