From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5B6BC433DB for ; Sat, 27 Feb 2021 02:18:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 695EF64F14 for ; Sat, 27 Feb 2021 02:18:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbhB0CPe (ORCPT ); Fri, 26 Feb 2021 21:15:34 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:12210 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbhB0CPa (ORCPT ); Fri, 26 Feb 2021 21:15:30 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DnVRH27m5zlQRP; Sat, 27 Feb 2021 10:12:43 +0800 (CST) Received: from [10.174.177.244] (10.174.177.244) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Sat, 27 Feb 2021 10:14:43 +0800 Subject: Re: [PATCH] net: bridge: Fix jump_label config To: Cong Wang CC: Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , Linux Kernel Network Developers , LKML References: <20210224153803.91194-1-wangkefeng.wang@huawei.com> <1cf51ae7-3bce-3b9f-f6aa-c20499eedf7a@huawei.com> From: Kefeng Wang Message-ID: <6482713d-2b02-4ebe-8963-912e79b3bc99@huawei.com> Date: Sat, 27 Feb 2021 10:14:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.177.244] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/27 4:19, Cong Wang wrote: > On Thu, Feb 25, 2021 at 5:39 PM Kefeng Wang wrote: >> >> On 2021/2/26 5:22, Cong Wang wrote: >>> On Wed, Feb 24, 2021 at 8:03 AM 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 >>> 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. >