Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1899384rwd; Tue, 13 Jun 2023 16:23:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56lGrrF4li+p7n8PCHa7pp5deC3v+fr9jBwXS6vvZ7HJ+RtkKHF7bKqarPbpD9OMCvc8nx X-Received: by 2002:a05:6830:16:b0:6a6:5a48:1f9b with SMTP id c22-20020a056830001600b006a65a481f9bmr11720743otp.8.1686698637971; Tue, 13 Jun 2023 16:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686698637; cv=none; d=google.com; s=arc-20160816; b=Qhy/K1rQIyYLYCmCOCXILY59jFU4lIMXGdqlDkxlMtBIQVPBaKwfT5gIgb+vEX/aa0 p4VuheKICMw1p3P8s8nJKtlpubdIBCP0j1pf0P5XYB5ZTMxBQ6r9TwxtoqBgUoqpoHka 3hdiymGzSH5HTgGTRPkJ9MhmfTuzIxz980GD5nwYN/vIKIqgIg9LGreL35Oby9MsRYPN 7eh7MRviYNgo9ImJEQx4TfcNpFExEA+AkbeWxjOG4Fc6sxOfV2dL7RqMgQbfjHQI65AQ HcTLtIZassx2iezW/r3Zm9ZXBNa5QFYert1IaXkJRYSsGDXSlcdrkw3tYwJovzf/lcM/ xjJw== 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:date:subject:cc:to:from :dkim-signature; bh=X7hIy7WiNfFLIPNIqtRYDgOI0L4uTaH4JmogHfs6zm8=; b=DNXikZ1XgoSbFJtY0eT4JGpYYPQUJNR9DQC3YPtSSEc2YRI5N54c7i2EbeZ6Opeox6 33DwuIwIkG+Nyf9mV50R2qwqb03D7t7fBVnR1eVmpq8uiFiJI9TMMEi+RycJzKVb03L7 edh0xBurwpREx6mGRCiYw1E4/4ngLAB+zHJr6/dcOrNUZ+1J4xBQsYU1bvXg0ek1mrNu TLeu00za4BlQmxC68VQZ3xlOW7YD53meFzhsA9cVrTRNl/MnHI8ByrIyDM5BLZXAjqA4 RRMODNnuoFLAqgs/+a8ecpkrBz5VQBdcHHdIL89I2BgBb40tgAwPBGkT0ePsZblMwiY/ glmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="L/fZXcD1"; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a635904000000b0053faf25b178si5946152pgb.365.2023.06.13.16.23.46; Tue, 13 Jun 2023 16:23:57 -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=@intel.com header.s=Intel header.b="L/fZXcD1"; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241388AbjFMXT1 (ORCPT + 99 others); Tue, 13 Jun 2023 19:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230496AbjFMXT0 (ORCPT ); Tue, 13 Jun 2023 19:19:26 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D959C19A5; Tue, 13 Jun 2023 16:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686698364; x=1718234364; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4YUc8eMzQy16ISjWd8qD4X/ti5WdyqeoNpQ/wqfutZE=; b=L/fZXcD1yg7S3FINJgyb/X14YTm9EQtvTYEDwXN2dk8eHa+yhE8FwIR/ UIXzxtXK/UJ8QOgJVP/7yu1auWCFjaLPflQUqKGz1F/YBQA9CnQN0Sr5Y dLJvuDGwspA8h1stIomGmvKvdK5gifLId7t+ILXFZujAxCyyIZDt2Y+eS yBhLapflFjP+sOqJY1CmLw0Vc4kKGenQcWhaQw1eTxBTIVy+K3nFl6p4c poB+VATu7Gd29My2/Pp3eDqyLWto0fXjIQjqAyc9YD1WaFH6SxfySUXsx xfjLXHyAGTnDBTqznWnPx5OSYDSfuYn69uvhIDuuz9qivKpTUD0hU8hOK Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="357352750" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="357352750" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 16:19:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="777011273" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="777011273" Received: from amlin-018-114.igk.intel.com ([10.102.18.114]) by fmsmga008.fm.intel.com with ESMTP; 13 Jun 2023 16:19:22 -0700 From: Arkadiusz Kubalewski To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com, edumazet@google.com, chuck.lever@oracle.com Cc: Arkadiusz Kubalewski Subject: [PATCH net-next] tools: ynl-gen: generate docs for _max/_mask enums Date: Wed, 14 Jun 2023 01:17:09 +0200 Message-Id: <20230613231709.150622-3-arkadiusz.kubalewski@intel.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230613231709.150622-1-arkadiusz.kubalewski@intel.com> References: <20230613231709.150622-1-arkadiusz.kubalewski@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 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. Signed-off-by: Arkadiusz Kubalewski --- include/uapi/linux/netdev.h | 1 + tools/include/uapi/linux/netdev.h | 1 + tools/net/ynl/ynl-gen-c.py | 11 ++++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) 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 */ 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' + 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: -- 2.37.3