Re: [netmod] case + when in 8407bis
mohamed.boucad...@orange.com wrote: > Hi Martin, > > Please see inline. > > Cheers, > Med > > > -Message d'origine- > > De : Martin Björklund > > Envoyé : jeudi 14 décembre 2023 21:48 > > À : BOUCADAIR Mohamed INNOV/NET > > Cc : netmod@ietf.org > > Objet : Re: [netmod] case + when in 8407bis > > > > Hi, > > > > > > mohamed.boucad...@orange.com wrote: > > > Hi Martin, all, > > > > > > Please remember that RFC8407 includes already the following: > > > > > > == > > > "when" statement evaluation is generally more expensive than > > > "if-feature" or "choice" statements == > > > > Yes, this is fine. It is something that the module designer can > > keep in mind when designing the module (actually, the text says > > "MAY be considered"). > > > > [Med] ACK for the MAY part. However, that excerpt seems to implicitly > assume that either a "when" is present or "choice". At least this is > how I interpret that text. No? I don't think it should be interpreted that way. It basically says that *if* a model can be designed with "if-feature" or "choice" instead of (an expensive) "when", then it should be considered. It doesn't say anything about the combination of "when" and "choice". /martin ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
Re: [netmod] IEEE Std 802.1Qcw invalidates trivial YANG data tree
Hi Florian, Florian Kauer 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-t...@2023-01-26.yang > ietf-interfa...@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-bridge: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-bridge: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-bridge: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-bridge: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-bridge:bridge-port/ieee802-dot1q-sched-bridge:gate-parameter-table/supported-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 -- Ladislav Lhotka PGP Key ID: 0xB8F92B08A9F76C67 ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
[netmod] IEEE Std 802.1Qcw invalidates trivial YANG data tree
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-t...@2023-01-26.yang ietf-interfa...@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-bridge: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-bridge: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-bridge: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-bridge: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-bridge:bridge-port/ieee802-dot1q-sched-bridge:gate-parameter-table/supported-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! Greetings, Florian ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod