All of lore.kernel.org
 help / color / mirror / Atom feed
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:10:53 +0100	[thread overview]
Message-ID: <20170209171053.GC2018@nanopsycho> (raw)
In-Reply-To: <1486657398-6298-2-git-send-email-ogerlitz@mellanox.com>

Thu, Feb 09, 2017 at 05:23:17PM CET, ogerlitz@mellanox.com wrote:
>From: Roi Dayan <roid@mellanox.com>
>
>This is an e-switch global knob to enable/disable HW support for applying
>encapsulation/decapsulation to VF traffic as part of SRIOV e-switch offloading.
>
>The actual encap/decap is carried out (along with the matching and other actions)
>per offloaded e-switch rules, e.g as done when offloading the TC tunnel key action.
>
>The supported mode are enable/disable.
>
>Signed-off-by: Roi Dayan <roid@mellanox.com>
>Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
>---

[...]

>@@ -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])
>+			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. Thanks.

  reply	other threads:[~2017-02-09 17:18 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 [this message]
     [not found]     ` <2ccce1b4-4407-fe66-847a-9159579fac27@mellanox.com>
2017-02-09 17:36       ` Jiri Pirko
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=20170209171053.GC2018@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.