diff mbox series

net: bridge: Fix jump_label config

Message ID 20210224153803.91194-1-wangkefeng.wang@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: bridge: Fix jump_label config | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers fail 2 blamed authors not CCed: pablo@netfilter.org fw@strlen.de; 4 maintainers not CCed: pablo@netfilter.org kuba@kernel.org fw@strlen.de bridge@lists.linux-foundation.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Kefeng Wang Feb. 24, 2021, 3:38 p.m. UTC
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")
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 net/bridge/br_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski Feb. 24, 2021, 6:54 p.m. UTC | #1
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")
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

You need to CC the authors of the commit you're blaming. Please make
use of scripts/get_maintainers.pl and repost.
Kefeng Wang Feb. 25, 2021, 1:17 a.m. UTC | #2
On 2021/2/25 2:54, Jakub Kicinski wrote:
> 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")
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> 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.
Cong Wang Feb. 25, 2021, 9:22 p.m. UTC | #3
On Wed, Feb 24, 2021 at 8:03 AM Kefeng Wang <wangkefeng.wang@huawei.com> 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")
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

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.
Kefeng Wang Feb. 26, 2021, 1:39 a.m. UTC | #4
On 2021/2/26 5:22, Cong Wang wrote:
> On Wed, Feb 24, 2021 at 8:03 AM Kefeng Wang <wangkefeng.wang@huawei.com> 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")
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> 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()


>
> Thanks.
>
Cong Wang Feb. 26, 2021, 8:19 p.m. UTC | #5
On Thu, Feb 25, 2021 at 5:39 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
>
> On 2021/2/26 5:22, Cong Wang wrote:
> > On Wed, Feb 24, 2021 at 8:03 AM Kefeng Wang <wangkefeng.wang@huawei.com> 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")
> >> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> > 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()

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

#else
struct static_key {
        atomic_t enabled;
};
#endif  /* CONFIG_JUMP_LABEL */

Thanks.
Kefeng Wang Feb. 27, 2021, 2:14 a.m. UTC | #6
On 2021/2/27 4:19, Cong Wang wrote:
> On Thu, Feb 25, 2021 at 5:39 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>>
>> On 2021/2/26 5:22, Cong Wang wrote:
>>> On Wed, Feb 24, 2021 at 8:03 AM Kefeng Wang <wangkefeng.wang@huawei.com> 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")
>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>> 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()
> 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.


>
> #else
> struct static_key {
>          atomic_t enabled;
> };
> #endif  /* CONFIG_JUMP_LABEL */
>
> Thanks.
>
Kefeng Wang March 16, 2021, 3:48 p.m. UTC | #7
On 2021/2/27 4:19, Cong Wang wrote:
> On Thu, Feb 25, 2021 at 5:39 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>>
>> On 2021/2/26 5:22, Cong Wang wrote:
>>> On Wed, Feb 24, 2021 at 8:03 AM Kefeng Wang <wangkefeng.wang@huawei.com> 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")
>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>> 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()
> 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]))


>
> #else
> struct static_key {
>          atomic_t enabled;
> };
> #endif  /* CONFIG_JUMP_LABEL */
>
> Thanks.
>
diff mbox series

Patch

diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 222285d9dae2..065b6cfba40f 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -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