Re: [netmod] IEEE Std 802.1Qcw invalidates trivial YANG data tree

Don Fedyk <dfedyk@labn.net> Thu, 08 February 2024 22:25 UTC

Return-Path: <dfedyk@labn.net>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C48CFC1CAF7C for <netmod@ietfa.amsl.com>; Thu, 8 Feb 2024 14:25:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.908
X-Spam-Level:
X-Spam-Status: No, score=-6.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=labn.onmicrosoft.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZRarLFr0Yhpe for <netmod@ietfa.amsl.com>; Thu, 8 Feb 2024 14:25:11 -0800 (PST)
Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2109.outbound.protection.outlook.com [40.107.223.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F360DC14CEFC for <netmod@ietf.org>; Thu, 8 Feb 2024 14:25:10 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mSkAYwqxrdKbanYawkSgwHCsPhgK+G80Rmf0H7wpGy8n8Ja1b3vCm7tvaTM6VpMcDsV2D3cyuJmFS90MYWvv9g9KdAtCKMBJ0cFPZZSpmscg0fXAJ84QfN1+VKIumTQsCKwDtrpzbZguDhJFjbX+/WWueUbkIBNutDxP1I1rT3tzDZydOiTtf0/IPx08hgFhx3+7QtDoAaS5gdf3cr5VIXFoAy6Sd/LvIA1Sm3pCOz6a0gXkdsabhoSwR2X0GmYUHjFF6HgUFw0AWxPphMKQgbaa1cmN25evlb3X1H2BbpYOj4VxVH+Jj8toei22OVuBmYFNtmbjI85YESB4IGW9cQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mGxMcIffj96y9zA1FwWLJCAdApEfUijBKjH/DkfjWO8=; b=MFfo65j+FnwN0HQs4GGuMbcSXQccCT2bPX0nePd72hTBlg5+Eq48OEv9P0DV4OZFaNFyk+e7goDzyeIAI7LUYg/lhMxaYhrsm0SOl9bRTQlKmuGrZb6vnlydHEzhHNZGBLJcwcQ5kTv4zGMAN6MkoTncje7AluzhZqunyjqk6x3IB+b2xg9UcL28jOsBpKNUmz2GyoLlx4JdzW1M9yLocnVLb2X/SZ22x2FxWAUpZx4mQ47OREYXiZmimaDyl0Rs/3LOF0IGb9nySwlgN0IQGhrtkcfbZVKJH6t+dd8QaBjbZztZGIwUypXoHgaFXx6rcTrSNTgkSkXHNNTC3brvjw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labn.net; dmarc=pass action=none header.from=labn.net; dkim=pass header.d=labn.net; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=labn.onmicrosoft.com; s=selector2-labn-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mGxMcIffj96y9zA1FwWLJCAdApEfUijBKjH/DkfjWO8=; b=dYkue63CYzBc8r8dQunm9GN8+ddEh/5COW/RYWcEEwG1moGcoySskGqPNzr+mCRJY8PSvym3N4ZTmw9ihdAvgZbOj41zaGmu+CFNFA6SkVmr0GhRBj3YbF7QtOMnHPpKWmjkSKJ8/1TMKhzZDRXYL4zRYhrrkk7sb2I29Oc/7fo=
Received: from PH7PR14MB5368.namprd14.prod.outlook.com (2603:10b6:510:133::11) by CH2PR14MB3692.namprd14.prod.outlook.com (2603:10b6:610:6a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.38; Thu, 8 Feb 2024 22:25:06 +0000
Received: from PH7PR14MB5368.namprd14.prod.outlook.com ([fe80::2f3d:1744:a1b5:8c4c]) by PH7PR14MB5368.namprd14.prod.outlook.com ([fe80::2f3d:1744:a1b5:8c4c%4]) with mapi id 15.20.7270.024; Thu, 8 Feb 2024 22:25:05 +0000
From: Don Fedyk <dfedyk@labn.net>
To: Florian Kauer <florian.kauer@linutronix.de>, "marina.gutierrez.lopez@gmail.com" <marina.gutierrez.lopez@gmail.com>, "STDS-802-YANG@LISTSERV.IEEE.ORG" <STDS-802-YANG@LISTSERV.IEEE.ORG>, "netmod@ietf.org" <netmod@ietf.org>, "STDS-802-1-L@LISTSERV.IEEE.ORG" <STDS-802-1-L@LISTSERV.IEEE.ORG>
Thread-Topic: [netmod] IEEE Std 802.1Qcw invalidates trivial YANG data tree
Thread-Index: AQHaLzdMECjdR0IKsE2yHwfqRdTI47CqGT0AgFa/MoCAAIHioA==
Date: Thu, 08 Feb 2024 22:25:05 +0000
Message-ID: <PH7PR14MB5368EC30A9A5E49A217B63F0BB442@PH7PR14MB5368.namprd14.prod.outlook.com>
References: <b1897d44-dfad-45aa-8ecd-50bf24db35d1@linutronix.de> <87le9v7q57.fsf@nic.cz> <c698f79a-9b0f-44f7-9fe9-4d6951669c17@linutronix.de>
In-Reply-To: <c698f79a-9b0f-44f7-9fe9-4d6951669c17@linutronix.de>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=labn.net;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PH7PR14MB5368:EE_|CH2PR14MB3692:EE_
x-ms-office365-filtering-correlation-id: 05fcda43-ba8e-4527-82e6-08dc28f4cce1
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: IGNWEyFiQ1Sl58j5TJ+H028pJCjyiBOORZTgC8D8kfwSpRGi65GkvSxnKBJcf2IvCrwp1avNwuRk+EwzTYyVeQbcmwRGG/iOKZ2QFS6SyusLFBlPzmInqEjWoC8iJuiBDJOF8yItIGBcOGtI5Rp4WpeCMItID2e3iWuNCfaiQwe+r3+MAUyW6ZXcCtO8NaUvAFJE4NOYNCHrW7qCMy6DNljARVHkOuvhTokQy3aiOgybvdZHvgUVGD2tsYqIOPf7s2fWMmyV23OYdotFrv5P2fcCp7EsLobPyu98Adjd2CI3GoqIagJterrJMFMz8yNMU7kYs1QD2bYQrInNhzzpw7b4pprrBSgj1oEw7mh40I98i42sR/KjLiuClPSgh9cRGiJhUYyHZrlZZVfHycck724trgSPe0BTs78AS9SzX4A/fTvblNlpe14X9pM+HZXjoF/vJuiKxhVpHpI7ns7UR5Rj2CIE3Wd2nqFqr98S5JeCn6kna053B/SixwKOMkLOsuBKQW1Krn7GWTiDtanT67Tfyz9l5f3C+SDKMwUIIIyT0s839vowiZTj24MDzXEZ3geIgFmFCxlmOrrJMHA/XEdzL8o1nEXcgXXS/a4IQ5E=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR14MB5368.namprd14.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(376002)(136003)(366004)(39830400003)(396003)(230273577357003)(230922051799003)(186009)(64100799003)(1800799012)(451199024)(71200400001)(478600001)(41300700001)(66476007)(8676002)(38070700009)(8936002)(966005)(9686003)(6506007)(7696005)(53546011)(33656002)(26005)(52536014)(83380400001)(86362001)(66946007)(64756008)(316002)(66446008)(66556008)(110136005)(76116006)(2906002)(4001150100001)(5660300002)(38100700002)(122000001)(55016003); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: GemMBZqq9HVhPNeFHMoPdDyCXS+YPm7vKKh9SOYzyyP/DjuJCuPu7x9CUCZnMNjMpD31Z+JJ7fsiEJbG6qbuHI7UP4pScNUo33c/n2MacNaBWpUcMuS/uzvSs5j8jBH/DfMUW8DrLEWCtH3ja9lgwH3eTq2XruAVuMX5ib7DsICH255WxmX+yjG747b7dtUXpYkoGh1b2vigHPoTvl4mUPv1jRQLIsokVBG2wcR9KJlLIzUI0h6qjrYV66BgiZ35+6dkMbJYECpVnjDRaVercGzmlxbhN8zAXBzPA3/QdIUvvmuYZrAgywBrdDbHJMe0IZFIpx6oFEUf2nl9DfU6849XIqKqgzC3j7h2Yfo0W/IiFNbqk2k7XAcLfVUVNsItor2htltiLwOlwIQLbF+DDx24FBQs0jZnQ8XZfTYg7dtrd5FBjpVx+BEqdUcXeubMVeFkqEIq/c4UUOUyu7v77xITH/VeYr4c/sbmkyaTRn04g7RY1b9e7znjVFjX8RgAqlrp8lSt1I0AhMvhXMJoxelnVJFXmyOJ1wfMhNrCHgLLlICrLp3bOiA5viSi9RocM/7S/cdDShmaTai3ZenC3Qkkec7Cc5E7IBebCuFJ0cYZFDVyihF8+2tfYMxaf/K6fYGSpT+g3wB8RS/b5BLhWKr8PXqzlLDmHZJ+IGsmF4WY9xz1ROl2OSL3PFj4ypzTFd2HqG7vxHkncDNDWMdF6E/lF6hjonluFiaZRiL031VRmApygQ5Fl84EYHIc2/ACgoS+pI+8pFQ8h3tZxIJHN8dsldxuAt9mU7tVaHM837no8VjsgEa2QmrYDZSUvEJ9wiqtloZ0HGYs8czZ/8tI7Spsow6pyWaGBzf+Pb6u/T7CN8esqeRWP2pbjkLtfbY6zQVw+WZYmZq/Kdd6i8vSe8vrCGxA6Cbxhg933jHzfbrENSbmEaVVzF/DhjAJYRJ9AsoOwSNb2zycrkABljN9oqCbDZ7UQr1Xr9CgZie/KFicwwRavKol0TWx1tZcVbZ9N4UjUgyJJvGcYvPUVDN0A2o/jfWco/aIYyEImkBTv6Ym/GzkIzE0UU3c7G844obMEMr9cV/LvvQpIq5Zh08HS4a9f9OUh2/9dcdAcM5Vs/L+crB5QdcK8qYtidC6peqAvRObcOgMXtC7FlJ+3NSF7QktExzZbzJ6H6azME0SKQzqAqXllfTOHcSLtsvdmsKf8toVaF3/Zc95gcqR1ISIduZfCErKOJ+VaMSOiob8MSi0h9FAOkU83iBJd6T6IiWYDD20SIOa65CM6Eel8QERaVM9ubyklRFcJkzPVmUwEWEwS7SGJz6p61OEB5NiqhORhuQn3Ghzw/uxqirBiAd/Ukg2N4QrA6jzWRG0VWzMhDZ56qGfS+zC7ooK686u/KM6sVdse8pQlhV/b+0uijWWdrYeXQBoeMJd/f7/whjCzqRh709TxF4R6ddZpc9/HuVEHP+2SWqw7zliRxy4DP68jgdG75c9a6v+/0J/2Uarc57eI13W1w/4IVRqQhE2SO9hEL3rS/b2Gu+aYm8JBM2CexQlQxy7i50nuaJLfIkZGfQ=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: labn.net
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PH7PR14MB5368.namprd14.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 05fcda43-ba8e-4527-82e6-08dc28f4cce1
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Feb 2024 22:25:05.3966 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: eb60ac54-2184-4344-9b60-40c8b2b72561
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: BSL04Kk13tAtsjUMWPXBRZjZV27hggOISDgetdCqy0mXBfg+iVpzjxVEDV7e7TFEbigwBDmowzPSjISNyDI5CA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR14MB3692
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Rng5Aq9gGjfUSJnGvaYJvBJfgcw>
Subject: Re: [netmod] IEEE Std 802.1Qcw invalidates trivial YANG data tree
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 08 Feb 2024 22:25:12 -0000

Hi 

I'd suggest that the 802.1 Yangsters group should track this, and a 802.1 Maintenance item should be raised.  (those can proceed in parallel).  I had cautioned some 802.1 editors about the drawbacks of putting xpath conditions in YANG.  

Cheers,
Don    

-----Original Message-----
From: netmod <netmod-bounces@ietf.org> On Behalf Of Florian Kauer
Sent: Thursday, February 8, 2024 9:31 AM
To: marina.gutierrez.lopez@gmail.com; STDS-802-YANG@LISTSERV.IEEE.ORG; netmod@ietf.org; STDS-802-1-L@LISTSERV.IEEE.ORG
Subject: Re: [netmod] IEEE Std 802.1Qcw invalidates trivial YANG data tree

Hi,
thanks a lot Lada! This is exactly the change that fixes the issue (see below for the full diff) and with that we were able to use the YANG model in our implementation.
But what now, do we need a Corrigendum for IEEE 802.1Qcw-2023? What is the next step?

Greetings,
Florian

--- schemas/standard/ieee/published/802.1/ieee802-dot1q-sched.yang      2024-02-02 09:50:22.135503812 +0100
+++ ieee802-dot1q-sched@2024-01-30.yang 2024-02-02 14:54:24.290563673 
+++ +0100
@@ -33,6 +33,10 @@
     
     This version of this YANG module is part of IEEE Std 802.1Q; see the
     standard itself for full legal notices.";
+  revision 2024-01-30 {
+    description
+      "Draft for fixing incorrect must statements.";  }
   revision 2023-10-22 {
     description
       "Published as part of IEEE Std 802.1Qcw-2023.
@@ -77,7 +81,7 @@
       }
       refine "gate-control-entry/time-interval-value" {
         must
-          "(. <= ../../../supported-interval-max )";
+          "not (. > ../../../supported-interval-max )";
       }
       augment "gate-control-entry" {
         description
@@ -187,9 +191,9 @@
       }
       container admin-control-list {
         must
-          "(count(./gate-control-entry) <= ../supported-list-max)" {
+          "not(count(./gate-control-entry) > ../supported-list-max)" {
           error-message
-            "Number of elements in admin-control-list must not be greater"+
+            "Number of elements in admin-control-list must not be 
+ greater "+
             "than supported-list-max";
         }
         description
@@ -202,9 +206,9 @@
       }
       container oper-control-list {
         must
-          "(count(./gate-control-entry) <= ../supported-list-max)" {
+          "not(count(./gate-control-entry) > ../supported-list-max)" {
           error-message
-            "Number of elements in oper-control-list must not be greater"+
+            "Number of elements in oper-control-list must not be 
+ greater "+
             "than supported-list-max";
         }
         config false;
@@ -217,7 +221,7 @@
       }
       container admin-cycle-time {
         must
-          "(./numerator div ./denominator <= "+
+          "not (./numerator div ./denominator > "+
           "../supported-cycle-max/numerator div "+
           "../supported-cycle-max/denominator )" {
           error-message
@@ -235,7 +239,7 @@
       }
       container oper-cycle-time {
         must
-          "(./numerator div ./denominator <= "+
+          "not (./numerator div ./denominator > "+
           "../supported-cycle-max/numerator div "+
           "../supported-cycle-max/denominator )" {
           error-message


On 15.12.23 10:48, Ladislav Lhotka wrote:
> Hi Florian,
> 
> Florian Kauer <florian.kauer@linutronix.de> writes:
> 
>> Hi,
>> I know this is bad timing since Qcw was just published, but - at least with libyang - the following YANG data tree that specifies nothing Qcw related is no longer valid when just loading the Qcw YANG models:
>>
>> interface.json:
>> {
>>   "ietf-interfaces:interfaces": {
>>     "interface": [
>>       {
>>         "if-index": 1,
>>         "name": "eth0",
>>         "type": "iana-if-type:ethernetCsmacd",
>>         "oper-status": "down",
>>         "admin-status": "down",
>>         "statistics": {
>>           "discontinuity-time": "2023-12-15T10:04:12.345+00:00"
>>         }
>>       }
>>     ]
>>   }
>> }
>>
>> yanglint interface.json ieee802-dot1q-sched.yang 
>> ieee802-dot1q-sched-bridge.yang ieee802-types.yang 
>> ieee802-dot1q-types.yang ieee802-dot1q-bridge.yang 
>> iana-if-type@2023-01-26.yang ietf-interfaces@2018-02-20.yang
>>
>> results into
>>
>> libyang err : Number of elements in admin-control-list must not be 
>> greaterthan supported-list-max (Data location 
>> "/ietf-interfaces:interfaces/interface[name='eth0']/ieee802-dot1q-bri
>> dge:bridge-port/ieee802-dot1q-sched-bridge:gate-parameter-table/admin
>> -control-list".) libyang err : Number of elements in 
>> oper-control-list must not be greaterthan supported-list-max (Data 
>> location 
>> "/ietf-interfaces:interfaces/interface[name='eth0']/ieee802-dot1q-bri
>> dge:bridge-port/ieee802-dot1q-sched-bridge:gate-parameter-table/oper-
>> control-list".) libyang err : admin-cycle-time must not be greater 
>> than supported-cycle-max (Data location 
>> "/ietf-interfaces:interfaces/interface[name='eth0']/ieee802-dot1q-bri
>> dge:bridge-port/ieee802-dot1q-sched-bridge:gate-parameter-table/admin
>> -cycle-time".) libyang err : oper-cycle-time must not be greater than 
>> supported-cycle-max (Data location 
>> "/ietf-interfaces:interfaces/interface[name='eth0']/ieee802-dot1q-bri
>> dge:bridge-port/ieee802-dot1q-sched-bridge:gate-parameter-table/oper-
>> cycle-time".)
>> YANGLINT[E]: Failed to parse input data file "interface.json".
>>
>> My first expectation was a bug in libyang, but Michal is convinced that libyang's behavior is correct in this regard:
>> https://github.com/CESNET/libyang/issues/2140
>>
>> I have not enough experience in YANG to properly argue if either the 
>> YANG model or libyang needs to be changed, but I don't think we want 
>> to force every interface to specify a 
>> /ietf-interfaces:interfaces/interface[name='eth0']/ieee802-dot1q-brid
>> ge:bridge-port/ieee802-dot1q-sched-bridge:gate-parameter-table/suppor
>> ted-list-max etc. just because the Qcw YANG models are loaded.
>>
>> I hope I have just a misunderstanding and I am looking forward to your responses!
> 
> I am afraid I don't have good news. Apparently, the problem is in this "must" statement:
> 
> must
>   "(count(./gate-control-entry) <= ../supported-list-max)" {
>   error-message
>     "Number of elements in admin-control-list must not be greater"+
>     "than supported-list-max";
> }
> 
> The Xpath expression can never be true unless the "../supported-list-max" leaf exists. This is a common XPath trap, it should have been written like so:
> 
>   "not(count(./gate-control-entry) > ../supported-list-max)"
> 
> This would be true also in the case when "../supported-list-max" doesn't exist.
> 
> Lada
> 
>>
>> Greetings,
>> Florian
>>
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod
> 

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod