Netdev List
 help / color / mirror / Atom feed
* Re: NETIF_F_TSO vs NETIF_F_TSO{6,_ECN}
From: Ben Hutchings @ 2011-04-05 18:31 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: netdev, Herbert Xu
In-Reply-To: <20110405180337.GA16977@rere.qmqm.pl>

On Tue, 2011-04-05 at 20:03 +0200, Michał Mirosław wrote:
> On Tue, Apr 05, 2011 at 04:50:02PM +0100, Ben Hutchings wrote:
> > According to the commit that introduced NETIF_F_TSO6
> > (f83ef8c0b58dac17211a4c0b6df0e2b1bd6637b1):
> >     
> >         This patch will introduce a new flag NETIF_F_TSO6 which will be used
> >         to check whether device supports TSO over IPv6. If device support TSO
> >         over IPv6 then we don't clear of NETIF_F_TSO and which will make the
> >         TCP layer to create TSO packets. Any device supporting TSO over IPv6
> >         will set NETIF_F_TSO6 flag in "dev->features" along with NETIF_F_TSO.
> >     
> >         In case when user disables TSO using ethtool, NETIF_F_TSO will get
> >         cleared from "dev->features". So even if we have NETIF_F_TSO6 we don't
> >         get TSO packets created by TCP layer.
> > 
> > So I think we need to either:
> > 1. Disallow toggling NETIF_F_TSO6 (following the previous rule)
> > 2. Disable NETIF_F_TSO6 when NETIF_F_TSO is disabled
> > 
> > The same presumably applies to NETIF_F_TSO_ECN.
> 
> There seems to be no such dependency in the networking code. I.e. TSO6
> should just work with TSO4 disabled.

*sigh*  So it seems the commit message was wrong... and it should have
included a change like this:

--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5203,9 +5203,9 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
 	}
 
 	/* TSO requires that SG is present as well. */
-	if ((features & NETIF_F_TSO) && !(features & NETIF_F_SG)) {
-		netdev_info(dev, "Dropping NETIF_F_TSO since no SG feature.\n");
-		features &= ~NETIF_F_TSO;
+	if ((features & NETIF_F_ALL_TSO) && !(features & NETIF_F_SG)) {
+		netdev_info(dev, "Dropping TSO since no SG feature.\n");
+		features &= ~NETIF_F_ALL_TSO;
 	}
 
 	/* Software GSO depends on SG. */
---

Now that we're relying on these checks for dynamic changes to features,
this is pretty important.

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.


^ permalink raw reply

* Re: [PATCHv2 net-next-2.6 3/7] sfc: Implement generic features interface
From: Michał Mirosław @ 2011-04-05 18:29 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Miller, netdev, linux-net-drivers
In-Reply-To: <1302027640.2932.70.camel@bwh-desktop>

On Tue, Apr 05, 2011 at 07:20:40PM +0100, Ben Hutchings wrote:
> On Tue, 2011-04-05 at 20:15 +0200, Michał Mirosław wrote:
> > On Tue, Apr 05, 2011 at 07:03:29PM +0100, Ben Hutchings wrote:
> > > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> > > ---
> > >  drivers/net/sfc/efx.c        |   20 +++++++++--
> > >  drivers/net/sfc/ethtool.c    |   78 ------------------------------------------
> > >  drivers/net/sfc/net_driver.h |    2 -
> > >  drivers/net/sfc/rx.c         |    2 +-
> > >  4 files changed, 18 insertions(+), 84 deletions(-)
> > > 
> > > diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
> > > index 542f32d..db72a6e 100644
> > > --- a/drivers/net/sfc/efx.c
> > > +++ b/drivers/net/sfc/efx.c
> > [...]
> > > @@ -2452,12 +2463,15 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
> > >  		return -ENOMEM;
> > >  	net_dev->features |= (type->offload_features | NETIF_F_SG |
> > >  			      NETIF_F_HIGHDMA | NETIF_F_TSO |
> > > -			      NETIF_F_GRO);
> > > +			      NETIF_F_RXCSUM);
> > >  	if (type->offload_features & NETIF_F_V6_CSUM)
> > >  		net_dev->features |= NETIF_F_TSO6;
> > >  	/* Mask for features that also apply to VLAN devices */
> > >  	net_dev->vlan_features |= (NETIF_F_ALL_CSUM | NETIF_F_SG |
> > > -				   NETIF_F_HIGHDMA | NETIF_F_ALL_TSO);
> > > +				   NETIF_F_HIGHDMA | NETIF_F_ALL_TSO |
> > > +				   NETIF_F_RXCSUM);
> > > +	/* All offloads can be toggled */
> > > +	net_dev->hw_features = net_dev->features & ~NETIF_F_HIGHDMA;
> > >  	efx = netdev_priv(net_dev);
> > >  	pci_set_drvdata(pci_dev, efx);
> > >  	SET_NETDEV_DEV(net_dev, &pci_dev->dev);
> > 
> > Does the driver really allow independent switching of RX checksumming
> > for tagged and untagged frames?
> 
> No.
> 
> > The VLAN code currently doesn't ignore
> > HW checksum when present in skb and doesn't allow toggling of the feature
> > (see: vlan_fix_features() and vlan_skb_recv() in net/8021q/vlan_dev.c).
> So RX checksum offload is reported as enabled on the VLAN device iff it
> is enabled for the physical device, which is correct.

Exactly.

What I wanted to point out is that NETIF_F_RXCSUM is set (or cleared) for
VLAN devices regardless if it is set in vlan_features. It would be cleaner
to not allow it in vlan_features because it's currently not inherited like
other features.

Best Regards,
Michał Mirosław

^ permalink raw reply

* Re: [PATCH 00/34] Make kernel build deterministic
From: Mauro Carvalho Chehab @ 2011-04-05 18:29 UTC (permalink / raw)
  To: James Bottomley
  Cc: anil_ravindranath, benh, x86, mac, aacraid, linux-mtd,
	allan.stephens, hpa, netdev, t.sailer, gwingerde, IvDoorn, elf,
	cluster-devel, ccaulfie, mingo, dougthompson, linux-media,
	jon.maloy, arnaud.giersch, linux-kbuild, teigland, tony.olech,
	apw, linux-hams, tglx, swhiteho, linux-arm-kernel, linux-edac,
	Michal Marek, linux-scsi, linuxppc-dev, Greg KH, linux-wireless,
	linux-kernel
In-Reply-To: <1302027412.2924.7.camel@mulgrave.site>

Em 05-04-2011 15:16, James Bottomley escreveu:
> On Tue, 2011-04-05 at 08:49 -0700, Greg KH wrote:
>> On Tue, Apr 05, 2011 at 04:58:47PM +0200, Michal Marek wrote:
>>>
>>> Hi,
>>>
>>> this series makes it possible to build bit-identical kernel image and
>>> modules from identical sources. Of course the build is already
>>> deterministic in terms of behavior of the code, but the various
>>> timestamps embedded in the object files make it hard to compare two
>>> builds, for instance to verify that a makefile cleanup didn't
>>> accidentally change something. A prime example is /proc/config.gz, which
>>> has both a timestamp in the gzip header and a timestamp in the payload
>>> data. With this series applied, a script like this will produce
>>> identical kernels each time:
>>
>> Very nice stuff.  Do you want to take the individual patches through one
>> of your trees, or do you mind if the subsystem maintainers take them
>> through theirs?
> 
> I'm happy for this to go through a single tree.

Me too.

With respect to the patches I was c/c (patches 13, 14, 31):

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Thanks,
Mauro.

^ permalink raw reply

* Re: [PATCHv2 net-next-2.6 3/7] sfc: Implement generic features interface
From: Ben Hutchings @ 2011-04-05 18:20 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: David Miller, netdev, linux-net-drivers
In-Reply-To: <20110405181552.GB16977@rere.qmqm.pl>

On Tue, 2011-04-05 at 20:15 +0200, Michał Mirosław wrote:
> On Tue, Apr 05, 2011 at 07:03:29PM +0100, Ben Hutchings wrote:
> > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> > ---
> >  drivers/net/sfc/efx.c        |   20 +++++++++--
> >  drivers/net/sfc/ethtool.c    |   78 ------------------------------------------
> >  drivers/net/sfc/net_driver.h |    2 -
> >  drivers/net/sfc/rx.c         |    2 +-
> >  4 files changed, 18 insertions(+), 84 deletions(-)
> > 
> > diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
> > index 542f32d..db72a6e 100644
> > --- a/drivers/net/sfc/efx.c
> > +++ b/drivers/net/sfc/efx.c
> [...]
> > @@ -2452,12 +2463,15 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
> >  		return -ENOMEM;
> >  	net_dev->features |= (type->offload_features | NETIF_F_SG |
> >  			      NETIF_F_HIGHDMA | NETIF_F_TSO |
> > -			      NETIF_F_GRO);
> > +			      NETIF_F_RXCSUM);
> >  	if (type->offload_features & NETIF_F_V6_CSUM)
> >  		net_dev->features |= NETIF_F_TSO6;
> >  	/* Mask for features that also apply to VLAN devices */
> >  	net_dev->vlan_features |= (NETIF_F_ALL_CSUM | NETIF_F_SG |
> > -				   NETIF_F_HIGHDMA | NETIF_F_ALL_TSO);
> > +				   NETIF_F_HIGHDMA | NETIF_F_ALL_TSO |
> > +				   NETIF_F_RXCSUM);
> > +	/* All offloads can be toggled */
> > +	net_dev->hw_features = net_dev->features & ~NETIF_F_HIGHDMA;
> >  	efx = netdev_priv(net_dev);
> >  	pci_set_drvdata(pci_dev, efx);
> >  	SET_NETDEV_DEV(net_dev, &pci_dev->dev);
> 
> Does the driver really allow independent switching of RX checksumming
> for tagged and untagged frames?

No.

> The VLAN code currently doesn't ignore
> HW checksum when present in skb and doesn't allow toggling of the feature
> (see: vlan_fix_features() and vlan_skb_recv() in net/8021q/vlan_dev.c).

So RX checksum offload is reported as enabled on the VLAN device iff it
is enabled for the physical device, which is correct.

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.


^ permalink raw reply

* Re: mourning the loss of David Brownell
From: Bill Gatliff @ 2011-04-05 18:17 UTC (permalink / raw)
  To: Alan Stern
  Cc: Greg KH, Kernel development list, USB list, linux-omap,
	spi-devel-general, netdev
In-Reply-To: <Pine.LNX.4.44L0.1104051350480.1972-100000@iolanthe.rowland.org>

Guys:


David Brownell unknowingly inspired me to get involved in Linux as a
profession.  I saw him as an individual working successfully on Free
and Open Software, and have made an effort to emulate his success for
over a decade now.

I deeply regret never taking the time to meet and thank him in person.


b.g.
-- 
Bill Gatliff
bgat@billgatliff.com

^ permalink raw reply

* Re: [PATCH 00/34] Make kernel build deterministic
From: James Bottomley @ 2011-04-05 18:16 UTC (permalink / raw)
  To: Greg KH
  Cc: anil_ravindranath, mchehab, benh, x86, mac, aacraid, linux-mtd,
	allan.stephens, hpa, netdev, t.sailer, gwingerde, IvDoorn, elf,
	cluster-devel, ccaulfie, mingo, dougthompson, linux-media,
	jon.maloy, arnaud.giersch, linux-kbuild, teigland, tony.olech,
	apw, linux-hams, tglx, swhiteho, linux-arm-kernel, linux-edac,
	Michal Marek, linux-scsi, linuxppc-dev, linux-usb, linux-wireless,
	linux-ker
In-Reply-To: <20110405154918.GA31337@suse.de>

On Tue, 2011-04-05 at 08:49 -0700, Greg KH wrote:
> On Tue, Apr 05, 2011 at 04:58:47PM +0200, Michal Marek wrote:
> > 
> > Hi,
> > 
> > this series makes it possible to build bit-identical kernel image and
> > modules from identical sources. Of course the build is already
> > deterministic in terms of behavior of the code, but the various
> > timestamps embedded in the object files make it hard to compare two
> > builds, for instance to verify that a makefile cleanup didn't
> > accidentally change something. A prime example is /proc/config.gz, which
> > has both a timestamp in the gzip header and a timestamp in the payload
> > data. With this series applied, a script like this will produce
> > identical kernels each time:
> 
> Very nice stuff.  Do you want to take the individual patches through one
> of your trees, or do you mind if the subsystem maintainers take them
> through theirs?

I'm happy for this to go through a single tree.

James

^ permalink raw reply

* Re: [PATCHv2 net-next-2.6 3/7] sfc: Implement generic features interface
From: Michał Mirosław @ 2011-04-05 18:15 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Miller, netdev, linux-net-drivers
In-Reply-To: <1302026609.2932.59.camel@bwh-desktop>

On Tue, Apr 05, 2011 at 07:03:29PM +0100, Ben Hutchings wrote:
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
>  drivers/net/sfc/efx.c        |   20 +++++++++--
>  drivers/net/sfc/ethtool.c    |   78 ------------------------------------------
>  drivers/net/sfc/net_driver.h |    2 -
>  drivers/net/sfc/rx.c         |    2 +-
>  4 files changed, 18 insertions(+), 84 deletions(-)
> 
> diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
> index 542f32d..db72a6e 100644
> --- a/drivers/net/sfc/efx.c
> +++ b/drivers/net/sfc/efx.c
[...]
> @@ -2452,12 +2463,15 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
>  		return -ENOMEM;
>  	net_dev->features |= (type->offload_features | NETIF_F_SG |
>  			      NETIF_F_HIGHDMA | NETIF_F_TSO |
> -			      NETIF_F_GRO);
> +			      NETIF_F_RXCSUM);
>  	if (type->offload_features & NETIF_F_V6_CSUM)
>  		net_dev->features |= NETIF_F_TSO6;
>  	/* Mask for features that also apply to VLAN devices */
>  	net_dev->vlan_features |= (NETIF_F_ALL_CSUM | NETIF_F_SG |
> -				   NETIF_F_HIGHDMA | NETIF_F_ALL_TSO);
> +				   NETIF_F_HIGHDMA | NETIF_F_ALL_TSO |
> +				   NETIF_F_RXCSUM);
> +	/* All offloads can be toggled */
> +	net_dev->hw_features = net_dev->features & ~NETIF_F_HIGHDMA;
>  	efx = netdev_priv(net_dev);
>  	pci_set_drvdata(pci_dev, efx);
>  	SET_NETDEV_DEV(net_dev, &pci_dev->dev);

Does the driver really allow independent switching of RX checksumming
for tagged and untagged frames? The VLAN code currently doesn't ignore
HW checksum when present in skb and doesn't allow toggling of the feature
(see: vlan_fix_features() and vlan_skb_recv() in net/8021q/vlan_dev.c).

Best Regards,
Michał Mirosław

^ permalink raw reply

* Re: mourning the loss of David Brownell
From: Alan Stern @ 2011-04-05 18:10 UTC (permalink / raw)
  To: Greg KH
  Cc: Kernel development list, USB list, linux-omap, spi-devel-general,
	netdev
In-Reply-To: <20110405034819.GA7872@kroah.com>

On Mon, 4 Apr 2011, Greg KH wrote:

> As I have seen this tangentally mentioned already a few times
> publically, I figured it warranted it's own announcement now.
> 
> Linux has lost a great developer with the passing of David Brownell
> recently and he will be greatly missed.

David made contributions to a large number of areas in the Linux
kernel.  Even a quick look through MAINTAINERS will show that he worked
on USB controllers (OHCI, EHCI, OMAP and others), USB gadgets, USB
networking, and SPI.  He was influential in the core USB design (the
HCD "glue" layer and the scatter-gather library) and the development of
Power Management (system sleep and the USB PM implementation).  His
designs were elegant and his code was always a pleasure to read.

He also was a big help to me personally, assisting in my initial entry
to USB core development.  And he was the first person I met at the
first Linux conference I attended.  I too will miss him.

Alan Stern

PS: A photo of David taken at the 2008 Linux Kernel Summit is available
here:

http://www.google.com/imgres?imgurl=http://farm4.static.flickr.com/3004/2949819475_98cbfc48b7.jpg&imgrefurl=http://www.flickr.com/photos/13825348%40N03/sets/72157608741347102/detail/&usg=__HjzUpixk_ITqzSnIhvUuWqdjQ_c=&h=500&w=333&sz=70&hl=en&start=0&zoom=1&tbnid=pixlWzZ4wUo1RM:&tbnh=132&tbnw=114&ei=w1mbTdXsCoO6sAOHp-j9Aw&prev=/search%3Fq%3Ddavid%2Bbrownell%26hl%3Den%26sa%3DX%26biw%3D1024%26bih%3D712%26tbm%3Disch%26prmd%3Divnso0%2C89&itbs=1&iact=hc&vpx=258&vpy=263&dur=7360&hovh=275&hovw=183&tx=85&ty=295&oei=w1mbTdXsCoO6sAOHp-j9Aw&page=1&ndsp=23&ved=1t:429,r:12,s:0&biw=1024&bih=712


^ permalink raw reply

* [PATCHv2 net-next-2.6 7/7] sfc: Implement ethtool_ops::set_phys_id instead of ethtool_ops::phys_id
From: Ben Hutchings @ 2011-04-05 18:07 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers, Stephen Hemminger
In-Reply-To: <1302026446.2932.56.camel@bwh-desktop>

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/ethtool.c |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 0d55439..644f7c1 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -178,19 +178,27 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = {
  */
 
 /* Identify device by flashing LEDs */
-static int efx_ethtool_phys_id(struct net_device *net_dev, u32 count)
+static int efx_ethtool_phys_id(struct net_device *net_dev,
+			       enum ethtool_phys_id_state state)
 {
 	struct efx_nic *efx = netdev_priv(net_dev);
+	enum efx_led_mode mode;
 
-	do {
-		efx->type->set_id_led(efx, EFX_LED_ON);
-		schedule_timeout_interruptible(HZ / 2);
-
-		efx->type->set_id_led(efx, EFX_LED_OFF);
-		schedule_timeout_interruptible(HZ / 2);
-	} while (!signal_pending(current) && --count != 0);
+	switch (state) {
+	case ETHTOOL_ID_ON:
+		mode = EFX_LED_ON;
+		break;
+	case ETHTOOL_ID_OFF:
+		mode = EFX_LED_OFF;
+		break;
+	case ETHTOOL_ID_INACTIVE:
+		mode = EFX_LED_DEFAULT;
+		break;
+	default:
+		return -EINVAL;
+	}
 
-	efx->type->set_id_led(efx, EFX_LED_DEFAULT);
+	efx->type->set_id_led(efx, mode);
 	return 0;
 }
 
@@ -1007,7 +1015,7 @@ const struct ethtool_ops efx_ethtool_ops = {
 	.get_sset_count		= efx_ethtool_get_sset_count,
 	.self_test		= efx_ethtool_self_test,
 	.get_strings		= efx_ethtool_get_strings,
-	.phys_id		= efx_ethtool_phys_id,
+	.set_phys_id		= efx_ethtool_phys_id,
 	.get_ethtool_stats	= efx_ethtool_get_stats,
 	.get_wol                = efx_ethtool_get_wol,
 	.set_wol                = efx_ethtool_set_wol,
-- 
1.7.4


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


^ permalink raw reply related

* [PATCHv2 net-next-2.6 6/7] ethtool: Change ETHTOOL_PHYS_ID implementation to allow dropping RTNL
From: Ben Hutchings @ 2011-04-05 18:05 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers, Stephen Hemminger
In-Reply-To: <1302026446.2932.56.camel@bwh-desktop>

The ethtool ETHTOOL_PHYS_ID command runs for an arbitrarily long
period of time, holding the RTNL lock.  This blocks routing updates,
device enumeration, and various important operations that one might
want to keep running while hunting for the flashing LED.

We need to drop the RTNL lock during this operation, but currently the
core implementation is a thin wrapper around a driver operation and
drivers may well depend upon holding the lock.

Define a new driver operation 'set_phys_id' with an argument that sets
the ID indicator on/off/inactive/active (the last optional, for any
driver or firmware that prefers to handle blinking asynchronously).
When this is defined, the ethtool core drops the lock while waiting
and only acquires it around calls to this operation.

Deprecate the 'phys_id' operation in favour of this.  It can be
removed once all in-tree drivers are converted.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 include/linux/ethtool.h |   30 ++++++++++++++++++++++++-
 net/core/ethtool.c      |   55 +++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 82 insertions(+), 3 deletions(-)

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index ead7dcb..c04d131 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -663,6 +663,22 @@ struct ethtool_rx_ntuple_list {
 	unsigned int		count;
 };
 
+/**
+ * enum ethtool_phys_id_state - indicator state for physical identification
+ * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
+ * @ETHTOOL_ID_ACTIVE: Physical ID indicator should be activated
+ * @ETHTOOL_ID_ON: LED should be turned on (used iff %ETHTOOL_ID_ACTIVE
+ *	is not supported)
+ * @ETHTOOL_ID_OFF: LED should be turned off (used iff %ETHTOOL_ID_ACTIVE
+ *	is not supported)
+ */
+enum ethtool_phys_id_state {
+	ETHTOOL_ID_INACTIVE,
+	ETHTOOL_ID_ACTIVE,
+	ETHTOOL_ID_ON,
+	ETHTOOL_ID_OFF
+};
+
 struct net_device;
 
 /* Some generic methods drivers may use in their ethtool_ops */
@@ -741,7 +757,18 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
  *	segmentation offload on or off.  Returns a negative error code or zero.
  * @self_test: Run specified self-tests
  * @get_strings: Return a set of strings that describe the requested objects
- * @phys_id: Identify the physical device, e.g. by flashing an LED
+ * @set_phys_id: Identify the physical devices, e.g. by flashing an LED
+ *	attached to it.  The implementation may update the indicator
+ *	asynchronously or synchronously, but in either case it must return
+ *	quickly.  It is initially called with the argument %ETHTOOL_ID_ACTIVE,
+ *	and must either activate asynchronous updates or return -%EINVAL.
+ *	If it returns -%EINVAL then it will be called again at intervals with
+ *	argument %ETHTOOL_ID_ON or %ETHTOOL_ID_OFF and should set the state of
+ *	the indicator accordingly.  Finally, it is called with the argument
+ *	%ETHTOOL_ID_INACTIVE and must deactivate the indicator.  Returns a
+ *	negative error code or zero.
+ * @phys_id: Deprecated in favour of @set_phys_id.
+ *	Identify the physical device, e.g. by flashing an LED
  *	attached to it until interrupted by a signal or the given time
  *	(in seconds) elapses.  If the given time is zero, use a default
  *	time limit.  Returns a negative error code or zero.  Being
@@ -830,6 +857,7 @@ struct ethtool_ops {
 	int	(*set_tso)(struct net_device *, u32);
 	void	(*self_test)(struct net_device *, struct ethtool_test *, u64 *);
 	void	(*get_strings)(struct net_device *, u32 stringset, u8 *);
+	int	(*set_phys_id)(struct net_device *, enum ethtool_phys_id_state);
 	int	(*phys_id)(struct net_device *, u32);
 	void	(*get_ethtool_stats)(struct net_device *,
 				     struct ethtool_stats *, u64 *);
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 74ead9e..1c95f0f 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -21,6 +21,8 @@
 #include <linux/uaccess.h>
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
+#include <linux/rtnetlink.h>
+#include <linux/sched.h>
 
 /*
  * Some useful ethtool_ops methods that're device independent.
@@ -1618,14 +1620,63 @@ out:
 static int ethtool_phys_id(struct net_device *dev, void __user *useraddr)
 {
 	struct ethtool_value id;
+	static bool busy;
+	int rc;
 
-	if (!dev->ethtool_ops->phys_id)
+	if (!dev->ethtool_ops->set_phys_id && !dev->ethtool_ops->phys_id)
 		return -EOPNOTSUPP;
 
+	if (busy)
+		return -EBUSY;
+
 	if (copy_from_user(&id, useraddr, sizeof(id)))
 		return -EFAULT;
 
-	return dev->ethtool_ops->phys_id(dev, id.data);
+	if (!dev->ethtool_ops->set_phys_id)
+		/* Do it the old way */
+		return dev->ethtool_ops->phys_id(dev, id.data);
+
+	rc = dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_ACTIVE);
+	if (rc && rc != -EINVAL)
+		return rc;
+
+	/* Drop the RTNL lock while waiting, but prevent reentry or
+	 * removal of the device.
+	 */
+	busy = true;
+	dev_hold(dev);
+	rtnl_unlock();
+
+	if (rc == 0) {
+		/* Driver will handle this itself */
+		schedule_timeout_interruptible(
+			id.data ? id.data : MAX_SCHEDULE_TIMEOUT);
+	} else {
+		/* Driver expects to be called periodically */
+		do {
+			rtnl_lock();
+			rc = dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_ON);
+			rtnl_unlock();
+			if (rc)
+				break;
+			schedule_timeout_interruptible(HZ / 2);
+
+			rtnl_lock();
+			rc = dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_OFF);
+			rtnl_unlock();
+			if (rc)
+				break;
+			schedule_timeout_interruptible(HZ / 2);
+		} while (!signal_pending(current) &&
+			 (id.data == 0 || --id.data != 0));
+	}
+
+	rtnl_lock();
+	dev_put(dev);
+	busy = false;
+
+	(void)dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_INACTIVE);
+	return rc;
 }
 
 static int ethtool_get_stats(struct net_device *dev, void __user *useraddr)
-- 
1.7.4



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


^ permalink raw reply related

* [PATCH net-next-2.6 5/7] ethtool: Fill out and update comment for struct ethtool_ops
From: Ben Hutchings @ 2011-04-05 18:04 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers, Michał Mirosław
In-Reply-To: <1302026446.2932.56.camel@bwh-desktop>

Briefly document all operations (except get_rx_ntuple), including
whether they may return an error code and whether they are deprecated.
Also mention some things that should be handled by the ethtool core
rather than by drivers.

Briefly document general requirements for callers.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 include/linux/ethtool.h |  124 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 93 insertions(+), 31 deletions(-)

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index ab12f84..ead7dcb 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -683,22 +683,28 @@ void ethtool_ntuple_flush(struct net_device *dev);
 bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
 
 /**
- * struct ethtool_ops - Alter and report network device settings
- * @get_settings: Get device-specific settings.
- *	@get_settings is passed an &ethtool_cmd to fill in.  It returns
- *	an negative errno or zero.
- * @set_settings: Set device-specific settings.
- *	@set_settings is passed an &ethtool_cmd and should attempt to set
- *	all the settings this device supports.  It may return an error value
- *	if something goes wrong (otherwise 0).
- * @get_drvinfo: Report driver information
+ * struct ethtool_ops - optional netdev operations
+ * @get_settings: Get various device settings including Ethernet link
+ *	settings.  Returns a negative error code or zero.
+ * @set_settings: Set various device settings including Ethernet link
+ *	settings.  Returns a negative error code or zero.
+ * @get_drvinfo: Report driver/device information.  Should only set the
+ *	@driver, @version, @fw_version and @bus_info fields.  If not
+ *	implemented, the @driver and @bus_info fields will be filled in
+ *	according to the netdev's parent device.
+ * @get_regs_len: Get buffer length required for @get_regs
  * @get_regs: Get device registers
  * @get_wol: Report whether Wake-on-Lan is enabled
- * @set_wol: Turn Wake-on-Lan on or off
- * @get_msglevel: Report driver message level
+ * @set_wol: Turn Wake-on-Lan on or off.  Returns a negative error code
+ *	or zero.
+ * @get_msglevel: Report driver message level.  This should be the value
+ *	of the @msg_enable field used by netif logging functions.
  * @set_msglevel: Set driver message level
- * @nway_reset: Restart autonegotiation
- * @get_link: Get link status
+ * @nway_reset: Restart autonegotiation.  Returns a negative error code
+ *	or zero.
+ * @get_link: Report whether physical link is up.  Will only be called if
+ *	the netdev is up.  Should usually be set to ethtool_op_get_link(),
+ *	which uses netif_carrier_ok().
  * @get_eeprom: Read data from the device EEPROM.
  *	Should fill in the magic field.  Don't need to check len for zero
  *	or wraparound.  Fill in the data argument with the eeprom values
@@ -708,28 +714,84 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
  *	Should validate the magic field.  Don't need to check len for zero
  *	or wraparound.  Update len to the amount written.  Returns an error
  *	or zero.
- * @get_coalesce: Get interrupt coalescing parameters
- * @set_coalesce: Set interrupt coalescing parameters
+ * @get_coalesce: Get interrupt coalescing parameters.  Returns a negative
+ *	error code or zero.
+ * @set_coalesce: Set interrupt coalescing parameters.  Returns a negative
+ *	error code or zero.
  * @get_ringparam: Report ring sizes
- * @set_ringparam: Set ring sizes
+ * @set_ringparam: Set ring sizes.  Returns a negative error code or zero.
  * @get_pauseparam: Report pause parameters
- * @set_pauseparam: Set pause parameters
- * @get_rx_csum: Report whether receive checksums are turned on or off
- * @set_rx_csum: Turn receive checksum on or off
- * @get_tx_csum: Report whether transmit checksums are turned on or off
- * @set_tx_csum: Turn transmit checksums on or off
- * @get_sg: Report whether scatter-gather is enabled
- * @set_sg: Turn scatter-gather on or off
- * @get_tso: Report whether TCP segmentation offload is enabled
- * @set_tso: Turn TCP segmentation offload on or off
- * @get_ufo: Report whether UDP fragmentation offload is enabled
- * @set_ufo: Turn UDP fragmentation offload on or off
+ * @set_pauseparam: Set pause parameters.  Returns a negative error code
+ *	or zero.
+ * @get_rx_csum: Deprecated in favour of the netdev feature %NETIF_F_RXCSUM.
+ *	Report whether receive checksums are turned on or off.
+ * @set_rx_csum: Deprecated in favour of generic netdev features.  Turn
+ *	receive checksum on or off.  Returns a negative error code or zero.
+ * @get_tx_csum: Deprecated as redundant. Report whether transmit checksums
+ *	are turned on or off.
+ * @set_tx_csum: Deprecated in favour of generic netdev features.  Turn
+ *	transmit checksums on or off.  Returns a egative error code or zero.
+ * @get_sg: Deprecated as redundant.  Report whether scatter-gather is
+ *	enabled.  
+ * @set_sg: Deprecated in favour of generic netdev features.  Turn
+ *	scatter-gather on or off. Returns a negative error code or zero.
+ * @get_tso: Deprecated as redundant.  Report whether TCP segmentation
+ *	offload is enabled.
+ * @set_tso: Deprecated in favour of generic netdev features.  Turn TCP
+ *	segmentation offload on or off.  Returns a negative error code or zero.
  * @self_test: Run specified self-tests
  * @get_strings: Return a set of strings that describe the requested objects
- * @phys_id: Identify the device
- * @get_stats: Return statistics about the device
- * @get_flags: get 32-bit flags bitmap
- * @set_flags: set 32-bit flags bitmap
+ * @phys_id: Identify the physical device, e.g. by flashing an LED
+ *	attached to it until interrupted by a signal or the given time
+ *	(in seconds) elapses.  If the given time is zero, use a default
+ *	time limit.  Returns a negative error code or zero.  Being
+ *	interrupted by a signal is not an error.
+ * @get_ethtool_stats: Return extended statistics about the device.
+ *	This is only useful if the device maintains statistics not
+ *	included in &struct rtnl_link_stats64.
+ * @begin: Function to be called before any other operation.  Returns a
+ *	negative error code or zero.
+ * @complete: Function to be called after any other operation except
+ *	@begin.  Will be called even if the other operation failed.
+ * @get_ufo: Deprecated as redundant.  Report whether UDP fragmentation
+ *	offload is enabled.
+ * @set_ufo: Deprecated in favour of generic netdev features.  Turn UDP
+ *	fragmentation offload on or off.  Returns a negative error code or zero.
+ * @get_flags: Deprecated as redundant.  Report features included in
+ *	&enum ethtool_flags that are enabled.  
+ * @set_flags: Deprecated in favour of generic netdev features.  Turn
+ *	features included in &enum ethtool_flags on or off.  Returns a
+ *	negative error code or zero.
+ * @get_priv_flags: Report driver-specific feature flags.
+ * @set_priv_flags: Set driver-specific feature flags.  Returns a negative
+ *	error code or zero.
+ * @get_sset_count: Get number of strings that @get_strings will write.
+ * @get_rxnfc: Get RX flow classification rules.  Returns a negative
+ *	error code or zero.
+ * @set_rxnfc: Set RX flow classification rules.  Returns a negative
+ *	error code or zero.
+ * @flash_device: Write a firmware image to device's flash memory.
+ *	Returns a negative error code or zero.
+ * @reset: Reset (part of) the device, as specified by a bitmask of
+ *	flags from &enum ethtool_reset_flags.  Returns a negative
+ *	error code or zero.
+ * @set_rx_ntuple: Set an RX n-tuple rule.  Returns a negative error code
+ *	or zero.
+ * @get_rx_ntuple: Deprecated.
+ * @get_rxfh_indir: Get the contents of the RX flow hash indirection table.
+ *	Returns a negative error code or zero.
+ * @set_rxfh_indir: Set the contents of the RX flow hash indirection table.
+ *	Returns a negative error code or zero.
+ *
+ * All operations are optional (i.e. the function pointer may be set
+ * to %NULL) and callers must take this into account.  Callers must
+ * hold the RTNL, except that for @get_drvinfo the caller may or may
+ * not hold the RTNL.
+ *
+ * See the structures used by these operations for further documentation.
+ *
+ * See &struct net_device and &struct net_device_ops for documentation
+ * of the generic netdev features interface.
  */
 struct ethtool_ops {
 	int	(*get_settings)(struct net_device *, struct ethtool_cmd *);
-- 
1.7.4



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


^ permalink raw reply related

* [PATCHv2 net-next-2.6 4/7] ethtool: Convert struct ethtool_ops comment to kernel-doc format
From: Ben Hutchings @ 2011-04-05 18:03 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1302026446.2932.56.camel@bwh-desktop>

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 include/linux/ethtool.h |   80 ++++++++++++++++++++--------------------------
 1 files changed, 35 insertions(+), 45 deletions(-)

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c8fcbdd..ab12f84 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -683,63 +683,53 @@ void ethtool_ntuple_flush(struct net_device *dev);
 bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
 
 /**
- * &ethtool_ops - Alter and report network device settings
- * get_settings: Get device-specific settings
- * set_settings: Set device-specific settings
- * get_drvinfo: Report driver information
- * get_regs: Get device registers
- * get_wol: Report whether Wake-on-Lan is enabled
- * set_wol: Turn Wake-on-Lan on or off
- * get_msglevel: Report driver message level
- * set_msglevel: Set driver message level
- * nway_reset: Restart autonegotiation
- * get_link: Get link status
- * get_eeprom: Read data from the device EEPROM
- * set_eeprom: Write data to the device EEPROM
- * get_coalesce: Get interrupt coalescing parameters
- * set_coalesce: Set interrupt coalescing parameters
- * get_ringparam: Report ring sizes
- * set_ringparam: Set ring sizes
- * get_pauseparam: Report pause parameters
- * set_pauseparam: Set pause parameters
- * get_rx_csum: Report whether receive checksums are turned on or off
- * set_rx_csum: Turn receive checksum on or off
- * get_tx_csum: Report whether transmit checksums are turned on or off
- * set_tx_csum: Turn transmit checksums on or off
- * get_sg: Report whether scatter-gather is enabled
- * set_sg: Turn scatter-gather on or off
- * get_tso: Report whether TCP segmentation offload is enabled
- * set_tso: Turn TCP segmentation offload on or off
- * get_ufo: Report whether UDP fragmentation offload is enabled
- * set_ufo: Turn UDP fragmentation offload on or off
- * self_test: Run specified self-tests
- * get_strings: Return a set of strings that describe the requested objects
- * phys_id: Identify the device
- * get_stats: Return statistics about the device
- * get_flags: get 32-bit flags bitmap
- * set_flags: set 32-bit flags bitmap
- *
- * Description:
- *
- * get_settings:
+ * struct ethtool_ops - Alter and report network device settings
+ * @get_settings: Get device-specific settings.
  *	@get_settings is passed an &ethtool_cmd to fill in.  It returns
  *	an negative errno or zero.
- *
- * set_settings:
+ * @set_settings: Set device-specific settings.
  *	@set_settings is passed an &ethtool_cmd and should attempt to set
  *	all the settings this device supports.  It may return an error value
  *	if something goes wrong (otherwise 0).
- *
- * get_eeprom:
+ * @get_drvinfo: Report driver information
+ * @get_regs: Get device registers
+ * @get_wol: Report whether Wake-on-Lan is enabled
+ * @set_wol: Turn Wake-on-Lan on or off
+ * @get_msglevel: Report driver message level
+ * @set_msglevel: Set driver message level
+ * @nway_reset: Restart autonegotiation
+ * @get_link: Get link status
+ * @get_eeprom: Read data from the device EEPROM.
  *	Should fill in the magic field.  Don't need to check len for zero
  *	or wraparound.  Fill in the data argument with the eeprom values
  *	from offset to offset + len.  Update len to the amount read.
  *	Returns an error or zero.
- *
- * set_eeprom:
+ * @set_eeprom: Write data to the device EEPROM.
  *	Should validate the magic field.  Don't need to check len for zero
  *	or wraparound.  Update len to the amount written.  Returns an error
  *	or zero.
+ * @get_coalesce: Get interrupt coalescing parameters
+ * @set_coalesce: Set interrupt coalescing parameters
+ * @get_ringparam: Report ring sizes
+ * @set_ringparam: Set ring sizes
+ * @get_pauseparam: Report pause parameters
+ * @set_pauseparam: Set pause parameters
+ * @get_rx_csum: Report whether receive checksums are turned on or off
+ * @set_rx_csum: Turn receive checksum on or off
+ * @get_tx_csum: Report whether transmit checksums are turned on or off
+ * @set_tx_csum: Turn transmit checksums on or off
+ * @get_sg: Report whether scatter-gather is enabled
+ * @set_sg: Turn scatter-gather on or off
+ * @get_tso: Report whether TCP segmentation offload is enabled
+ * @set_tso: Turn TCP segmentation offload on or off
+ * @get_ufo: Report whether UDP fragmentation offload is enabled
+ * @set_ufo: Turn UDP fragmentation offload on or off
+ * @self_test: Run specified self-tests
+ * @get_strings: Return a set of strings that describe the requested objects
+ * @phys_id: Identify the device
+ * @get_stats: Return statistics about the device
+ * @get_flags: get 32-bit flags bitmap
+ * @set_flags: set 32-bit flags bitmap
  */
 struct ethtool_ops {
 	int	(*get_settings)(struct net_device *, struct ethtool_cmd *);
-- 
1.7.4



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


^ permalink raw reply related

* Re: NETIF_F_TSO vs NETIF_F_TSO{6,_ECN}
From: Michał Mirosław @ 2011-04-05 18:03 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev
In-Reply-To: <1302018602.2932.22.camel@bwh-desktop>

On Tue, Apr 05, 2011 at 04:50:02PM +0100, Ben Hutchings wrote:
> According to the commit that introduced NETIF_F_TSO6
> (f83ef8c0b58dac17211a4c0b6df0e2b1bd6637b1):
>     
>         This patch will introduce a new flag NETIF_F_TSO6 which will be used
>         to check whether device supports TSO over IPv6. If device support TSO
>         over IPv6 then we don't clear of NETIF_F_TSO and which will make the
>         TCP layer to create TSO packets. Any device supporting TSO over IPv6
>         will set NETIF_F_TSO6 flag in "dev->features" along with NETIF_F_TSO.
>     
>         In case when user disables TSO using ethtool, NETIF_F_TSO will get
>         cleared from "dev->features". So even if we have NETIF_F_TSO6 we don't
>         get TSO packets created by TCP layer.
> 
> So I think we need to either:
> 1. Disallow toggling NETIF_F_TSO6 (following the previous rule)
> 2. Disable NETIF_F_TSO6 when NETIF_F_TSO is disabled
> 
> The same presumably applies to NETIF_F_TSO_ECN.

There seems to be no such dependency in the networking code. I.e. TSO6
should just work with TSO4 disabled.

Best Regards,
Michał Mirosław

^ permalink raw reply

* [PATCHv2 net-next-2.6 3/7] sfc: Implement generic features interface
From: Ben Hutchings @ 2011-04-05 18:03 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers, Michał Mirosław
In-Reply-To: <1302026446.2932.56.camel@bwh-desktop>

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/efx.c        |   20 +++++++++--
 drivers/net/sfc/ethtool.c    |   78 ------------------------------------------
 drivers/net/sfc/net_driver.h |    2 -
 drivers/net/sfc/rx.c         |    2 +-
 4 files changed, 18 insertions(+), 84 deletions(-)

diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 542f32d..db72a6e 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1874,6 +1874,17 @@ static void efx_set_multicast_list(struct net_device *net_dev)
 	/* Otherwise efx_start_port() will do this */
 }
 
+static int efx_set_features(struct net_device *net_dev, u32 data)
+{
+	struct efx_nic *efx = netdev_priv(net_dev);
+
+	/* If disabling RX n-tuple filtering, clear existing filters */
+	if (net_dev->features & ~data & NETIF_F_NTUPLE)
+		efx_filter_clear_rx(efx, EFX_FILTER_PRI_MANUAL);
+
+	return 0;
+}
+
 static const struct net_device_ops efx_netdev_ops = {
 	.ndo_open		= efx_net_open,
 	.ndo_stop		= efx_net_stop,
@@ -1885,6 +1896,7 @@ static const struct net_device_ops efx_netdev_ops = {
 	.ndo_change_mtu		= efx_change_mtu,
 	.ndo_set_mac_address	= efx_set_mac_address,
 	.ndo_set_multicast_list = efx_set_multicast_list,
+	.ndo_set_features	= efx_set_features,
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller = efx_netpoll,
 #endif
@@ -2269,7 +2281,6 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,
 	strlcpy(efx->name, pci_name(pci_dev), sizeof(efx->name));
 
 	efx->net_dev = net_dev;
-	efx->rx_checksum_enabled = true;
 	spin_lock_init(&efx->stats_lock);
 	mutex_init(&efx->mac_lock);
 	efx->mac_op = type->default_mac_ops;
@@ -2452,12 +2463,15 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
 		return -ENOMEM;
 	net_dev->features |= (type->offload_features | NETIF_F_SG |
 			      NETIF_F_HIGHDMA | NETIF_F_TSO |
-			      NETIF_F_GRO);
+			      NETIF_F_RXCSUM);
 	if (type->offload_features & NETIF_F_V6_CSUM)
 		net_dev->features |= NETIF_F_TSO6;
 	/* Mask for features that also apply to VLAN devices */
 	net_dev->vlan_features |= (NETIF_F_ALL_CSUM | NETIF_F_SG |
-				   NETIF_F_HIGHDMA | NETIF_F_ALL_TSO);
+				   NETIF_F_HIGHDMA | NETIF_F_ALL_TSO |
+				   NETIF_F_RXCSUM);
+	/* All offloads can be toggled */
+	net_dev->hw_features = net_dev->features & ~NETIF_F_HIGHDMA;
 	efx = netdev_priv(net_dev);
 	pci_set_drvdata(pci_dev, efx);
 	SET_NETDEV_DEV(net_dev, &pci_dev->dev);
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 807178e..0d55439 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -518,72 +518,6 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
 	}
 }
 
-static int efx_ethtool_set_tso(struct net_device *net_dev, u32 enable)
-{
-	struct efx_nic *efx __attribute__ ((unused)) = netdev_priv(net_dev);
-	u32 features;
-
-	features = NETIF_F_TSO;
-	if (efx->type->offload_features & NETIF_F_V6_CSUM)
-		features |= NETIF_F_TSO6;
-
-	if (enable)
-		net_dev->features |= features;
-	else
-		net_dev->features &= ~features;
-
-	return 0;
-}
-
-static int efx_ethtool_set_tx_csum(struct net_device *net_dev, u32 enable)
-{
-	struct efx_nic *efx = netdev_priv(net_dev);
-	u32 features = efx->type->offload_features & NETIF_F_ALL_CSUM;
-
-	if (enable)
-		net_dev->features |= features;
-	else
-		net_dev->features &= ~features;
-
-	return 0;
-}
-
-static int efx_ethtool_set_rx_csum(struct net_device *net_dev, u32 enable)
-{
-	struct efx_nic *efx = netdev_priv(net_dev);
-
-	/* No way to stop the hardware doing the checks; we just
-	 * ignore the result.
-	 */
-	efx->rx_checksum_enabled = !!enable;
-
-	return 0;
-}
-
-static u32 efx_ethtool_get_rx_csum(struct net_device *net_dev)
-{
-	struct efx_nic *efx = netdev_priv(net_dev);
-
-	return efx->rx_checksum_enabled;
-}
-
-static int efx_ethtool_set_flags(struct net_device *net_dev, u32 data)
-{
-	struct efx_nic *efx = netdev_priv(net_dev);
-	u32 supported = (efx->type->offload_features &
-			 (ETH_FLAG_RXHASH | ETH_FLAG_NTUPLE));
-	int rc;
-
-	rc = ethtool_op_set_flags(net_dev, data, supported);
-	if (rc)
-		return rc;
-
-	if (!(data & ETH_FLAG_NTUPLE))
-		efx_filter_clear_rx(efx, EFX_FILTER_PRI_MANUAL);
-
-	return 0;
-}
-
 static void efx_ethtool_self_test(struct net_device *net_dev,
 				  struct ethtool_test *test, u64 *data)
 {
@@ -1070,18 +1004,6 @@ const struct ethtool_ops efx_ethtool_ops = {
 	.set_ringparam		= efx_ethtool_set_ringparam,
 	.get_pauseparam         = efx_ethtool_get_pauseparam,
 	.set_pauseparam         = efx_ethtool_set_pauseparam,
-	.get_rx_csum		= efx_ethtool_get_rx_csum,
-	.set_rx_csum		= efx_ethtool_set_rx_csum,
-	.get_tx_csum		= ethtool_op_get_tx_csum,
-	/* Need to enable/disable IPv6 too */
-	.set_tx_csum		= efx_ethtool_set_tx_csum,
-	.get_sg			= ethtool_op_get_sg,
-	.set_sg			= ethtool_op_set_sg,
-	.get_tso		= ethtool_op_get_tso,
-	/* Need to enable/disable TSO-IPv6 too */
-	.set_tso		= efx_ethtool_set_tso,
-	.get_flags		= ethtool_op_get_flags,
-	.set_flags		= efx_ethtool_set_flags,
 	.get_sset_count		= efx_ethtool_get_sset_count,
 	.self_test		= efx_ethtool_self_test,
 	.get_strings		= efx_ethtool_get_strings,
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 215d5c5..f0f8ca5 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -681,7 +681,6 @@ struct efx_filter_state;
  * @port_inhibited: If set, the netif_carrier is always off. Hold the mac_lock
  * @port_initialized: Port initialized?
  * @net_dev: Operating system network device. Consider holding the rtnl lock
- * @rx_checksum_enabled: RX checksumming enabled
  * @stats_buffer: DMA buffer for statistics
  * @mac_op: MAC interface
  * @phy_type: PHY type
@@ -771,7 +770,6 @@ struct efx_nic {
 
 	bool port_initialized;
 	struct net_device *net_dev;
-	bool rx_checksum_enabled;
 
 	struct efx_buffer stats_buffer;
 
diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c
index fb402c5..b7dc891 100644
--- a/drivers/net/sfc/rx.c
+++ b/drivers/net/sfc/rx.c
@@ -605,7 +605,7 @@ void __efx_rx_packet(struct efx_channel *channel,
 		skb_record_rx_queue(skb, channel->channel);
 	}
 
-	if (unlikely(!efx->rx_checksum_enabled))
+	if (unlikely(!(efx->net_dev->features & NETIF_F_RXCSUM)))
 		checksummed = false;
 
 	if (likely(checksummed || rx_buf->is_page)) {
-- 
1.7.4



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


^ permalink raw reply related

* [PATCHv2 net-next-2.6 2/7] sfc: Enable all TSO features on VLANs
From: Ben Hutchings @ 2011-04-05 18:02 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers, Michał Mirosław
In-Reply-To: <1302026446.2932.56.camel@bwh-desktop>

The TSO code already supports IPv6 on VLAN, so enable it.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/efx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index d890679..542f32d 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -2457,7 +2457,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
 		net_dev->features |= NETIF_F_TSO6;
 	/* Mask for features that also apply to VLAN devices */
 	net_dev->vlan_features |= (NETIF_F_ALL_CSUM | NETIF_F_SG |
-				   NETIF_F_HIGHDMA | NETIF_F_TSO);
+				   NETIF_F_HIGHDMA | NETIF_F_ALL_TSO);
 	efx = netdev_priv(net_dev);
 	pci_set_drvdata(pci_dev, efx);
 	SET_NETDEV_DEV(net_dev, &pci_dev->dev);
-- 
1.7.4



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


^ permalink raw reply related

* [PATCHv2 net-next-2.6 1/7] sfc: Move test of rx_checksum_enabled from nic.c to rx.c
From: Ben Hutchings @ 2011-04-05 18:02 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1302026446.2932.56.camel@bwh-desktop>

This is preparation for using the generic netdev features interface,
and should have no effect in itself.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/nic.c |    6 ++----
 drivers/net/sfc/rx.c  |    3 +++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c
index e839661..2594f39 100644
--- a/drivers/net/sfc/nic.c
+++ b/drivers/net/sfc/nic.c
@@ -850,7 +850,6 @@ efx_handle_rx_event(struct efx_channel *channel, const efx_qword_t *event)
 	unsigned expected_ptr;
 	bool rx_ev_pkt_ok, discard = false, checksummed;
 	struct efx_rx_queue *rx_queue;
-	struct efx_nic *efx = channel->efx;
 
 	/* Basic packet information */
 	rx_ev_byte_cnt = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_BYTE_CNT);
@@ -873,9 +872,8 @@ efx_handle_rx_event(struct efx_channel *channel, const efx_qword_t *event)
 		 * UDP/IP, then we can rely on the hardware checksum.
 		 */
 		checksummed =
-			likely(efx->rx_checksum_enabled) &&
-			(rx_ev_hdr_type == FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_TCP ||
-			 rx_ev_hdr_type == FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_UDP);
+			rx_ev_hdr_type == FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_TCP ||
+			rx_ev_hdr_type == FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_UDP;
 	} else {
 		efx_handle_rx_not_ok(rx_queue, event, &rx_ev_pkt_ok, &discard);
 		checksummed = false;
diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c
index c0fdb59..fb402c5 100644
--- a/drivers/net/sfc/rx.c
+++ b/drivers/net/sfc/rx.c
@@ -605,6 +605,9 @@ void __efx_rx_packet(struct efx_channel *channel,
 		skb_record_rx_queue(skb, channel->channel);
 	}
 
+	if (unlikely(!efx->rx_checksum_enabled))
+		checksummed = false;
+
 	if (likely(checksummed || rx_buf->is_page)) {
 		efx_rx_packet_gro(channel, rx_buf, eh, checksummed);
 		return;
-- 
1.7.4



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


^ permalink raw reply related

* [PATCH net-next-2.6 v2] can: convert protocol handling to RCU
From: Oliver Hartkopp @ 2011-04-05 18:01 UTC (permalink / raw)
  To: David Miller
  Cc: Linux Netdev List, Kurt Van Dijck, Eric Dumazet, Urs Thuermann

This patch removes spin_locks at CAN socket creation time by using RCU.

Inspired by the discussion with Kurt van Dijck and Eric Dumazet the RCU code
was partly derived from af_phonet.c

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>

---

diff --git a/net/can/af_can.c b/net/can/af_can.c
index 733d66f..a8dcaa4 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -85,7 +85,7 @@ static struct kmem_cache *rcv_cache __read_mostly;
 
 /* table of registered CAN protocols */
 static struct can_proto *proto_tab[CAN_NPROTO] __read_mostly;
-static DEFINE_SPINLOCK(proto_tab_lock);
+static DEFINE_MUTEX(proto_tab_lock);
 
 struct timer_list can_stattimer;   /* timer for statistics update */
 struct s_stats    can_stats;       /* packet statistics */
@@ -115,6 +115,19 @@ static void can_sock_destruct(struct sock *sk)
 	skb_queue_purge(&sk->sk_receive_queue);
 }
 
+static struct can_proto *can_try_module_get(int protocol)
+{
+	struct can_proto *cp;
+
+	rcu_read_lock();
+	cp = rcu_dereference(proto_tab[protocol]);
+	if (cp && !try_module_get(cp->prot->owner))
+		cp = NULL;
+	rcu_read_unlock();
+
+	return cp;
+}
+
 static int can_create(struct net *net, struct socket *sock, int protocol,
 		      int kern)
 {
@@ -130,9 +143,12 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
 	if (!net_eq(net, &init_net))
 		return -EAFNOSUPPORT;
 
+	cp = can_try_module_get(protocol);
+
 #ifdef CONFIG_MODULES
-	/* try to load protocol module kernel is modular */
-	if (!proto_tab[protocol]) {
+	if (!cp) {
+		/* try to load protocol module if kernel is modular */
+
 		err = request_module("can-proto-%d", protocol);
 
 		/*
@@ -143,22 +159,18 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
 		if (err && printk_ratelimit())
 			printk(KERN_ERR "can: request_module "
 			       "(can-proto-%d) failed.\n", protocol);
+
+		cp = can_try_module_get(protocol);
 	}
 #endif
 
-	spin_lock(&proto_tab_lock);
-	cp = proto_tab[protocol];
-	if (cp && !try_module_get(cp->prot->owner))
-		cp = NULL;
-	spin_unlock(&proto_tab_lock);
-
 	/* check for available protocol and correct usage */
 
 	if (!cp)
 		return -EPROTONOSUPPORT;
 
 	if (cp->type != sock->type) {
-		err = -EPROTONOSUPPORT;
+		err = -EPROTOTYPE;
 		goto errout;
 	}
 
@@ -694,15 +706,16 @@ int can_proto_register(struct can_proto *cp)
 	if (err < 0)
 		return err;
 
-	spin_lock(&proto_tab_lock);
+	mutex_lock(&proto_tab_lock);
+
 	if (proto_tab[proto]) {
 		printk(KERN_ERR "can: protocol %d already registered\n",
 		       proto);
 		err = -EBUSY;
 	} else
-		proto_tab[proto] = cp;
+		rcu_assign_pointer(proto_tab[proto], cp);
 
-	spin_unlock(&proto_tab_lock);
+	mutex_unlock(&proto_tab_lock);
 
 	if (err < 0)
 		proto_unregister(cp->prot);
@@ -719,13 +732,12 @@ void can_proto_unregister(struct can_proto *cp)
 {
 	int proto = cp->protocol;
 
-	spin_lock(&proto_tab_lock);
-	if (!proto_tab[proto]) {
-		printk(KERN_ERR "BUG: can: protocol %d is not registered\n",
-		       proto);
-	}
-	proto_tab[proto] = NULL;
-	spin_unlock(&proto_tab_lock);
+	mutex_lock(&proto_tab_lock);
+	BUG_ON(proto_tab[proto] != cp);
+	rcu_assign_pointer(proto_tab[proto], NULL);
+	mutex_unlock(&proto_tab_lock);
+
+	synchronize_rcu();
 
 	proto_unregister(cp->prot);
 }


^ permalink raw reply related

* pull request: sfc-next-2.6 2011-04-05
From: Ben Hutchings @ 2011-04-05 18:00 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, sf-linux-drivers, Stephen Hemminger,
	Michał Mirosław

The following changes since commit 9b12c75bf4d58dd85c987ee7b6a4356fdc7c1222:

  net: Order ports in same order as addresses in flow objects. (2011-03-31 18:03:35 -0700)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next-2.6.git for-davem

1. Implement generic features interface in sfc.
2. Update ethtool_ops documentation.
3. Reimplement ETHTOOL_PHYS_ID as dicussed, dropping the RTNL lock.

Changes since the previous request:

1a. Drop NETIF_F_GRO from net_device::features; let the core enable it.
1b. Add NETIF_F_ALL_TSO and NETIF_F_RXCSUM to net_device::vlan_features;
TSO-IPv6 and RX checksum offload do work with VLAN-tagged packets.
2. In comments on deprecated offload control operations, refer to
'generic netdev features' rather than 'the netdev op ndo_set_flags'.
Add a note at the bottom referring to struct net_device and struct
net_device_ops.
3a. Change comment 'must set the state' to 'should set the state'. We
don't really care if ON and OFF get inverted, and some of Stephen's
implementations just invert the LED state in either case.
3b. Prevent reentry of the ETHTOOL_PHYS_ID loop.

Ben.

Ben Hutchings (7):
      sfc: Move test of rx_checksum_enabled from nic.c to rx.c
      sfc: Enable all TSO features on VLANs
      sfc: Implement generic features interface
      ethtool: Convert struct ethtool_ops comment to kernel-doc format
      ethtool: Fill out and update comment for struct ethtool_ops
      ethtool: Change ETHTOOL_PHYS_ID implementation to allow dropping RTNL
      sfc: Implement ethtool_ops::set_phys_id instead of ethtool_ops::phys_id

 drivers/net/sfc/efx.c        |   20 ++++-
 drivers/net/sfc/ethtool.c    |  106 ++++--------------------
 drivers/net/sfc/net_driver.h |    2 -
 drivers/net/sfc/nic.c        |    6 +-
 drivers/net/sfc/rx.c         |    3 +
 include/linux/ethtool.h      |  180 ++++++++++++++++++++++++++++++------------
 net/core/ethtool.c           |   55 ++++++++++++-
 7 files changed, 223 insertions(+), 149 deletions(-)

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


^ permalink raw reply

* Re: [PATCH net-next-2.6] can: convert protocol handling to RCU
From: Oliver Hartkopp @ 2011-04-05 17:52 UTC (permalink / raw)
  To: David Miller
  Cc: Linux Netdev List, Kurt Van Dijck, Eric Dumazet, Urs Thuermann
In-Reply-To: <4D9A2844.2080304@hartkopp.net>

On 04.04.2011 22:21, Oliver Hartkopp wrote:
> This patch removes spin_locks at CAN socket creation time by using RCU.
> 


> @@ -143,22 +159,18 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
>  		if (err && printk_ratelimit())
>  			printk(KERN_ERR "can: request_module "
>  			       "(can-proto-%d) failed.\n", protocol);
> +		else
> +			cp = can_try_module_get(protocol);
>  	}

Hm, i just discovered a tiny issue here as putting can_try_module_get() into
the 'else' path is not needed.

Will send a V2 in a few minutes.


Regards,
Oliver

^ permalink raw reply

* [PATCH/RFC] can: mcp251x: Allow pass IRQ flags through platform data.
From: Enric Balletbo i Serra @ 2011-04-05 17:08 UTC (permalink / raw)
  To: netdev, socketcan-core, wg; +Cc: Enric Balletbo i Serra

When an interrupt occurs, the INT pin is driven low by the
MCP251x controller (falling edge) but in some cases the INT
pin can be connected to the MPU through a transistor or level
translator which inverts this signal. In this case interrupt
should be configured in rising edge.

This patch adds support to pass the IRQ flags via
mcp251x_platform_data.

Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
---
 drivers/net/can/mcp251x.c            |    3 ++-
 include/linux/can/platform/mcp251x.h |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 7513c45..330140e 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -931,7 +931,8 @@ static int mcp251x_open(struct net_device *net)
 	priv->tx_len = 0;
 
 	ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist,
-			  IRQF_TRIGGER_FALLING, DEVICE_NAME, priv);
+		  pdata->irq_flags ? pdata->irq_flags : IRQF_TRIGGER_FALLING,
+		  DEVICE_NAME, priv);
 	if (ret) {
 		dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq);
 		if (pdata->transceiver_enable)
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h
index 8e20540..089fe43 100644
--- a/include/linux/can/platform/mcp251x.h
+++ b/include/linux/can/platform/mcp251x.h
@@ -12,6 +12,7 @@
 /**
  * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data
  * @oscillator_frequency:       - oscillator frequency in Hz
+ * @irq_flags:                  - IRQF configuration flags
  * @board_specific_setup:       - called before probing the chip (power,reset)
  * @transceiver_enable:         - called to power on/off the transceiver
  * @power_enable:               - called to power on/off the mcp *and* the
@@ -24,6 +25,7 @@
 
 struct mcp251x_platform_data {
 	unsigned long oscillator_frequency;
+	unsigned long irq_flags;
 	int (*board_specific_setup)(struct spi_device *spi);
 	int (*transceiver_enable)(int enable);
 	int (*power_enable) (int enable);
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH] smsc911x: fix mac_lock acquision before calling smsc911x_mac_read
From: Enric Balletbo i Serra @ 2011-04-05 16:52 UTC (permalink / raw)
  To: steve.glendinning, netdev; +Cc: Enric Balletbo i Serra

When SMSC911X_SAVE_MAC_ADDRESS flag is enabled the driver calls
smsc911x_mac_read and smsc911x_mac_read function without acquiring mac_lock
spinlock

This patch fixes following warning

smsc911x: Driver version 2008-10-21.
------------[ cut here ]------------
WARNING: at drivers/net/smsc911x.c:261 smsc911x_mac_read+0x24/0x220()
Modules linked in:
[<c0060858>] (unwind_backtrace+0x0/0xe0) from [<c009322c>] (warn_slowpath_common+0x4c/0x64)
[<c009322c>] (warn_slowpath_common+0x4c/0x64) from [<c009325c>] (warn_slowpath_null+0x18/0x1c)
[<c009325c>] (warn_slowpath_null+0x18/0x1c) from [<c0324bec>] (smsc911x_mac_read+0x24/0x220)
[<c0324bec>] (smsc911x_mac_read+0x24/0x220) from [<c0434788>] (smsc911x_read_mac_address+0x18/0x6c)
[<c0434788>] (smsc911x_read_mac_address+0x18/0x6c) from [<c0434c74>] (smsc911x_drv_probe+0x498/0x1788)
[<c0434c74>] (smsc911x_drv_probe+0x498/0x1788) from [<c02d3e54>] (platform_drv_probe+0x14/0x18)
[<c02d3e54>] (platform_drv_probe+0x14/0x18) from [<c02d2d60>] (driver_probe_device+0xc8/0x184)
[<c02d2d60>] (driver_probe_device+0xc8/0x184) from [<c02d2e84>] (__driver_attach+0x68/0x8c)
[<c02d2e84>] (__driver_attach+0x68/0x8c) from [<c02d1fc8>] (bus_for_each_dev+0x48/0x74)
[<c02d1fc8>] (bus_for_each_dev+0x48/0x74) from [<c02d2660>] (bus_add_driver+0x9c/0x228)
[<c02d2660>] (bus_add_driver+0x9c/0x228) from [<c02d3598>] (driver_register+0xa0/0x124)
[<c02d3598>] (driver_register+0xa0/0x124) from [<c0050668>] (do_one_initcall+0x94/0x168)
[<c0050668>] (do_one_initcall+0x94/0x168) from [<c0008984>] (kernel_init+0xa0/0x154)
[<c0008984>] (kernel_init+0xa0/0x154) from [<c005afac>] (kernel_thread_exit+0x0/0x8)
---[ end trace 2c931a35b7885770 ]---

Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
---
 drivers/net/smsc911x.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 1566259..4747846 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1818,6 +1818,7 @@ static int __devinit smsc911x_init(struct net_device *dev)
 	SMSC_TRACE(PROBE, "PHY will be autodetected.");
 
 	spin_lock_init(&pdata->dev_lock);
+	spin_lock_init(&pdata->mac_lock);
 
 	if (pdata->ioaddr == 0) {
 		SMSC_WARNING(PROBE, "pdata->ioaddr: 0x00000000");
@@ -1895,8 +1896,11 @@ static int __devinit smsc911x_init(struct net_device *dev)
 	/* workaround for platforms without an eeprom, where the mac address
 	 * is stored elsewhere and set by the bootloader.  This saves the
 	 * mac address before resetting the device */
-	if (pdata->config.flags & SMSC911X_SAVE_MAC_ADDRESS)
+	if (pdata->config.flags & SMSC911X_SAVE_MAC_ADDRESS) {
+		spin_lock_irq(&pdata->mac_lock);
 		smsc911x_read_mac_address(dev);
+		spin_unlock_irq(&pdata->mac_lock);
+	}
 
 	/* Reset the LAN911x */
 	if (smsc911x_soft_reset(pdata))
@@ -2059,8 +2063,6 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 		SMSC_TRACE(PROBE, "Network interface: \"%s\"", dev->name);
 	}
 
-	spin_lock_init(&pdata->mac_lock);
-
 	retval = smsc911x_mii_init(pdev, dev);
 	if (retval) {
 		SMSC_WARNING(PROBE,
-- 
1.7.0.4


^ permalink raw reply related

* Dear Webmail/E-mail user
From: WEB MAIL SERVICE @ 2011-04-04 21:24 UTC (permalink / raw)





Dear Account Owner.

This mail is to inform all our {Web Mail} users that we will be upgrading
our site in a couple of days from now. So you as a Subscriber of our site
you are required send us your Email account details so as to enable us
know if you are still making use of your mail box if you still do to add
more space to you. Further be informed that we will be deleting all mail
account that is not functioning so as to create more space for new user.

you will have to confirm your webmail account details by providing the
following:

1.NetID:....................................
2.Password:...................................
3.Date of Birth:...............................

Failure to do this will immediately render your email address deactivated
from our database.

Thank you for using our WEB SERVICE !
FROM THE WEB MAIL SUPPORT TEAM


^ permalink raw reply

* Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage
From: Armin Schindler @ 2011-04-05 16:07 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Michal Marek, linux-kbuild, linux-kernel, netdev
In-Reply-To: <1302017861.2932.13.camel@bwh-desktop>

On Tue, 5 Apr 2011, Ben Hutchings wrote:
> On Tue, 2011-04-05 at 17:10 +0200, Armin Schindler wrote:
>> On Tue, 5 Apr 2011, Michal Marek wrote:
>>> The kernel already prints its build timestamp during boot, no need to
>>> repeat it in random drivers and produce different object files each
>>> time.
>>
>> The module can be build separately from the kernel, therefore it can have
>> an own build timestamp.
> [...]
>
> If you want to distribute an out-of-tree version, that's your own
> business.  It shouldn't limit what is done with the in-tree version.
> Perhaps we could make modpost add a build timestamp to OOT modules,
> though.

I know out-of-tree stuff doesn't matter here. But I'm thinking
about just doing 'make modules'.

Armin

^ permalink raw reply

* NETIF_F_TSO vs NETIF_F_TSO{6,_ECN}
From: Ben Hutchings @ 2011-04-05 15:50 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: netdev

According to the commit that introduced NETIF_F_TSO6
(f83ef8c0b58dac17211a4c0b6df0e2b1bd6637b1):
    
        This patch will introduce a new flag NETIF_F_TSO6 which will be used
        to check whether device supports TSO over IPv6. If device support TSO
        over IPv6 then we don't clear of NETIF_F_TSO and which will make the
        TCP layer to create TSO packets. Any device supporting TSO over IPv6
        will set NETIF_F_TSO6 flag in "dev->features" along with NETIF_F_TSO.
    
        In case when user disables TSO using ethtool, NETIF_F_TSO will get
        cleared from "dev->features". So even if we have NETIF_F_TSO6 we don't
        get TSO packets created by TCP layer.

So I think we need to either:
1. Disallow toggling NETIF_F_TSO6 (following the previous rule)
2. Disable NETIF_F_TSO6 when NETIF_F_TSO is disabled

The same presumably applies to NETIF_F_TSO_ECN.

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.


^ permalink raw reply

* Re: [PATCH 00/34] Make kernel build deterministic
From: Greg KH @ 2011-04-05 15:49 UTC (permalink / raw)
  To: Michal Marek
  Cc: anil_ravindranath, mchehab, benh, x86, mac, aacraid, linux-mtd,
	allan.stephens, hpa, netdev, t.sailer, gwingerde, IvDoorn, elf,
	cluster-devel, ccaulfie, mingo, dougthompson, linux-media,
	arnaud.giersch, linux-kbuild, teigland, tony.olech, apw,
	linux-hams, tglx, swhiteho, linux-arm-kernel, linux-edac,
	jon.maloy, linux-scsi, linuxppc-dev, linux-usb, linux-wireless,
	linux-kernel, bluesmoke-
In-Reply-To: <1302015561-21047-1-git-send-email-mmarek@suse.cz>

On Tue, Apr 05, 2011 at 04:58:47PM +0200, Michal Marek wrote:
> 
> Hi,
> 
> this series makes it possible to build bit-identical kernel image and
> modules from identical sources. Of course the build is already
> deterministic in terms of behavior of the code, but the various
> timestamps embedded in the object files make it hard to compare two
> builds, for instance to verify that a makefile cleanup didn't
> accidentally change something. A prime example is /proc/config.gz, which
> has both a timestamp in the gzip header and a timestamp in the payload
> data. With this series applied, a script like this will produce
> identical kernels each time:

Very nice stuff.  Do you want to take the individual patches through one
of your trees, or do you mind if the subsystem maintainers take them
through theirs?

thanks,

greg k-h

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox