From: Jiri Pirko <jiri@resnulli.us>
To: Or Gerlitz <ogerlitz@mellanox.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jiri Pirko <jiri@mellanox.com>,
netdev@vger.kernel.org, Hadar Har-Zion <hadarh@mellanox.com>,
Roi Dayan <roid@mellanox.com>
Subject: Re: [PATCH net-next 1/2] net/devlink: Add E-Switch encapsulation control
Date: Thu, 9 Feb 2017 18:36:34 +0100 [thread overview]
Message-ID: <20170209173634.GD2018@nanopsycho> (raw)
In-Reply-To: <2ccce1b4-4407-fe66-847a-9159579fac27@mellanox.com>
Thu, Feb 09, 2017 at 06:20:14PM CET, ogerlitz@mellanox.com wrote:
>On 2/9/2017 7:10 PM, Jiri Pirko wrote:
>> > @@ -1470,11 +1480,23 @@ static int devlink_nl_cmd_eswitch_set_doit(struct sk_buff *skb,
>> > const struct devlink_ops *ops = devlink->ops;
>> > u16 mode;
>> > u8 inline_mode;
>> > + bool encap;
>> > int err = 0;
>> >
>> > if (!ops)
>> > return -EOPNOTSUPP;
>> >
>> > + if (info->attrs[DEVLINK_ATTR_ESWITCH_ENCAP]) {
>> > + if (!ops->eswitch_encap_set)
>> > + return -EOPNOTSUPP;
>> > + if (!info->attrs[DEVLINK_ATTR_ESWITCH_MODE])
Why you need to check this? Should be possible to set the attrs
separatelly.
>> > + return -EINVAL;
>> > + encap = nla_get_u8(info->attrs[DEVLINK_ATTR_ESWITCH_ENCAP]);
>> > + err = ops->eswitch_encap_set(devlink, encap);
>> > + if (err)
>> > + return err;
>> > + }
>> Please maintain the same order as the attr enum and getters and put this
>> behind the inline_mode.
>
>The HW driver might want to use the attributes only when they are called to
>change the eswitch mode.
I don't get it. Should be a separate attribute - separate op
>
>I see that the patch is not too consistent with setting the inline mode which
>is done after setting the eswitch mode, mmm, guess we need to fix that.
>
>Or.
>
>
>
next prev parent reply other threads:[~2017-02-09 17:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 16:23 [PATCH net-next 0/2] net/devlink: Add E-Switch encapsulation control Or Gerlitz
2017-02-09 16:23 ` [PATCH net-next 1/2] " Or Gerlitz
2017-02-09 17:10 ` Jiri Pirko
[not found] ` <2ccce1b4-4407-fe66-847a-9159579fac27@mellanox.com>
2017-02-09 17:36 ` Jiri Pirko [this message]
2017-02-09 16:23 ` [PATCH net-next 2/2] net/mlx5: E-Switch, Add control for encapsulation Or Gerlitz
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=20170209173634.GD2018@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=hadarh@mellanox.com \
--cc=jiri@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=roid@mellanox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.