Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6009496rwd; Mon, 5 Jun 2023 11:32:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Nkb5StwYGChyceIzxff1SxUstdjXl/ImaHdC4tOPYYPsO9pn2SOYgWVB+pdsaAy/CYXKi X-Received: by 2002:a05:6a20:258b:b0:110:f66c:a0e1 with SMTP id k11-20020a056a20258b00b00110f66ca0e1mr8375166pzd.14.1685989960934; Mon, 05 Jun 2023 11:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685989960; cv=none; d=google.com; s=arc-20160816; b=k64y0J+K4eAFBq52eCE9aWbGSUGDtknAJjKAflHSdMekW7gmnw3PlVc/6LZA7WIy6N UKdOTWb5rZlaU8GV9Nhqk0UJeEpB+F1IylS7GVGWeC8HgE6xL6obnKKJpwv2Z7rANEo/ vl4jKrvdQLH/NkQg4Kgvj2UXuxOtNAHDVu1EC2YD40FY8hZUu8ZmhJOYSiH5KNtDRf3Z zxUUiilweC9zLSlRuRpdFgFUs9OOhaj3kaZL2eKf6V1h8EwBQVATQ05uFam7kWHyUZkW fyukuRiNIcQ9a/d7/KR1ix2WeB+SEutvf+/pFR9wkosh0tjrRwr34wqnDX6VIdZ9ieLX f8SA== 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=S1Up+OI4cubE9uONpwupw77XJvrMwPf6ogDt4z2gWhQ=; b=klvXt3P1oznZtWo1h6dOK90/Nn6d1FtoDUkUyfep3MzQ7B3yMclJvDGMyzOUMMXjCV EWFX3vk0Fgg7lGwSHDbQ4u7QozFDTHuXq/Qz6NuTV6keqbpOV0gaB7iv3kHhu6kr2Lj/ mglg0pE3vEGgpN/AOoHR1cTyyfqLRrrqKBPK+vxvIfFxipuk5oMWQquvr3gmJp3nqiMa li2Sxpe7LNRczOnOwRCU7BUnQHtN8KFGuZzcj27xbAkFu52Ph4l7IyhRMpt7+UlbPMZW SaRZx9xtPVK4/chBPMQSrhHOyK524oc6fQWz1M3FCxx5V9ej2qRp26ku+PdWdHPuedU1 lERg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ho2ugw8D; 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 u70-20020a638549000000b005346e1b7614si5711360pgd.893.2023.06.05.11.32.28; Mon, 05 Jun 2023 11:32:40 -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=Ho2ugw8D; 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 S235690AbjFESHU (ORCPT + 99 others); Mon, 5 Jun 2023 14:07:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235543AbjFESHF (ORCPT ); Mon, 5 Jun 2023 14:07:05 -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 F41E010C0 for ; Mon, 5 Jun 2023 11:06:34 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CB3A4628F8 for ; Mon, 5 Jun 2023 18:06:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E17CAC433D2; Mon, 5 Jun 2023 18:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685988393; bh=140neydbH4NqzueFi/85G/gtjGnfr6/Oyl6MerHqEJU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ho2ugw8Dg07or4Fp1vy7jflDC1s+g84MnwRmDDKuGLEQbpTxvhPn5lsrmZTyKsD18 nqzwogkfebsMUdpKDyJ/jGyyfnpLb8j9OyJKBHGy28xtpT7a59QohfImK07jz9nPC1 AuBjAV1HON8TDCSyGs1qY7jNAFkihFTaZc8quFVfvjg7Ttd1oNBBVXlBQ1vZCO4Cox H5maUUFbo7YwAgZmMBHQ6mvbO6bTXu4ItY2cqKsWrVQTbzEAZlYXeTWulQ7WUHbPei rMvaDg2QC0FTXcFdwcb23Ahc6dX1fQ1crzYhS4d9pTsO5t7hefF9Z42N/DAYRgbSGG nClEkX1QwEvRA== Date: Mon, 5 Jun 2023 11:06:31 -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 66/69] ynl: fix nested policy attribute type Message-ID: <20230605110631.5a7d8074@kernel.org> In-Reply-To: <20230605094617.3564079-1-arkadiusz.kubalewski@intel.com> References: <20230605094617.3564079-1-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 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 Mon, 5 Jun 2023 11:46:17 +0200 Arkadiusz Kubalewski wrote: > When nested attribute is used, generated type in the netlink policy > is NLA_NEST, which is wrong as there is no such type. Fix be adding > `ed` sufix for policy generated for 'nest' type attribute. > > Signed-off-by: Arkadiusz Kubalewski > --- > tools/net/ynl/ynl-gen-c.py | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py > index 28afb0846143..89603866d4a0 100755 > --- a/tools/net/ynl/ynl-gen-c.py > +++ b/tools/net/ynl/ynl-gen-c.py > @@ -113,7 +113,10 @@ class Type(SpecAttr): > return '{ .type = ' + policy + ', }' > > def attr_policy(self, cw): > - policy = c_upper('nla-' + self.attr['type']) > + if (self.attr['type'] == 'nest'): > + policy = c_upper('nla-' + self.attr['type'] + 'ed') > + else: > + policy = c_upper('nla-' + self.attr['type']) > > spec = self._attr_policy(policy) > cw.p(f"\t[{self.enum_name}] = {spec},") For nests the policy should come from class TypeNest -> def _attr_policy() why do we need to tweak the default implementation in the parent class? -- pw-bot: cr