From: Stephen Hemminger <stephen@networkplumber.org>
To: David Ahern <dsahern@gmail.com>
Cc: Arkadi Sharshevsky <arkadis@mellanox.com>,
netdev@vger.kernel.org, davem@davemloft.net, mlxsw@mellanox.com
Subject: Re: [PATCH iproute2] devlink: Ignore unknown attributes
Date: Fri, 19 Jan 2018 14:02:31 -0800 [thread overview]
Message-ID: <20180119140232.1191999c@xeon-e3> (raw)
In-Reply-To: <695fecfe-c45e-4a83-cee8-0476ee56d422@gmail.com>
On Thu, 18 Jan 2018 20:42:44 -0800
David Ahern <dsahern@gmail.com> wrote:
> On 1/17/18 5:28 AM, Arkadi Sharshevsky wrote:
> > In case of extending the UAPI old packages would break.
> >
> > Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
> > ---
> > devlink/devlink.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/devlink/devlink.c b/devlink/devlink.c
> > index 39cda06..c9d1838 100644
> > --- a/devlink/devlink.c
> > +++ b/devlink/devlink.c
> > @@ -343,7 +343,7 @@ static int attr_cb(const struct nlattr *attr, void *data)
> > int type;
> >
> > if (mnl_attr_type_valid(attr, DEVLINK_ATTR_MAX) < 0)
> > - return MNL_CB_ERROR;
> > + return MNL_CB_OK;
> >
> > type = mnl_attr_get_type(attr);
> > if (mnl_attr_validate(attr, devlink_policy[type]) < 0)
> >
>
> What's the point of calling mnl_attr_type_valid if you disregard a
> failure? you might as well not call mnl_attr_type_valid at all.
The way mnl handles attributes, you have to have a callback and it is up
to the callback to copy the values it wants. The idea is that old code
running against a newer kernel will have a smaller array of attributes
it wants, and only copy those.
next prev parent reply other threads:[~2018-01-19 22:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 13:28 [PATCH iproute2] devlink: Ignore unknown attributes Arkadi Sharshevsky
2018-01-17 13:37 ` Jiri Pirko
2018-01-19 0:32 ` Stephen Hemminger
2018-01-19 4:42 ` David Ahern
2018-01-19 22:02 ` Stephen Hemminger [this message]
2018-01-19 22:27 ` David Ahern
2018-01-19 23:40 ` Stephen Hemminger
2018-01-20 0:00 ` David Ahern
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=20180119140232.1191999c@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=arkadis@mellanox.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
/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).