RE: [PATCH net] tools/net/ynl: fix cli.py --subscribe feature

From: Kubalewski, Arkadiusz
Date: Wed Sep 04 2024 - 09:59:11 EST


>From: Jakub Kicinski <kuba@xxxxxxxxxx>
>Sent: Wednesday, September 4, 2024 12:00 AM
>
>On Tue, 3 Sep 2024 22:08:54 +0100 Donald Hunter wrote:
>> > On Mon, 02 Sep 2024 10:51:13 +0100 Donald Hunter wrote:
>> > > Reviewed-by: Donald Hunter <donald.hunter@xxxxxxxxx>
>> >
>> > Any preference on passing self.rsp_by_value, vs .decode() accessing
>> > ynl.rsp_by_value on its own?
>>
>> .decode() accessing ynl.rsp_by_value would be cleaner, but I am
>> working on some notification fixes that might benefit from the map
>> being passed as a parameter. The netlink-raw families use a msg id
>> scheme that is neither unified nor directional. It's more like a mix
>> of both where req and rsp use different values but notifications reuse
>> the req values. I suspect that to fix that we'd need to introduce a
>> dict for ntf_by_value and then the parameter would be context
>> specific. OVS reuses req/rsp values for notifications as well, but it
>> uses a unified scheme, and that's mostly a problem for ynl-gen-c.
>
>I was worried you'd say it's ID reuse related. That is tricky business.
>
>> We could choose the cleaner approach just now and revisit it as part of
>> fixing notifications for netlink-raw?
>
>That's my intuition; there's a non-zero chance that priorities will
>change or we'll head in a different direction, and the extra arg will
>stick around confusing readers.

Sure, fixed in v2.

Thank you!
Arkadiusz