From b9d752105e5fdcbd9d0126d61da2f6df4a18560f Mon Sep 17 00:00:00 2001 From: Stefano Jordhani Date: Fri, 14 Feb 2025 18:17:51 +0000 Subject: 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 Signed-off-by: Stefano Jordhani Reviewed-by: Joe Damato Reviewed-by: Jens Axboe # for iouring Link: https://patch.msgid.link/20250214181801.931-1-sjordhani@gmail.com Signed-off-by: Jakub Kicinski --- include/net/busy_poll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') 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 } -- cgit v1.2.3