From patchwork Fri Oct 6 11:44:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 13411367 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB26F1CA8C for ; Fri, 6 Oct 2023 11:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b="oGGsFxLR" Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DBA6E4 for ; Fri, 6 Oct 2023 04:44:42 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-533c8f8f91dso3633822a12.0 for ; Fri, 06 Oct 2023 04:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1696592680; x=1697197480; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ii4gxHizNkBKZ7JHXJWQQOBCTacf6Nj1CsOMRBtICuI=; b=oGGsFxLRm5kJ96u+/LspXw+nOinUK5y3Xn+I/5zu3GzsQmk1SD0kZAiO6o6+UDWrfz M5q050bYqVPMK3a6DiWR0zln2tTAxu/LQoXsAJt15zePU+uyWXfvvKvhL5Tne1RrTBRq R7Ps1MlPL2uHxvWQrWlJsJLLl1rSeZQ7/joiGHvsOgcT7hlP1dHX0y6orMtgTds6jpFN 5iML8uGrOHB7K6Fxexh4JoZYr+Vn5/di1NsKMNYaQ7mGCyIBUT5WQG5ny4lUyDkc2//+ rEo9XGiBWoNBP5jc5vLn5Du4iPpvvGJW5QzlJ8CRzvyQuezNZcyYsG1iITrEj92PMOvN yuKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696592680; x=1697197480; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ii4gxHizNkBKZ7JHXJWQQOBCTacf6Nj1CsOMRBtICuI=; b=gPFDH+yWob1TGeVhMVs6Dy1/kzcOlZrkSd+0sun3Cf+WazD1skLN8Yk+aKOSkeODuu Kd3z/yueX6pvspMRL19EbNEvl2Sg5kIlD6cMO2EEv4fECna8YfmHIwJ2cJR6abM2gTdi ZmOctUE9WXdDQJzwwsjiTvVCOyK/yzA4Qq6jYGgYfbgR0HTqjf2cvvunYeQx9D+1unBQ MKeUSoVpJf/6eSfCGm4Zv1VSFmn9hWgvb7U5n1U55jUvcu0oRNuM/+cSd/FuHxitXDQU yXjmi/gu51qLCuZLUKzCNFv1nlu6IvxI26IuIeX/iTzci2Nfsi4q31LfCPjOdohOcoDJ rUVA== X-Gm-Message-State: AOJu0YwRffm6Ir6d3LA/1hmNAFIluN5M6ybgbh7tGPK5gSXPQG2bU+7g RGMRk8aaWtDxquLRABG3VHUk/jUaj96hyhOcGwAiXw== X-Google-Smtp-Source: AGHT+IGRgNwBRasyhyRxhEvi0biaAyYPA5KZjZxubzlGvRCw6zBX7ZyUue9DLNb7LmESA27oeFpqAQ== X-Received: by 2002:a05:6402:1257:b0:52b:c980:43f3 with SMTP id l23-20020a056402125700b0052bc98043f3mr7185868edw.28.1696592680295; Fri, 06 Oct 2023 04:44:40 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id bm15-20020a0564020b0f00b005346925a474sm2471948edb.43.2023.10.06.04.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 04:44:39 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, donald.hunter@gmail.com Subject: [patch net-next v3 1/2] tools: ynl-gen: lift type requirement for attribute subsets Date: Fri, 6 Oct 2023 13:44:35 +0200 Message-ID: <20231006114436.1725425-2-jiri@resnulli.us> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231006114436.1725425-1-jiri@resnulli.us> References: <20231006114436.1725425-1-jiri@resnulli.us> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Jiri Pirko In case an attribute is used in a subset, the type has to be currently specified. As the attribute is already defined in the original set, this is a redundant information in yaml file, moreover, may lead to inconsistencies. Example: attribute-sets: ... name: pin enum-name: dpll_a_pin attributes: ... - name: parent-id type: u32 ... - name: pin-parent-device subset-of: pin attributes: - name: parent-id type: u32 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Remove the requirement from schema files to specify the "type" for attribute subsets. Signed-off-by: Jiri Pirko Reviewed-by: Jakub Kicinski --- v2->v3: - handled in schema instead of py file --- Documentation/netlink/genetlink-c.yaml | 14 +++++++++++++- Documentation/netlink/genetlink-legacy.yaml | 14 +++++++++++++- Documentation/netlink/genetlink.yaml | 14 +++++++++++++- Documentation/netlink/netlink-raw.yaml | 14 +++++++++++++- 4 files changed, 52 insertions(+), 4 deletions(-) diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml index 9806c44f604c..32736b2d8ae8 100644 --- a/Documentation/netlink/genetlink-c.yaml +++ b/Documentation/netlink/genetlink-c.yaml @@ -142,7 +142,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: @@ -215,6 +215,18 @@ properties: not: required: [ name-prefix ] + # type property is only required if not in subset definition + if: + properties: + subset-of: + not: + type: string + then: + properties: + attributes: + items: + required: [ type ] + operations: description: Operations supported by the protocol. type: object diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml index 12a0a045605d..25fe1379b180 100644 --- a/Documentation/netlink/genetlink-legacy.yaml +++ b/Documentation/netlink/genetlink-legacy.yaml @@ -180,7 +180,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: @@ -254,6 +254,18 @@ properties: not: required: [ name-prefix ] + # type property is only required if not in subset definition + if: + properties: + subset-of: + not: + type: string + then: + properties: + attributes: + items: + required: [ type ] + operations: description: Operations supported by the protocol. type: object diff --git a/Documentation/netlink/genetlink.yaml b/Documentation/netlink/genetlink.yaml index 3d338c48bf21..6ea1c947ce51 100644 --- a/Documentation/netlink/genetlink.yaml +++ b/Documentation/netlink/genetlink.yaml @@ -115,7 +115,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: @@ -184,6 +184,18 @@ properties: not: required: [ name-prefix ] + # type property is only required if not in subset definition + if: + properties: + subset-of: + not: + type: string + then: + properties: + attributes: + items: + required: [ type ] + operations: description: Operations supported by the protocol. type: object diff --git a/Documentation/netlink/netlink-raw.yaml b/Documentation/netlink/netlink-raw.yaml index 896797876414..d976851b80f8 100644 --- a/Documentation/netlink/netlink-raw.yaml +++ b/Documentation/netlink/netlink-raw.yaml @@ -187,7 +187,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: @@ -261,6 +261,18 @@ properties: not: required: [ name-prefix ] + # type property is only required if not in subset definition + if: + properties: + subset-of: + not: + type: string + then: + properties: + attributes: + items: + required: [ type ] + operations: description: Operations supported by the protocol. type: object From patchwork Fri Oct 6 11:44:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 13411368 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 942511CAA8 for ; Fri, 6 Oct 2023 11:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b="aipao1bB" Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78087FC for ; Fri, 6 Oct 2023 04:44:43 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9ad8a822508so389340066b.0 for ; Fri, 06 Oct 2023 04:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1696592682; x=1697197482; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B9PEosJMsHWRSr2pDOgl6oCzuBJxkPTSWpQFLLDnNm4=; b=aipao1bBCFTrKzzD8b2ZqxiOpdWwns+ynXU0BXg24vIAIrv4VgFNs/DFeYQGxkzdNB QXyq0PUtEdQdG3SXBj6H4F34gn1pOgfJuapBKkkqIUfPHrkY0ksayGMUInGH715Vht56 fffaLNa1MRMuInRbr7OnQiFK5sP2N4nrIBKTivh9YENeTSvXsRp1lwZe+4/yTtp/3hz5 vR7GCERDOogWXLe65FlY7vuCRGHRJHzzVmgnK8DMJ5QCUm9+kPa9V3Eyv/wFYWAMjTtE RWC0f86xmf0kezU8t/IAlG5LgBg8sgVcu8wJSQQgjIK9Ta23dtiwgFsX4+pKAxSWtE+p e6bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696592682; x=1697197482; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B9PEosJMsHWRSr2pDOgl6oCzuBJxkPTSWpQFLLDnNm4=; b=Bk5ycPlq67VOemIvXxhVe6lpuvT8PMyER43Sk0rB3Esp3hB3gQjgOuuE5gDKVees1K HoqOvrMhWdBK2cSYEG2eLApsuMhAjGME1FPBX1ZzT9zlKS8FiJUmTe6WLXPVFNpUvH0j 0SJH8rZiT02KaXYEetKSzsm8Mt0AIkrEimro2mIoS6ayT1Akd/HdmfcHFIn8yy/gbTmS NySjyM9lEAdn21iNVybp0Ncm0mk/yyEXIn9ELjT2vmyudcpiPs+4YE79u2jMcN+4fl0A At13m6Kwye6SZGlqeEqvpVlVqiKN7BB88KlipRw1yPZ+rBbOL1uixIhTuBRV0swtEYxF r7TQ== X-Gm-Message-State: AOJu0Yx7nxXeXiP0AzBKiJsXwHAAEy+O98BMfm+H+S6O6S96usYTx7uv S7UWXjiyka2dGAh63wHobbcQsiPtEQdLbHEpQbWN+Q== X-Google-Smtp-Source: AGHT+IFkZo6dgEuWQvKKFQx8oe+sCHMcjSWpa3sttEw5VxQxEY3sxGbvXkpAlRQlCzZoHSmAyQ14iA== X-Received: by 2002:a17:906:7484:b0:9b9:f980:8810 with SMTP id e4-20020a170906748400b009b9f9808810mr1696588ejl.34.1696592681992; Fri, 06 Oct 2023 04:44:41 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id t8-20020a17090616c800b009a1be9c29d7sm2771288ejd.179.2023.10.06.04.44.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 04:44:41 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, donald.hunter@gmail.com Subject: [patch net-next v3 2/2] netlink: specs: remove redundant type keys from attributes in subsets Date: Fri, 6 Oct 2023 13:44:36 +0200 Message-ID: <20231006114436.1725425-3-jiri@resnulli.us> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231006114436.1725425-1-jiri@resnulli.us> References: <20231006114436.1725425-1-jiri@resnulli.us> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Jiri Pirko No longer needed to define type for subset attributes. Remove those. Signed-off-by: Jiri Pirko Reviewed-by: Jakub Kicinski --- v1->v2: - new patch --- Documentation/netlink/specs/devlink.yaml | 10 ---------- Documentation/netlink/specs/dpll.yaml | 8 -------- Documentation/netlink/specs/ethtool.yaml | 3 --- 3 files changed, 21 deletions(-) diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netlink/specs/devlink.yaml index d1ebcd927149..86a12c5bcff1 100644 --- a/Documentation/netlink/specs/devlink.yaml +++ b/Documentation/netlink/specs/devlink.yaml @@ -199,54 +199,44 @@ attribute-sets: attributes: - name: reload-stats - type: nest - name: remote-reload-stats - type: nest - name: dl-reload-stats subset-of: devlink attributes: - name: reload-action-info - type: nest - name: dl-reload-act-info subset-of: devlink attributes: - name: reload-action - type: u8 - name: reload-action-stats - type: nest - name: dl-reload-act-stats subset-of: devlink attributes: - name: reload-stats-entry - type: nest - name: dl-reload-stats-entry subset-of: devlink attributes: - name: reload-stats-limit - type: u8 - name: reload-stats-value - type: u32 - name: dl-info-version subset-of: devlink attributes: - name: info-version-name - type: string - name: info-version-value - type: string operations: enum-model: directional diff --git a/Documentation/netlink/specs/dpll.yaml b/Documentation/netlink/specs/dpll.yaml index 8b86b28b47a6..1c1b53136c7b 100644 --- a/Documentation/netlink/specs/dpll.yaml +++ b/Documentation/netlink/specs/dpll.yaml @@ -278,36 +278,28 @@ attribute-sets: attributes: - name: parent-id - type: u32 - name: direction - type: u32 - name: prio - type: u32 - name: state - type: u32 - name: pin-parent-pin subset-of: pin attributes: - name: parent-id - type: u32 - name: state - type: u32 - name: frequency-range subset-of: pin attributes: - name: frequency-min - type: u64 - name: frequency-max - type: u64 operations: enum-name: dpll_cmd diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml index 837b565577ca..5c7a65b009b4 100644 --- a/Documentation/netlink/specs/ethtool.yaml +++ b/Documentation/netlink/specs/ethtool.yaml @@ -818,13 +818,10 @@ attribute-sets: attributes: - name: hist-bkt-low - type: u32 - name: hist-bkt-hi - type: u32 - name: hist-val - type: u64 - name: stats attributes: