aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-12-30 10:14:15 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-01-05 19:46:51 -0500
commite9666d10a5677a494260d60d1fa0b73cc7646eb3 (patch)
treefd609e683efff32ed6cc1458e20c40969328a33e /net
parent72d3ebb929de339f991fc49b58942d2d5ecdb753 (diff)
jump_label: move 'asm goto' support test to Kconfig
Currently, CONFIG_JUMP_LABEL just means "I _want_ to use jump label". The jump label is controlled by HAVE_JUMP_LABEL, which is defined like this: #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) # define HAVE_JUMP_LABEL #endif We can improve this by testing 'asm goto' support in Kconfig, then make JUMP_LABEL depend on CC_HAS_ASM_GOTO. Ugly #ifdef HAVE_JUMP_LABEL will go away, and CONFIG_JUMP_LABEL will match to the real kernel capability. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c6
-rw-r--r--net/netfilter/core.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 1b5a4410be0e..82f20022259d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1821,7 +1821,7 @@ EXPORT_SYMBOL_GPL(net_dec_egress_queue);
1821#endif 1821#endif
1822 1822
1823static DEFINE_STATIC_KEY_FALSE(netstamp_needed_key); 1823static DEFINE_STATIC_KEY_FALSE(netstamp_needed_key);
1824#ifdef HAVE_JUMP_LABEL 1824#ifdef CONFIG_JUMP_LABEL
1825static atomic_t netstamp_needed_deferred; 1825static atomic_t netstamp_needed_deferred;
1826static atomic_t netstamp_wanted; 1826static atomic_t netstamp_wanted;
1827static void netstamp_clear(struct work_struct *work) 1827static void netstamp_clear(struct work_struct *work)
@@ -1840,7 +1840,7 @@ static DECLARE_WORK(netstamp_work, netstamp_clear);
1840 1840
1841void net_enable_timestamp(void) 1841void net_enable_timestamp(void)
1842{ 1842{
1843#ifdef HAVE_JUMP_LABEL 1843#ifdef CONFIG_JUMP_LABEL
1844 int wanted; 1844 int wanted;
1845 1845
1846 while (1) { 1846 while (1) {
@@ -1860,7 +1860,7 @@ EXPORT_SYMBOL(net_enable_timestamp);
1860 1860
1861void net_disable_timestamp(void) 1861void net_disable_timestamp(void)
1862{ 1862{
1863#ifdef HAVE_JUMP_LABEL 1863#ifdef CONFIG_JUMP_LABEL
1864 int wanted; 1864 int wanted;
1865 1865
1866 while (1) { 1866 while (1) {
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index dc240cb47ddf..93aaec3a54ec 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(nf_ipv6_ops);
33DEFINE_PER_CPU(bool, nf_skb_duplicated); 33DEFINE_PER_CPU(bool, nf_skb_duplicated);
34EXPORT_SYMBOL_GPL(nf_skb_duplicated); 34EXPORT_SYMBOL_GPL(nf_skb_duplicated);
35 35
36#ifdef HAVE_JUMP_LABEL 36#ifdef CONFIG_JUMP_LABEL
37struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; 37struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS];
38EXPORT_SYMBOL(nf_hooks_needed); 38EXPORT_SYMBOL(nf_hooks_needed);
39#endif 39#endif
@@ -347,7 +347,7 @@ static int __nf_register_net_hook(struct net *net, int pf,
347 if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS) 347 if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS)
348 net_inc_ingress_queue(); 348 net_inc_ingress_queue();
349#endif 349#endif
350#ifdef HAVE_JUMP_LABEL 350#ifdef CONFIG_JUMP_LABEL
351 static_key_slow_inc(&nf_hooks_needed[pf][reg->hooknum]); 351 static_key_slow_inc(&nf_hooks_needed[pf][reg->hooknum]);
352#endif 352#endif
353 BUG_ON(p == new_hooks); 353 BUG_ON(p == new_hooks);
@@ -405,7 +405,7 @@ static void __nf_unregister_net_hook(struct net *net, int pf,
405 if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS) 405 if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS)
406 net_dec_ingress_queue(); 406 net_dec_ingress_queue();
407#endif 407#endif
408#ifdef HAVE_JUMP_LABEL 408#ifdef CONFIG_JUMP_LABEL
409 static_key_slow_dec(&nf_hooks_needed[pf][reg->hooknum]); 409 static_key_slow_dec(&nf_hooks_needed[pf][reg->hooknum]);
410#endif 410#endif
411 } else { 411 } else {