]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
ip_set: Fix build on kernels without system_power_efficient_wq
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 5 Mar 2020 15:28:22 +0000 (17:28 +0200)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 9 Mar 2020 10:48:23 +0000 (11:48 +0100)
This type of workqueue according to comment in <linux/workqueue.h> is
same as regular @system_wq when power efficiency scheduler options
disabled.

For old kernels where @system_power_efficient_wq is not available use
regular @system_wq to support ipset on kernels below 3.11.

Fixes: 33f08da28324 ("netfilter: ipset: Fix "INFO: rcu detected stall in hash_xxx" reports")
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
configure.ac
kernel/include/linux/netfilter/ipset/ip_set_compat.h.in

index 0167374554e5d580abdfa5cc1de0ffca9e3e3644..b7b69d19a5a2560de58e93b2618271c67eec37b1 100644 (file)
@@ -211,9 +211,10 @@ AC_MSG_CHECKING([kernel source for system_power_efficient_wq])
 if test -f $ksourcedir/include/linux/workqueue.h && \
    $GREP -q 'system_power_efficient_wq' $ksourcedir/include/linux/workqueue.h; then
        AC_MSG_RESULT(yes)
+       AC_SUBST(HAVE_SYSTEM_POWER_EFFICIENT_WQ, define)
 else
        AC_MSG_RESULT(no)
-       AC_MSG_ERROR([Kernel source tree is too old, at least v3.11 is required])
+       AC_SUBST(HAVE_SYSTEM_POWER_EFFICIENT_WQ, undef)
 fi
 
 AC_MSG_CHECKING([kernel source for struct xt_action_param])
index 57c9996e1857d97a7187a8239a4c224d4230e1e5..0261b8dd3c19548489638943f9cb3efa251e6ebe 100644 (file)
@@ -5,6 +5,7 @@
  * xt_set.c, ip_set_core.c, ip_set_getport.c, pfxlen.c too.
  */
 
+#@HAVE_SYSTEM_POWER_EFFICIENT_WQ@ HAVE_SYSTEM_POWER_EFFICIENT_WQ
 #@HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_STRUCT_XT_ACTION_PARAM
 #@HAVE_VZALLOC@ HAVE_VZALLOC
 #@HAVE_ETHER_ADDR_EQUAL@ HAVE_ETHER_ADDR_EQUAL
@@ -168,6 +169,10 @@ static inline void cond_resched_rcu(void)
 #error "NETFILTER_NETLINK must be enabled: select NFACCT/NFQUEUE/LOG over NFNETLINK"
 #endif
 
+#ifndef HAVE_SYSTEM_POWER_EFFICIENT_EQ
+#define system_power_efficient_wq system_wq
+#endif
+
 #ifndef HAVE_STRUCT_XT_ACTION_PARAM
 #define xt_action_param                xt_match_param
 #endif