Subject: Re: [PATCH net-next v3 3/4] tools/net/ynl: Handle acks that use req_value

From: Jakub Kicinski <[email-masked]>
Date: Tue, 16 Apr 2024 19:10:16 -0700

On Tue, 16 Apr 2024 20:32:14 +0100 Donald Hunter wrote:
> The nfnetlink family uses the directional op model but errors get
> reported using the request value instead of the reply value.

What's an error in this case ? "Normal" errors come via NLMSG_ERROR

> diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py
> index 6d08ab9e213f..04085bc6365e 100644
> --- a/tools/net/ynl/lib/nlspec.py
> +++ b/tools/net/ynl/lib/nlspec.py
> @@ -567,6 +567,18 @@ class SpecFamily(SpecElement):
>            return op
>        return None
>  
> +    def get_op_by_value(self, value):
> +        """
> +        For a given operation value, look up operation spec. Search
> +        by response value first then fall back to request value. This
> +        is required for handling failure cases.

Looks like we're only going to need it in NetlinkProtocol, so that's
fine. But let's somehow call out that this is a bit of a hack, so that
people don't feel like this is the more correct way of finding the op
than direct access to rsp_by_value[].