Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1991828rwd; Tue, 13 Jun 2023 18:05:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4oNwvgBjdyQZe4W5M/DrW6wm38zfPKPT5vfGOKH7lgfNP7KyjGpYuS6vZ9PUXq3FXhVy1Q X-Received: by 2002:a17:90a:1d0:b0:25b:ea03:966 with SMTP id 16-20020a17090a01d000b0025bea030966mr341449pjd.8.1686704722132; Tue, 13 Jun 2023 18:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686704722; cv=none; d=google.com; s=arc-20160816; b=m8keZJhT0E4EwFqj8JOrJ5rXGWOtbADo+myY6mhDlWs8XaLW76YTLzLCeKzlIQ+xXt iFolFUOnBfhGaCPxD2ntAuCDmvqUYnboyqgonuAyU3ykh+7xYDUwIKuyg9m5YCSuw0eo BzqyLkViiQ8JDveEh+RZRbuj3dlY3Tfud3OiS9Kw8M7l6IjEariHQ+8gU9DvWc3UaQZQ mDFMeIoFL13rObf7Idma2O4w+75FXVO0hGjl6+kwSUAT7SEGnopp726l0ME9inAJD1Z+ vMiQAaR6861aWguqaa6yY4PwjGw22pn0y/3Y5fFdGBiawJ0i7MXQSuQc0JJsgJgw4ALp di3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=4uP1LKjzNsO94d3SS69H73SqGxJBlBMGdZYBRrJY/Jw=; b=NCfRTRTqW8FZoMebvmsery30qtzgPzOS3FwoXcbKl0q+a9DWzDa+ah3qpBQfO3ih6n bHyJN17ku5biZATZE9JL6OxY28K/mHgIsb5zCXDt2CdEBVqAfCBgPszizYma2tyqHVoo 2oixRTOQZhR/PIGPMUKNeXyudzTYkkS9iDSKG+0sQffmlLJsehu84G2v3oJoRQMitP/L hwoHZtL7koMwHw2Dgmq3ZHadsVPbHLwxoqk/qAy4uyn7Zko0B3Qyegjujo3hKFBrMGsz vePnawQaEvCqCu84YTj08YAPUkmhh7Unnv3tCwlJgY0PTxTCv8U7qy7IFwwMUKNmNj6g SVhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qykmu0vn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a17090a8d0600b0025c1ff9cd67si1841670pjo.184.2023.06.13.18.05.05; Tue, 13 Jun 2023 18:05:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qykmu0vn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233139AbjFNA7d (ORCPT + 99 others); Tue, 13 Jun 2023 20:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230397AbjFNA7c (ORCPT ); Tue, 13 Jun 2023 20:59:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25FB119B9 for ; Tue, 13 Jun 2023 17:59:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9E27B63C4C for ; Wed, 14 Jun 2023 00:59:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB1EEC433C0; Wed, 14 Jun 2023 00:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686704370; bh=zB9UYvCUrHct3KozJ6bR9E0Mk/Fg5bLPg/OkjHummI4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Qykmu0vn9edP7NBNd7yu54l+aXbTi13MJ5NiV5Lk0HQ3NHIxNlyQFFIzTY0U8bwjY mknVyKxNYNdQuQk62Kx4kTgJB8/lC+9bhLJCwRz8c9amewBngXrpnbGBVoMe0Nvqpo qy3DimYwxu+OGpyCUGYUJAa+bTWbMRDLk3+B1AZd14OmUZt2EbLDHWQWGZPcpK0u3l 1Ahmum00mYvW1hdrBXXMHz5UtJLn9aT+d9svXGyGKCOh1Acethz10YBpsDOW0FdS8Z yz+jkgU7TzF8zfXkWLNkfZvZ3VlhoOYOeZiFrZuxDg0C+CP2phoLAhJc1fHR8/CHXr Y5nh8+2yrbXmw== Date: Tue, 13 Jun 2023 17:59:28 -0700 From: Jakub Kicinski To: Arkadiusz Kubalewski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, pabeni@redhat.com, edumazet@google.com, chuck.lever@oracle.com Subject: Re: [PATCH net-next] tools: ynl-gen: generate docs for _max/_mask enums Message-ID: <20230613175928.4ea56833@kernel.org> In-Reply-To: <20230613231709.150622-3-arkadiusz.kubalewski@intel.com> References: <20230613231709.150622-1-arkadiusz.kubalewski@intel.com> <20230613231709.150622-3-arkadiusz.kubalewski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 14 Jun 2023 01:17:09 +0200 Arkadiusz Kubalewski wrote: > Including ynl generated uapi header files into source kerneldocs > (rst files in Documentation/) produces warnings during documentation > builds (i.e. make htmldocs) > > Prevent warnings by generating also description for enums where rander_max > was selected. Do you reckon that documenting the meta-values makes sense, or should we throw a: /* private: */ comment in front of them so that kdoc ignores them? Does user space have any use for those? If we want to document them... > diff --git a/include/uapi/linux/netdev.h b/include/uapi/linux/netdev.h > index 639524b59930..d78f7ae95092 100644 > --- a/include/uapi/linux/netdev.h > +++ b/include/uapi/linux/netdev.h > @@ -24,6 +24,7 @@ > * XDP buffer support in the driver napi callback. > * @NETDEV_XDP_ACT_NDO_XMIT_SG: This feature informs if netdev implements > * non-linear XDP buffer support in ndo_xdp_xmit callback. > + * @NETDEV_XDP_ACT_MASK: valid values mask ... I think we need to include some sort of indication that the value will change as the uAPI is extended. Unlike the other values which are set in stone, so to speak. "mask of currently defines values" ? Dunno. > */ > enum netdev_xdp_act { > NETDEV_XDP_ACT_BASIC = 1, > diff --git a/tools/include/uapi/linux/netdev.h b/tools/include/uapi/linux/netdev.h > index 639524b59930..d78f7ae95092 100644 > --- a/tools/include/uapi/linux/netdev.h > +++ b/tools/include/uapi/linux/netdev.h > @@ -24,6 +24,7 @@ > * XDP buffer support in the driver napi callback. > * @NETDEV_XDP_ACT_NDO_XMIT_SG: This feature informs if netdev implements > * non-linear XDP buffer support in ndo_xdp_xmit callback. > + * @NETDEV_XDP_ACT_MASK: valid values mask > */ > enum netdev_xdp_act { > NETDEV_XDP_ACT_BASIC = 1, > diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py > index 0b5e0802a9a7..0d396bf98c27 100755 > --- a/tools/net/ynl/ynl-gen-c.py > +++ b/tools/net/ynl/ynl-gen-c.py > @@ -2011,6 +2011,7 @@ def render_uapi(family, cw): > # Write kdoc for enum and flags (one day maybe also structs) > if const['type'] == 'enum' or const['type'] == 'flags': > enum = family.consts[const['name']] > + name_pfx = const.get('name-prefix', f"{family.name}-{const['name']}-") > > if enum.has_doc(): > cw.p('/**') > @@ -2022,10 +2023,18 @@ def render_uapi(family, cw): > if entry.has_doc(): > doc = '@' + entry.c_name + ': ' + entry['doc'] > cw.write_doc_line(doc) > + if const.get('render-max', False): > + if const['type'] == 'flags': > + doc = '@' + c_upper(name_pfx + 'mask') + ': valid values mask' > + cw.write_doc_line(doc) > + else: > + doc = '@' + c_upper(name_pfx + 'max') + ': max valid value' > + cw.write_doc_line(doc) > + doc = '@__' + c_upper(name_pfx + 'max') + ': do not use' This one is definitely a candidate for /* private: */ > + cw.write_doc_line(doc) > cw.p(' */') > > uapi_enum_start(family, cw, const, 'name') > - name_pfx = const.get('name-prefix', f"{family.name}-{const['name']}-") > for entry in enum.entries.values(): > suffix = ',' > if entry.value_change: -- pw-bot: cr