Skip to contentSkip to conversation

net: bridge: Fix jump_label config

PATCH In review Kefeng Wang 3 participants 8 messages Feb 24, 2021 – Mar 16, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: bridge: Fix jump_label config

HAVE_JUMP_LABLE is removed by commit e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig"), use CONFIG_JUMP_LABLE instead of HAVE_JUMP_LABLE.

Fixes 971502d77faa ("bridge: netfilter: unroll NF_HOOK helper in bridge input path")
---
 net/bridge/br_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_input.c +1 -1
index 222285d9dae2..065b6cfba40f 100644
@@ -207,7 +207,7 @@ static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb)
 	int ret;
 
 	net = dev_net(skb->dev);
-#ifdef HAVE_JUMP_LABEL
+#ifdef CONFIG_JUMP_LABEL
 	if (!static_key_false(&nf_hooks_needed[NFPROTO_BRIDGE][NF_BR_PRE_ROUTING]))
 		goto frame_finish;
 #endif
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 6 lines · On Wed, 24 Feb 2021 23:38:03 +0800 Kefeng Wang wrote:

HAVE_JUMP_LABLE is removed by commit e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig"), use CONFIG_JUMP_LABLE instead of HAVE_JUMP_LABLE.

Fixes 971502d77faa ("bridge: netfilter: unroll NF_HOOK helper in bridge input path")

You need to CC the authors of the commit you're blaming. Please make use of scripts/get_maintainers.pl and repost.

#2 lore raw
Quoted 9 lines · Jakub Kicinski
Quoted 6 lines · On Wed, 24 Feb 2021 23:38:03 +0800 Kefeng Wang wrote:

HAVE_JUMP_LABLE is removed by commit e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig"), use CONFIG_JUMP_LABLE instead of HAVE_JUMP_LABLE.

Fixes 971502d77faa ("bridge: netfilter: unroll NF_HOOK helper in bridge input path")

You need to CC the authors of the commit you're blaming. Please make use of scripts/get_maintainers.pl and repost.

Yes, I use get_maintainers.pl, but only add maintainers to the list, thanks for your reminder,

cc the author Florian now.

#3 lore raw
In reply to Kefeng Wang
Quoted 7 lines · Kefeng Wang

HAVE_JUMP_LABLE is removed by commit e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig"), use CONFIG_JUMP_LABLE instead of HAVE_JUMP_LABLE.

Fixes 971502d77faa ("bridge: netfilter: unroll NF_HOOK helper in bridge input path")

Hmm, why do we have to use a macro here? static_key_false() is defined in both cases, CONFIG_JUMP_LABEL=y or CONFIG_JUMP_LABEL=n.

Thanks.

#4 lore raw
Quoted 9 lines · Cong Wang
Quoted 6 lines · Kefeng Wang

HAVE_JUMP_LABLE is removed by commit e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig"), use CONFIG_JUMP_LABLE instead of HAVE_JUMP_LABLE.

Fixes 971502d77faa ("bridge: netfilter: unroll NF_HOOK helper in bridge input path")

Hmm, why do we have to use a macro here? static_key_false() is defined in both cases, CONFIG_JUMP_LABEL=y or CONFIG_JUMP_LABEL=n.

It seems that all nf_hooks_needed related are using the macro,

see net/netfilter/core.c and include/linux/netfilter.h,

  #ifdef CONFIG_JUMP_LABEL
  struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; EXPORT_SYMBOL(nf_hooks_needed);
#endif

  nf_static_key_inc()/nf_static_key_dec()

Quoted 3 lines

Thanks.

#5 lore raw
Quoted 15 lines · Kefeng Wang
Quoted 9 lines · Cong Wang
Quoted 6 lines · Kefeng Wang

HAVE_JUMP_LABLE is removed by commit e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig"), use CONFIG_JUMP_LABLE instead of HAVE_JUMP_LABLE.

Fixes 971502d77faa ("bridge: netfilter: unroll NF_HOOK helper in bridge input path")

Hmm, why do we have to use a macro here? static_key_false() is defined in both cases, CONFIG_JUMP_LABEL=y or CONFIG_JUMP_LABEL=n.

It seems that all nf_hooks_needed related are using the macro,

Quoted 8 lines

see net/netfilter/core.c and include/linux/netfilter.h,

   #ifdef CONFIG_JUMP_LABEL
   struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS];

EXPORT_SYMBOL(nf_hooks_needed);
#endif

   nf_static_key_inc()/nf_static_key_dec()

Same question: why? Clearly struct static_key is defined in both cases:

#else

struct static_key {
        atomic_t enabled;
};

#endif /* CONFIG_JUMP_LABEL */

Thanks.

#6 lore raw
Quoted 16 lines · Cong Wang
Quoted 15 lines · Kefeng Wang
Quoted 9 lines · Cong Wang
Quoted 6 lines · Kefeng Wang

HAVE_JUMP_LABLE is removed by commit e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig"), use CONFIG_JUMP_LABLE instead of HAVE_JUMP_LABLE.

Fixes 971502d77faa ("bridge: netfilter: unroll NF_HOOK helper in bridge input path")

Hmm, why do we have to use a macro here? static_key_false() is defined in both cases, CONFIG_JUMP_LABEL=y or CONFIG_JUMP_LABEL=n.

It seems that all nf_hooks_needed related are using the macro,

see net/netfilter/core.c and include/linux/netfilter.h,

Quoted 7 lines
Quoted 6 lines
    #ifdef CONFIG_JUMP_LABEL
    struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS];

EXPORT_SYMBOL(nf_hooks_needed);
#endif

    nf_static_key_inc()/nf_static_key_dec()

Same question: why? Clearly struct static_key is defined in both cases:

Ok,  I mean that I don't change the original logic, but that's no need this macro actually,

it could be built with or without CONFIG_JUMP_LABEL, only increased the size a little bit.

Quoted 9 lines

#else

struct static_key {
         atomic_t enabled;
};

#endif /* CONFIG_JUMP_LABEL */

Thanks.

#7 lore raw
In reply to Cong Wang
Quoted 16 lines · Cong Wang
Quoted 15 lines · Kefeng Wang
Quoted 9 lines · Cong Wang
Quoted 6 lines · Kefeng Wang

HAVE_JUMP_LABLE is removed by commit e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig"), use CONFIG_JUMP_LABLE instead of HAVE_JUMP_LABLE.

Fixes 971502d77faa ("bridge: netfilter: unroll NF_HOOK helper in bridge input path")

Hmm, why do we have to use a macro here? static_key_false() is defined in both cases, CONFIG_JUMP_LABEL=y or CONFIG_JUMP_LABEL=n.

It seems that all nf_hooks_needed related are using the macro,

see net/netfilter/core.c and include/linux/netfilter.h,

Quoted 7 lines
Quoted 6 lines
    #ifdef CONFIG_JUMP_LABEL
    struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS];

EXPORT_SYMBOL(nf_hooks_needed);
#endif

    nf_static_key_inc()/nf_static_key_dec()

Same question: why? Clearly struct static_key is defined in both cases:

Hi Cong,  the nf_hooks_needed is wrapped up by this macro, so this place should use it,

or we will meet the build issue,  thanks.

../net/bridge/br_input.c: In function ‘nf_hook_bridge_pre’:
../net/bridge/br_input.c:211:25: error: ‘nf_hooks_needed’ undeclared (first use in this function) 211 |  if (!static_key_false(&nf_hooks_needed[NFPROTO_BRIDGE][NF_BR_PRE_ROUTING]))

Quoted 9 lines

#else

struct static_key {
         atomic_t enabled;
};

#endif /* CONFIG_JUMP_LABEL */

Thanks.