Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753543Ab1D1CK5 (ORCPT ); Wed, 27 Apr 2011 22:10:57 -0400 Received: from exchange.solarflare.com ([216.237.3.220]:5887 "EHLO exchange.solarflare.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752652Ab1D1CKz (ORCPT ); Wed, 27 Apr 2011 22:10:55 -0400 Subject: Re: [PATCHv3 3/7] ethtool: Use the full 32 bit speed range in ethtool's set_settings From: Ben Hutchings To: David Decotigny Cc: "David S. Miller" , mirq-linux@rere.qmqm.pl, Stanislaw Gruszka , Alexander Duyck , Eilon Greenstein , Grant Grundler , e1000-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org In-Reply-To: <1303954043-17440-4-git-send-email-decot@google.com> References: <1303954043-17440-1-git-send-email-decot@google.com> <1303954043-17440-4-git-send-email-decot@google.com> Content-Type: text/plain; charset="UTF-8" Organization: Solarflare Date: Thu, 28 Apr 2011 03:10:50 +0100 Message-ID: <1303956650.3032.426.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Apr 2011 02:10:54.0940 (UTC) FILETIME=[817239C0:01CC0549] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.500.1024-18098.005 X-TM-AS-Result: No--12.359500-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1889 Lines: 52 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 Reviewed-by: Ben Hutchings *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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/