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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 28 Feb 2012 15:45:00 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Giuseppe CAVALLARO <peppe.cavallaro@...com>
CC:	<netdev@...r.kernel.org>
Subject: Re: [PATCH 2/4] net: ethtool: add the EEE support

On Tue, 2012-02-28 at 13:44 +0100, Giuseppe CAVALLARO wrote:
> This patch adds two new functions to detect if Energy-Efficient
> Ethernet (EEE) is supported and the way to enable/disable it.
> 
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@...com>
> ---
>  include/linux/ethtool.h |    7 +++++++
>  net/core/ethtool.c      |   32 ++++++++++++++++++++++++++++++++
>  2 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index da5b2de..fdea3c7 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -43,6 +43,7 @@ struct ethtool_cmd {
>  	__u8	eth_tp_mdix;
>  	__u8	reserved2;
>  	__u32	lp_advertising;	/* Features the link partner advertises */
> +	__u32	eee;		/* Energy-Efficient Etehrnet */
>  	__u32	reserved[2];
>  };

You can't change the size of this structure.

> @@ -874,6 +875,8 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
>   * 		   and flag of the device.
>   * @get_dump_data: Get dump data.
>   * @set_dump: Set dump specific flags to the device.
> + * @get_eee: Get Energy-Efficient Ethernet (EEE) supported and status.
> + * @set_eee: Set EEE status (enable/disable).
>   *
>   * All operations are optional (i.e. the function pointer may be set
>   * to %NULL) and callers must take this into account.  Callers must
> @@ -937,6 +940,8 @@ struct ethtool_ops {
>  				 struct ethtool_dump *, void *);
>  	int	(*set_dump)(struct net_device *, struct ethtool_dump *);
>  
> +	int	(*get_eee) (struct net_device *, struct ethtool_value *);
> +	int	(*set_eee) (struct net_device *, struct ethtool_value *);
[...]

Why are there new operations as well as a new field to ethtool_cmd?

Is the value a boolean or a bitmask?

Since EEE is an auto-negotiated feature, why aren't you defining flags
for the supported/advertising/lp_advertising fields?

Ben.

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