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]
Message-ID: <1303956650.3032.426.camel@localhost>
Date:	Thu, 28 Apr 2011 03:10:50 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	David Decotigny <decot@...gle.com>
Cc:	"David S. Miller" <davem@...emloft.net>, mirq-linux@...e.qmqm.pl,
	Stanislaw Gruszka <sgruszka@...hat.com>,
	Alexander Duyck <alexander.h.duyck@...el.com>,
	Eilon Greenstein <eilong@...adcom.com>,
	Grant Grundler <grundler@...isc-linux.org>,
	e1000-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org
Subject: Re: [PATCHv3 3/7] ethtool: Use the full 32 bit speed range in
 ethtool's set_settings

On Wed, 2011-04-27 at 18:27 -0700, David Decotigny wrote:
> This makes sure the ethtool's set_settings() callback of network
> drivers don't ignore the 16 most significant bits when ethtool calls
> their set_settings().
> 
> All drivers compiled with make allyesconfig on x86_64 have been
> updated.
> 
> Tested: make allyesconfig compiles + e1000e and bnx2x work
> Signed-off-by: David Decotigny <decot@...gle.com>
Reviewed-by: Ben Hutchings <bhutchings@...arflare.com>

*But* this and patch 4 should be applied in the opposite order, so that
this doesn't break:

[...]
> diff --git a/drivers/net/pch_gbe/pch_gbe_ethtool.c b/drivers/net/pch_gbe/pch_gbe_ethtool.c
> index c35d105..21a2a04 100644
> --- a/drivers/net/pch_gbe/pch_gbe_ethtool.c
> +++ b/drivers/net/pch_gbe/pch_gbe_ethtool.c
> @@ -109,12 +109,15 @@ static int pch_gbe_set_settings(struct net_device *netdev,
>  {
>  	struct pch_gbe_adapter *adapter = netdev_priv(netdev);
>  	struct pch_gbe_hw *hw = &adapter->hw;
> +	u32 speed = ethtool_cmd_speed(ecmd);
>  	int ret;
>  
>  	pch_gbe_hal_write_phy_reg(hw, MII_BMCR, BMCR_RESET);
>  
> -	if (ecmd->speed == USHRT_MAX) {
> -		ecmd->speed = SPEED_1000;
> +	/* when set_settings() is called with a ethtool_cmd previously
> +	 * filled by get_settings() on a down link, speed is -1: */
> +	if (speed == UINT_MAX) {
> +		speed = SPEED_1000;
>  		ecmd->duplex = DUPLEX_FULL;
>  	}
>  	ret = mii_ethtool_sset(&adapter->mii, ecmd);
[...]

Ben.

-- 
Ben Hutchings, Senior Software 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 linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ