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 6783CC6FA81 for ; Fri, 2 Sep 2022 03:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235209AbiIBD1u (ORCPT ); Thu, 1 Sep 2022 23:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235175AbiIBD1g (ORCPT ); Thu, 1 Sep 2022 23:27:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 874E2A0622; Thu, 1 Sep 2022 20:27:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E5636B829B7; Fri, 2 Sep 2022 03:27:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1416CC433C1; Fri, 2 Sep 2022 03:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662089252; bh=qSAS0T0MuBmaWeT8uG5lNnET4yd1Q33sgQdS6DbDcJo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qvnk9aGn58J554jGx93rrg65XFeihTphkgWxYKbWYj+w8dYmNgGUwSWflA4AdmhUg AbVqcYUucbQnz/XNnCf9toUpbL1FvSoz5iThdvfUBVbT9xcgJ7y930xmQ81edGrzb0 TP/dJuUwCZxQ3SgFlCQSOFNt8bP5c4mjOkrAp9p5u5iZsq3hcIeIjziNHJ1a8PY3SX g64TdCOTQ43CVy3z1fs/wpko3HvbEZC/wUG8rZ+GiiC958/B7ga4p01wl+tPNWovoR EaDg0ltOoemE0r+kTJdaEGn4BFVQ9Bd6d766ultH2RxUxLLnALCVt273hjYLNJ78eQ gRXrdlGXfJXmA== Date: Fri, 2 Sep 2022 06:27:27 +0300 From: Jarkko Sakkinen To: Alexei Starovoitov Cc: Roberto Sassu , 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 , David Howells , Steven Rostedt , Ingo Molnar , Paul Moore , James Morris , "Serge E . Hallyn" , Shuah Khan , bpf , keyrings@vger.kernel.org, LSM List , "open list:KERNEL SELFTEST FRAMEWORK" , LKML , Daniel =?iso-8859-1?Q?M=FCller?= , Kumar Kartikeya Dwivedi , Roberto Sassu Subject: Re: [PATCH v14 05/12] KEYS: Move KEY_LOOKUP_ to include/linux/key.h and set KEY_LOOKUP_FLAGS_ALL Message-ID: References: <20220830161716.754078-1-roberto.sassu@huaweicloud.com> <20220830161716.754078-6-roberto.sassu@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: On Wed, Aug 31, 2022 at 08:33:38AM -0700, Alexei Starovoitov wrote: > On Wed, Aug 31, 2022 at 2:24 AM Roberto Sassu > wrote: > > > > > > > > > > +#define KEY_LOOKUP_CREATE 0x01 > > > > > +#define KEY_LOOKUP_PARTIAL 0x02 > > > > > +#define KEY_LOOKUP_FLAGS_ALL (KEY_LOOKUP_CREATE | > > > > > KEY_LOOKUP_PARTIAL) > > > > > > > > IMHO this could be just KEY_LOOKUP_ALL. > > Since this is supposed to be kernel internal flags > please make them enum, so that bpf progs can auto-adjust > (with the help of CORE) to changes in this enum. > With #define there is no way for bpf prog to know > when #define changed in the future kernels. Isn't enum also Rust compatibility requirement, or do I remember incorrectly? Anyway, good suggestion. BR, Jarkko