| From e4dde4127396f0c8f1c2e11b3ecc5baf4f8628bf Mon Sep 17 00:00:00 2001 |
| From: Daniel Borkmann <daniel@iogearbox.net> |
| Date: Fri, 11 Aug 2017 18:31:24 +0200 |
| Subject: [PATCH] net: fix compilation when busy poll is not enabled |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| commit e4dde4127396f0c8f1c2e11b3ecc5baf4f8628bf upstream. |
| |
| 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> |
| |
| diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h |
| index 8ffd434676b7..71c72a939bf8 100644 |
| --- a/include/net/busy_poll.h |
| +++ b/include/net/busy_poll.h |
| @@ -29,18 +29,18 @@ |
| #include <linux/sched/signal.h> |
| #include <net/ip.h> |
| |
| -#ifdef CONFIG_NET_RX_BUSY_POLL |
| - |
| -struct napi_struct; |
| -extern unsigned int sysctl_net_busy_read __read_mostly; |
| -extern unsigned int sysctl_net_busy_poll __read_mostly; |
| - |
| /* 0 - Reserved to indicate value not set |
| * 1..NR_CPUS - Reserved for sender_cpu |
| * NR_CPUS+1..~0 - Region available for NAPI IDs |
| */ |
| #define MIN_NAPI_ID ((unsigned int)(NR_CPUS + 1)) |
| |
| +#ifdef CONFIG_NET_RX_BUSY_POLL |
| + |
| +struct napi_struct; |
| +extern unsigned int sysctl_net_busy_read __read_mostly; |
| +extern unsigned int sysctl_net_busy_poll __read_mostly; |
| + |
| static inline bool net_busy_loop_on(void) |
| { |
| return sysctl_net_busy_poll; |
| -- |
| 2.1.4 |
| |