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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E767CECAAA3 for ; Fri, 26 Aug 2022 15:36:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244831AbiHZPgD (ORCPT ); Fri, 26 Aug 2022 11:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243036AbiHZPfw (ORCPT ); Fri, 26 Aug 2022 11:35:52 -0400 Received: from frasgout12.his.huawei.com (frasgout12.his.huawei.com [14.137.139.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9263131ECD; Fri, 26 Aug 2022 08:35:45 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.18.147.229]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4MDkMv6kHZz9xFm3; Fri, 26 Aug 2022 23:31:55 +0800 (CST) Received: from roberto-ThinkStation-P620 (unknown [10.204.63.22]) by APP1 (Coremail) with SMTP id LxC2BwAHJREl6AhjIoFPAA--.24624S2; Fri, 26 Aug 2022 16:35:16 +0100 (CET) Message-ID: Subject: Re: [PATCH v12 02/10] btf: Handle dynamic pointer parameter in kfuncs From: Roberto Sassu To: Jarkko Sakkinen , Alexei Starovoitov Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Jonathan Corbet , David Howells , Steven Rostedt , Ingo Molnar , Paul Moore , James Morris , "Serge E . Hallyn" , Shuah Khan , bpf , "open list:DOCUMENTATION" , keyrings@vger.kernel.org, LSM List , "open list:KERNEL SELFTEST FRAMEWORK" , LKML , Daniel =?ISO-8859-1?Q?M=FCller?= , Roberto Sassu , Joanne Koong Date: Fri, 26 Aug 2022 17:34:57 +0200 In-Reply-To: References: <20220818152929.402605-1-roberto.sassu@huaweicloud.com> <20220818152929.402605-3-roberto.sassu@huaweicloud.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-CM-TRANSID: LxC2BwAHJREl6AhjIoFPAA--.24624S2 X-Coremail-Antispam: 1UD129KBjvJXoW7KrWUCrW8JF18Xw17JF45Awb_yoW8ZFyDpa ykAa9Fkr4UJr45CwnFqF4FyFnavr1Fqr1kury5J34FvFyqgrnFgFs2qw1Yka45Gr4kCF18 Xa10qry7X3W5AaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkYb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6r1S6rWUM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxV AFwI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG 6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFV Cjc4AY6r1j6r4UM4x0Y48IcVAKI48JM4IIrI8v6xkF7I0E8cxan2IY04v7MxAIw28IcxkI 7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxV Cjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVW8ZVWrXwCIc40Y0x0EwIxGrwCI42IY 6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6x AIw20EY4v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv 6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7IU1c4S7UUUUU== X-CM-SenderInfo: purev21wro2thvvxqx5xdzvxpfor3voofrz/1tbiAQAQBF1jj4JUwgAAsw X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2022-08-26 at 17:43 +0300, Jarkko Sakkinen wrote: > On Fri, Aug 26, 2022 at 08:46:14AM +0300, Jarkko Sakkinen wrote: > > On Thu, Aug 25, 2022 at 10:16:14PM -0700, Alexei Starovoitov wrote: > > > On Thu, Aug 25, 2022 at 9:54 PM Jarkko Sakkinen < > > > jarkko@kernel.org> wrote: > > > > > -static bool is_dynptr_reg_valid_init(struct bpf_verifier_env > > > > > *env, struct bpf_reg_state *reg, > > > > > - enum bpf_arg_type > > > > > arg_type) > > > > > +bool is_dynptr_reg_valid_init(struct bpf_verifier_env *env, > > > > > struct bpf_reg_state *reg, > > > > > + enum bpf_arg_type arg_type) > > > > > { > > > > > struct bpf_func_state *state = func(env, reg); > > > > > int spi = get_spi(reg->off); > > > > > -- > > > > > 2.25.1 > > > > > > > > > > > > > Might be niticking but generally I'd consider splitting > > > > exports as commits of their own. > > > > > > -static bool > > > +bool > > > > > > into a separate commit? > > > > > > I guess it makes sense for people whose salary depends on > > > number of commits. > > > We don't play these games. > > > > What kind of argument is that anyway. > > "Separate each *logical change* into a separate patch." [*] The logical change, as per the patch subject, is allowing the possibility of including eBPF dynamic pointers in a kfunc definition. It requires to call an existing function that was already defined elsewhere. Maybe I'm wrong, but I don't see only exporting a function definition to an include file as a logical change. To me, the changes in this patch are clearly connected. Or even better, they tell why the function definition has been exported, that would not appear if moving the function definition is a standalone patch. > > To add, generally any user space visible space should be an > isolated patch. As far as I understood, definitions visible to user space should be in include/uapi. > > Please, stop posting nonsense. If I may, saying this does not encourage people to try to submit their code. I feel it is a bit strong, and I kindly ask you to express your opinion in a more gentle way. Thanks Roberto