From patchwork Wed Jan 24 16:34:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alessandro Marcolini X-Patchwork-Id: 13529400 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18D254695 for ; Wed, 24 Jan 2024 16:34:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706114049; cv=none; b=NY2+1g8OImgUo0sXnXON3kxUGxChstyAtmL6i2JITIPRCDmIR59nCtwc84GxYKeGbSRkqt50nlzJYWYvvnbJw2NaijacsZlTpcQ2US3R3GmvVd+hcGlYNEPF+npqGPaJV8qv+sCX5CcRIL5hc959Zav1WhSBWVEItN8cQgTUutk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706114049; c=relaxed/simple; bh=lQMAy/f9Udne90iVLSsDeERnIiI8qYgWMPJGa8/iyBE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aiYIiQ1mNBAwDiEZtI2Nos4xvUXjW9xBifma7idjGD13KXI/kvDr/v2VUCfpbjQLLtFqrq00JDrnj2airwY6GbEGhtsKLjOzR1Jn2eHEx0djdb9HzI058X1yXw88V102h+TRH6bk9QB2f3B8YBHRcID24MR4u03b7i0LEe1EHU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dx+tgWBT; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dx+tgWBT" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-336c8ab0b20so5670109f8f.1 for ; Wed, 24 Jan 2024 08:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706114046; x=1706718846; 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=CQ9rTNQWPESh7A+uxAoeOiVeH94tU/eCSXNbM6rQtFo=; b=dx+tgWBTnOpAxuKo6XpXrizB9wBT7uDgKNz7ajkYs9yrCUhD1M78aBRMjTJg/xUkui bsrwY/Yir4otqueA3tWu19r/Btg3yTuxAs2G9HlYBpRY1rW1KnjHbcsbuD1KKd7KnmyJ PFnfB/r/27zhcu5G9LsC67tktWCyRO5n9lkJ9nrYR97/bgUi4cEZ48p532sSVnL83vD8 wwn9plcPCx9Yne9JINbB0551uF77gvqqKaoc2Tb3mEF5eRgVIn6gW2r5A64uNxxWtAqA NWcPWAGAHSVMXYgElxwl7tloIbz3P4HoMF2thwE9eNlLlwpUBuehSd0w0u7UxLIWEk0w krYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706114046; x=1706718846; 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=CQ9rTNQWPESh7A+uxAoeOiVeH94tU/eCSXNbM6rQtFo=; b=C3oA0Vd1f9hxTTpiw3vNsLGNy4YL3fNwOHtAcXs6AHfAnxKE7Z0/pT8zFz3FSHiPkp ajK/giYtTAKH1zNAq4S1LLXoYJMNLEZj0sbeVrfSO+Be1a8zGURKSTCtKMdUJPqUm1/g HhBYIO9s+xqBArJLU99fLiJY8oYv7IUllhf0yyx9+w9hCQKiZ6b6mWc33mGkb9Tt1QDl bdMoHE+W3Au4V9WEHBiC7TVBmTx3vY/AE9lPBOB134NWybWOqUSliMpbXVo1hU+YWuAh dOROdx4fXfhM/vjUy3oEwvwKGzJ+SobVo+7fFeYzxgWnLYhQ/PxkSByCnVD1GCeeVtSi P4xQ== X-Gm-Message-State: AOJu0YzlGhXOT7Ce/qC5DdgP1LnFFiVLLPqRnSaYfeg91zCIDND8fv/s REvXDEjbmMBhJAOJPqib4wfsEfWekt1OT8TSw1+Y8RkFxayMwZGO X-Google-Smtp-Source: AGHT+IGwGgnDSslzWr65giDH2wfSf2JL9mDf4pS6sfzoNzQkoFKgSfmb/wZy+3Ov6IrcQQHODkLH+w== X-Received: by 2002:adf:fd08:0:b0:337:be3b:dcb with SMTP id e8-20020adffd08000000b00337be3b0dcbmr638506wrr.126.1706114046215; Wed, 24 Jan 2024 08:34:06 -0800 (PST) Received: from fw.. (93-43-161-139.ip92.fastwebnet.it. [93.43.161.139]) by smtp.gmail.com with ESMTPSA id c11-20020a5d63cb000000b00337aed83aaasm19082866wrw.92.2024.01.24.08.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 08:34:05 -0800 (PST) From: Alessandro Marcolini To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, donald.hunter@gmail.com, sdf@google.com, chuck.lever@oracle.com, lorenzo@kernel.org, jacob.e.keller@intel.com, jiri@resnulli.us Cc: netdev@vger.kernel.org, Alessandro Marcolini Subject: [PATCH net-next 1/3] tools: ynl: correct typo and docstring Date: Wed, 24 Jan 2024 17:34:36 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Correct typo in SpecAttr docstring. Changed SpecSubMessageFormat docstring. Signed-off-by: Alessandro Marcolini --- tools/net/ynl/lib/nlspec.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py index 5d197a12ab8d..9c205022f8c0 100644 --- a/tools/net/ynl/lib/nlspec.py +++ b/tools/net/ynl/lib/nlspec.py @@ -144,7 +144,7 @@ class SpecEnumSet(SpecElement): class SpecAttr(SpecElement): - """ Single Netlink atttribute type + """ Single Netlink attribute type Represents a single attribute type within an attr space. @@ -308,10 +308,9 @@ class SpecSubMessage(SpecElement): class SpecSubMessageFormat(SpecElement): - """ Netlink sub-message definition - - Represents a set of sub-message formats for polymorphic nlattrs - that contain type-specific sub messages. + """ Netlink sub-message format definition + + Represents a single format for a sub-message. Attributes: value attribute value to match against type selector From patchwork Wed Jan 24 16:34:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alessandro Marcolini X-Patchwork-Id: 13529401 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAABB4695 for ; Wed, 24 Jan 2024 16:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706114053; cv=none; b=BeglyDQpPHbv9wEfsLOaueYpy01WO2mDQFpeZFv4qNQL6SOUCVI78TrdHXIW6LryyeLSXdhG6m4BAVRUnlal8Ve+gcc9z876xjafyPkCBnvPNVY/99KIfF6I7nY+moKDiR0U2TJht7VtAQS2eyWcuNFScFHJrT1NUdH8WzGveFY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706114053; c=relaxed/simple; bh=HCGI2ysO72BD98aEj1ZIcVN8Lqor1J8jBpFzCeiyU8o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qMtHEuJnmveb2SWiPBc8NJyiPlD75dmXHLQPu4Jj6rKfsjMLl42mU7MCoaKYRq4ypMrdyk+lwOLlv18pYiJrmor0LuQ038g4mmFwLGzdZ+dScyxnSQ/dilUw6aHFzgbGTRjg6GM3KVMSPGj8Qa6FchQpX0jpxphGFRqtDDQD5F4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N4UuPzvA; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N4UuPzvA" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40e60e137aaso62419665e9.0 for ; Wed, 24 Jan 2024 08:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706114050; x=1706718850; 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=Vxjjw7kWT9fxiWeBYhuayl1Pi23w8I8NIg2tr01+uqM=; b=N4UuPzvAOqyHVZxas48nI7OVPsIePe19Qza2D8QY8TIx8gQdifQDLJknkfULSNSIk1 dz2Al2Xb7rYNYK3mZtpnnS8MK55VMCshMrZb0TQ/jWSQx/GPLPSPVAoR5a0+A+fHYPJO 3oDxEwvZyqWcFF1qkS71xR6j0kcDSx8XB7AG/J8aSQc4VnJROc9R+EMyXo6fvfpxLjqU VtmKrvb3oHPbb3ggzphtC1sQ0ApVE1PSvuU3utadbbJ8h9pWblHPQTbPMEfkSnFgt0Do ZMNLbSJU/3Y4xNSJ5XVnjmNShI5pBK/wC/Jp4pkVuCcl8Q3NkoA49eyMyX8BO1UE10RT OyQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706114050; x=1706718850; 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=Vxjjw7kWT9fxiWeBYhuayl1Pi23w8I8NIg2tr01+uqM=; b=n7aW0KrKOHa9sayCoGQDEdTmIoW9coP6iXXBH2+5UiIu+Bq+GMYd2fgblJsd8JZD+4 x8DZBuKGjQTzYT79KKFwRe0WJFQnCBPPGqAHTMuLLuUZnMboCID+y8UQE1s1rM6Obcd+ wuoTPby3b5kBUaZvoyXZTInKbtJuFnjWiA8ZMG9MSzJ1uYOWcQjicUbZ1WgOKPdn7qqi /x5+/c5aD3q2pW8msw7Flm355yyBhbejZK6EWbhsICNbXjiMHf6jsJxUpJI2wNTCc92t 6C15nDnrSuUmRQEZ8fjR7890+IkWsmH5NZjn12b2fSrMtA1+zF62bLfNvN45ivYGYapd biuQ== X-Gm-Message-State: AOJu0YxHDFW73mrNvKa2dsIJwoE8XhxYwV0sfus258diuHvq9zVFEZO5 Dr9kgiiGjjhlOhH//kAgwvjHeabJJh+Sn48PUp5xhx0lOafADcsH X-Google-Smtp-Source: AGHT+IEQK9yk8a6xXWMQSx7Kz0QKUH+yEkfqPUQ0/mWYILH8zLqYgv2+q/0Xv7UNImUndvncs4qAMg== X-Received: by 2002:a05:600c:3f94:b0:40e:42ae:8872 with SMTP id fs20-20020a05600c3f9400b0040e42ae8872mr1637632wmb.118.1706114050058; Wed, 24 Jan 2024 08:34:10 -0800 (PST) Received: from fw.. (93-43-161-139.ip92.fastwebnet.it. [93.43.161.139]) by smtp.gmail.com with ESMTPSA id c11-20020a5d63cb000000b00337aed83aaasm19082866wrw.92.2024.01.24.08.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 08:34:09 -0800 (PST) From: Alessandro Marcolini To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, donald.hunter@gmail.com, sdf@google.com, chuck.lever@oracle.com, lorenzo@kernel.org, jacob.e.keller@intel.com, jiri@resnulli.us Cc: netdev@vger.kernel.org, Alessandro Marcolini Subject: [PATCH net-next 2/3] doc: netlink: specs: tc: add multi-attr to tc-taprio-sched-entry Date: Wed, 24 Jan 2024 17:34:37 +0100 Message-ID: <8d37a9994848af6c9230e39e7977b3612019a88f.1706112190.git.alessandromarcolini99@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add multi-attr attribute to tc-taprio-sched-entry to specify multiple entries. Signed-off-by: Alessandro Marcolini --- Documentation/netlink/specs/tc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/netlink/specs/tc.yaml b/Documentation/netlink/specs/tc.yaml index 4b21b00dbebe..0468070e7872 100644 --- a/Documentation/netlink/specs/tc.yaml +++ b/Documentation/netlink/specs/tc.yaml @@ -3375,6 +3375,7 @@ attribute-sets: - name: entry type: nest + multi-attr: true nested-attributes: tc-taprio-sched-entry - name: tc-taprio-sched-entry From patchwork Wed Jan 24 16:34:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alessandro Marcolini X-Patchwork-Id: 13529402 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AC6D433AD for ; Wed, 24 Jan 2024 16:34:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706114060; cv=none; b=M+jbx32Xui4p+lyOta8ErlQhUwEMF6ivlRutHmERS/PPhW/J7egPtfyx6E+4p8IdoY2dl1wNjPDAqm2szrqqp7n+PlGT+yB4X/0T36GCesKiopOF1Z711vkkd/vf92bWxcRYtECi7Zk4hjk7bigRu1iyh1bpfD4fHuQhXNbzRpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706114060; c=relaxed/simple; bh=KDmiXafVeOAS2XjwuncIc49P9RDSKqipQeu88/AZaMI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pSB1b+KY6hBdS5hN00chSZApOoOFLowYoe+eE3mCSZy3a9CtvWhAeKxQBie4ymVo9maP1h2xz7b4F8wqcDN3FLJmEE7SWGqb/16LLrgytigzsODjgHlKjkOcS/Jnbn9KKTg/pEdjQDWaI7oDPm8gTA4Wruz87uc3IVqtk0ZPJps= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hIf/s/KA; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hIf/s/KA" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40e775695c6so55262255e9.3 for ; Wed, 24 Jan 2024 08:34:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706114057; x=1706718857; 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=U2XubokNW8ReU7BjOg/NxC3mSlOCuSxN1FKMUPTov0A=; b=hIf/s/KA98+20Ov9CzNUclqQ8n2zTquYGwtG8Uq3dxGUQqGwc5srisoqWEExmV3Z0E /+po28/me8bojmzrd4seiNmCJOUo2vpVBK1pGw26KGBM1P3CuhAkhfcCJpcM4fyVb1vy jcXIIbSJdHxWb0dVeUUxlYlui4uUx0e44EdZyh1Rv2kJ0jRNyReO8KXgRNzq3qb9z1EC NXlaB1fExVWG4kTFIb7/95EjmA5TposrOf71ixoKFOobUR65rKlGtR7qtksAU+fq29ey t409wU5zm61saXX8kbhyacLL3mgSehXBQ7jpohhMJ9hVZDv1DagoUHvj2r4Q3Xqyi4Nl 4CAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706114057; x=1706718857; 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=U2XubokNW8ReU7BjOg/NxC3mSlOCuSxN1FKMUPTov0A=; b=KUa++K73uiqj1btEnkFRMf7PkQNjPmEjQVdefCIe4NNwp+WD2KD3BP7f6wB3tkKleO dXYxtyU3zVnsBJC7GLMvLk+KVSBhdUyWDew4in6/GJfuawjOKDiO5qzDvmtdFVF7D+FN AVqJYIVuUeyn1V6o1hx/wWJCTyc5EWKAAZ2GO79RzBQm0NV+b4HQ33L+yGkfWGPQwZXe zlM1xiH3aLgk3S2r9TPAXYFxKWf8W6fu4uz5K+u3R11zeeDq752fyboy339TKgVfnJp4 UsxYYoabBxIBtoJ9vv0LA1xucatDQ1fNCDfSX/6Bj0GY/+8oRr7gFqIduMY2Hs/mMndo TFHQ== X-Gm-Message-State: AOJu0YykwgHjWyom1y45sd0nPxXFZ0Yj605gi0ruKvTvJcW+Rus9rIPL zcN+iXfNVOZQnG7BSQIwE8Ogw9MGFr8pbjVeNRvPKRvllNKA/g6S X-Google-Smtp-Source: AGHT+IGE0wauiZGWntdcLvhA2viRURO7FOvHKoWyqT9xOoM6zV1o4rQcwJZtL24I0UviNTF9jRnGhg== X-Received: by 2002:a05:600c:a018:b0:40e:b4af:a189 with SMTP id jg24-20020a05600ca01800b0040eb4afa189mr2006707wmb.68.1706114057009; Wed, 24 Jan 2024 08:34:17 -0800 (PST) Received: from fw.. (93-43-161-139.ip92.fastwebnet.it. [93.43.161.139]) by smtp.gmail.com with ESMTPSA id c11-20020a5d63cb000000b00337aed83aaasm19082866wrw.92.2024.01.24.08.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 08:34:16 -0800 (PST) From: Alessandro Marcolini To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, donald.hunter@gmail.com, sdf@google.com, chuck.lever@oracle.com, lorenzo@kernel.org, jacob.e.keller@intel.com, jiri@resnulli.us Cc: netdev@vger.kernel.org, Alessandro Marcolini Subject: [PATCH net-next 3/3] tools: ynl: add support for encoding multi-attr Date: Wed, 24 Jan 2024 17:34:38 +0100 Message-ID: <803d08dd985ff7a97cb61e3156200a0c2f27536b.1706112190.git.alessandromarcolini99@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Multi-attr elements could not be encoded because of missing logic in the ynl code. Enable encoding of these attributes by checking if the nest attribute in the spec contains multi-attr attributes and if the value to be processed is a list. This has been tested both with the taprio and ets qdisc which contain this kind of attributes. Signed-off-by: Alessandro Marcolini --- tools/net/ynl/lib/ynl.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index dff2c042e6c3..bd01b1016fef 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -427,10 +427,18 @@ class YnlFamily(SpecFamily): if attr["type"] == 'nest': nl_type |= Netlink.NLA_F_NESTED attr_payload = b'' - subvals = ChainMap(value, vals) - for subname, subvalue in value.items(): - attr_payload += self._add_attr(attr['nested-attributes'], - subname, subvalue, subvals) + nested_attrs = self.attr_sets[attr['nested-attributes']].attrs + if any(a.is_multi for a in nested_attrs.values()) and isinstance(value, list): + for item in value: + subvals = ChainMap(item, vals) + for subname, subvalue in item.items(): + attr_payload += self._add_attr(attr['nested-attributes'], + subname, subvalue, subvals) + else: + subvals = ChainMap(value, vals) + for subname, subvalue in value.items(): + attr_payload += self._add_attr(attr['nested-attributes'], + subname, subvalue, subvals) elif attr["type"] == 'flag': attr_payload = b'' elif attr["type"] == 'string':