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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1370875176.1933.2.camel@bwh-desktop.uk.level5networks.com>
Date:	Mon, 10 Jun 2013 15:39:36 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Or Gerlitz <ogerlitz@...lanox.com>
CC:	<davem@...emloft.net>, <netdev@...r.kernel.org>,
	<amirv@...lanox.com>, <ronye@...lanox.com>
Subject: Re: [PATCH V1 net-next 1/3] net/core: Add VF link state control

On Sun, 2013-06-09 at 16:27 +0300, Or Gerlitz wrote:
> From: Rony Efraim <ronye@...lanox.com>
> 
> Add netlink directives and ndo entry to allow for controling
> VF link, which can be in one of three states:
> 
> Auto - VF link state reflects the PF link state (default)
> 
> Up - VF link state is up, traffic from VF to VF works even if
> the actual PF link is down
> 
> Down - VF link state is down, no traffic from/to this VF, can be of
> use while configuring the VF
> 
> Signed-off-by: Rony Efraim <ronye@...lanox.com>
> Signed-off-by: Or Gerlitz <ogerlitz@...lanox.com>
[...]
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -947,6 +947,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
>  			struct ifla_vf_vlan vf_vlan;
>  			struct ifla_vf_tx_rate vf_tx_rate;
>  			struct ifla_vf_spoofchk vf_spoofchk;
> +			struct ifla_vf_link_state vf_linkstate;
>  
>  			/*
>  			 * Not all SR-IOV capable drivers support the

There's a bit missing here: you need to initialise ivi.linkstate to a
default value.  I'm not sure whether that should be
FLA_VF_LINK_STATE_AUTO (i.e. assume that's the default for all drivers/
hardware) or whether there should be an explicit 'unknown' value.

> @@ -961,13 +962,15 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
>  			vf_mac.vf =
>  				vf_vlan.vf =
>  				vf_tx_rate.vf =
> -				vf_spoofchk.vf = ivi.vf;
> +				vf_spoofchk.vf =
> +				vf_linkstate.vf = ivi.vf;
>  
>  			memcpy(vf_mac.mac, ivi.mac, sizeof(ivi.mac));
>  			vf_vlan.vlan = ivi.vlan;
>  			vf_vlan.qos = ivi.qos;
>  			vf_tx_rate.rate = ivi.tx_rate;
>  			vf_spoofchk.setting = ivi.spoofchk;
> +			vf_linkstate.link_state = ivi.linkstate;
>  			vf = nla_nest_start(skb, IFLA_VF_INFO);
>  			if (!vf) {
>  				nla_nest_cancel(skb, vfinfo);
[...]

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ