Skip to content

Commit e4dde41

Browse files
borkmanndavem330
authored andcommitted
net: fix compilation when busy poll is not enabled
MIN_NAPI_ID is used in various places outside of CONFIG_NET_RX_BUSY_POLL wrapping, so when it's not set we run into build errors such as: net/core/dev.c: In function 'dev_get_by_napi_id': net/core/dev.c:886:16: error: ‘MIN_NAPI_ID’ undeclared (first use in this function) if (napi_id < MIN_NAPI_ID) ^~~~~~~~~~~ Thus, have MIN_NAPI_ID always defined to fix these errors. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 54a6a04 commit e4dde41

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎include/net/busy_poll.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
#include <linux/sched/signal.h>
3030
#include <net/ip.h>
3131

32-
#ifdef CONFIG_NET_RX_BUSY_POLL
33-
34-
struct napi_struct;
35-
extern unsigned int sysctl_net_busy_read __read_mostly;
36-
extern unsigned int sysctl_net_busy_poll __read_mostly;
37-
3832
/* 0 - Reserved to indicate value not set
3933
* 1..NR_CPUS - Reserved for sender_cpu
4034
* NR_CPUS+1..~0 - Region available for NAPI IDs
4135
*/
4236
#define MIN_NAPI_ID ((unsigned int)(NR_CPUS + 1))
4337

38+
#ifdef CONFIG_NET_RX_BUSY_POLL
39+
40+
struct napi_struct;
41+
extern unsigned int sysctl_net_busy_read __read_mostly;
42+
extern unsigned int sysctl_net_busy_poll __read_mostly;
43+
4444
static inline bool net_busy_loop_on(void)
4545
{
4646
return sysctl_net_busy_poll;

0 commit comments

Comments
 (0)