Skip to content

Commit ba05817

Browse files
committed
net, xdp, xsk: fix __sk_mark_napi_id_once napi_id error
Stephen reported the following build error for !CONFIG_NET_RX_BUSY_POLL built kernels: In file included from fs/select.c:32: include/net/busy_poll.h: In function 'sk_mark_napi_id_once': include/net/busy_poll.h:150:36: error: 'const struct sk_buff' has no member named 'napi_id' 150 | __sk_mark_napi_id_once_xdp(sk, skb->napi_id); | ^~ Fix it by wrapping a CONFIG_NET_RX_BUSY_POLL around the helpers. Fixes: b02e5a0 ("xsk: Propagate napi_id to XDP socket Rx path") Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Stephen Rothwell <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Cc: Björn Töpel <[email protected]> Link: https://lore.kernel.org/linux-next/[email protected]
1 parent df54228 commit ba05817

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

include/net/busy_poll.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static inline void sk_mark_napi_id(struct sock *sk, const struct sk_buff *skb)
135135
sk_rx_queue_set(sk, skb);
136136
}
137137

138-
static inline void __sk_mark_napi_id_once_xdp(struct sock *sk, unsigned int napi_id)
138+
static inline void __sk_mark_napi_id_once(struct sock *sk, unsigned int napi_id)
139139
{
140140
#ifdef CONFIG_NET_RX_BUSY_POLL
141141
if (!READ_ONCE(sk->sk_napi_id))
@@ -147,13 +147,17 @@ static inline void __sk_mark_napi_id_once_xdp(struct sock *sk, unsigned int napi
147147
static inline void sk_mark_napi_id_once(struct sock *sk,
148148
const struct sk_buff *skb)
149149
{
150-
__sk_mark_napi_id_once_xdp(sk, skb->napi_id);
150+
#ifdef CONFIG_NET_RX_BUSY_POLL
151+
__sk_mark_napi_id_once(sk, skb->napi_id);
152+
#endif
151153
}
152154

153155
static inline void sk_mark_napi_id_once_xdp(struct sock *sk,
154156
const struct xdp_buff *xdp)
155157
{
156-
__sk_mark_napi_id_once_xdp(sk, xdp->rxq->napi_id);
158+
#ifdef CONFIG_NET_RX_BUSY_POLL
159+
__sk_mark_napi_id_once(sk, xdp->rxq->napi_id);
160+
#endif
157161
}
158162

159163
#endif /* _LINUX_NET_BUSY_POLL_H */

0 commit comments

Comments
 (0)