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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 28 Jun 2010 10:45:57 -0700
From:	Shreyas Bhatewara <sbhatewara@...are.com>
To:	Stanislaw Gruszka <sgruszka@...hat.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	Amerigo Wang <amwang@...hat.com>
Subject: RE: [PATCH -next] vmxnet3: fail when try to setup unsupported
 features

> -----Original Message-----
> From: Stanislaw Gruszka [mailto:sgruszka@...hat.com]
> Sent: Monday, June 28, 2010 2:30 AM
> To: netdev@...r.kernel.org
> Cc: Amerigo Wang; Shreyas Bhatewara
> Subject: [PATCH -next] vmxnet3: fail when try to setup unsupported
> features
> 
> Return EOPNOTSUPP in ethtool_ops->set_flags.
> 
> Fix coding style while at it.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@...hat.com>
> ---
>  drivers/net/vmxnet3/vmxnet3_ethtool.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c
> b/drivers/net/vmxnet3/vmxnet3_ethtool.c
> index 3935c44..8a71a21 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
> @@ -276,16 +276,21 @@ vmxnet3_get_strings(struct net_device *netdev,
> u32 stringset, u8 *buf)
>  }
> 
>  static u32
> -vmxnet3_get_flags(struct net_device *netdev) {
> +vmxnet3_get_flags(struct net_device *netdev)
> +{
>  	return netdev->features;
>  }
> 
>  static int
> -vmxnet3_set_flags(struct net_device *netdev, u32 data) {
> +vmxnet3_set_flags(struct net_device *netdev, u32 data)
> +{
>  	struct vmxnet3_adapter *adapter = netdev_priv(netdev);
>  	u8 lro_requested = (data & ETH_FLAG_LRO) == 0 ? 0 : 1;
>  	u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1;
> 
> +	if (data & ~ETH_FLAG_LRO)
> +		return -EOPNOTSUPP;
> +
>  	if (lro_requested ^ lro_present) {
>  		/* toggle the LRO feature*/
>  		netdev->features ^= NETIF_F_LRO;
> --
> 1.5.5.6


Does not make sense to me. Switching LRO on/off is supported from the driver, why should the function return -EOPNOTSUPP ?

->Shreyas
--
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