From: Donald Hunter <donald.hunter@gmail.com>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, jiri@resnulli.us,
jacob.e.keller@intel.com, liuhangbin@gmail.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] tools/net/ynl: fix cli.py --subscribe feature
Date: Mon, 02 Sep 2024 10:51:13 +0100 [thread overview]
Message-ID: <m2mskq2xke.fsf@gmail.com> (raw)
In-Reply-To: <20240830201321.292593-1-arkadiusz.kubalewski@intel.com> (Arkadiusz Kubalewski's message of "Fri, 30 Aug 2024 22:13:21 +0200")
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> writes:
> Execution of command:
> ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml /
> --subscribe "monitor" --sleep 10
> fails with:
> File "/repo/./tools/net/ynl/cli.py", line 109, in main
> ynl.check_ntf()
> File "/repo/tools/net/ynl/lib/ynl.py", line 924, in check_ntf
> op = self.rsp_by_value[nl_msg.cmd()]
> KeyError: 19
>
> Parsing Generic Netlink notification messages performs lookup for op in
> the message. The message was not yet decoded, and is not yet considered
> GenlMsg, thus msg.cmd() returns Generic Netlink family id (19) instead of
> proper notification command id (i.e.: DPLL_CMD_PIN_CHANGE_NTF=13).
>
> Allow the op to be obtained within NetlinkProtocol.decode(..) itself if the
> op was not passed to the decode function, thus allow parsing of Generic
> Netlink notifications without causing the failure.
>
> Suggested-by: Donald Hunter <donald.hunter@gmail.com>
> Link: https://lore.kernel.org/netdev/m2le0n5xpn.fsf@gmail.com/
> Fixes: 0a966d606c68 ("tools/net/ynl: Fix extack decoding for directional ops")
> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
next prev parent reply other threads:[~2024-09-02 10:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 20:13 [PATCH net] tools/net/ynl: fix cli.py --subscribe feature Arkadiusz Kubalewski
2024-09-02 9:51 ` Donald Hunter [this message]
2024-09-03 20:01 ` Jakub Kicinski
2024-09-03 21:08 ` Donald Hunter
2024-09-03 22:00 ` Jakub Kicinski
2024-09-04 13:57 ` Kubalewski, Arkadiusz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2mskq2xke.fsf@gmail.com \
--to=donald.hunter@gmail.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).