lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170209171053.GC2018@nanopsycho>
Date:   Thu, 9 Feb 2017 18:10:53 +0100
From:   Jiri Pirko <jiri@...nulli.us>
To:     Or Gerlitz <ogerlitz@...lanox.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jiri Pirko <jiri@...lanox.com>, netdev@...r.kernel.org,
        Hadar Har-Zion <hadarh@...lanox.com>,
        Roi Dayan <roid@...lanox.com>
Subject: Re: [PATCH net-next 1/2] net/devlink: Add E-Switch encapsulation
 control

Thu, Feb 09, 2017 at 05:23:17PM CET, ogerlitz@...lanox.com wrote:
>From: Roi Dayan <roid@...lanox.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@...lanox.com>
>Reviewed-by: Or Gerlitz <ogerlitz@...lanox.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ