Netdev List
 help / color / mirror / Atom feed
* Re: [net-next PATCH] bnx2x: Fix link problem with some DACs
From: David Miller @ 2010-06-15  6:07 UTC (permalink / raw)
  To: yanivr; +Cc: netdev
In-Reply-To: <1276511188.13056.26.camel@lb-tlvb-yanivr.il.broadcom.com>

From: "Yaniv Rosner" <yanivr@broadcom.com>
Date: Mon, 14 Jun 2010 13:26:28 +0300

> -			/* Set 2-wire transfer rate to 400Khz since 100Khz
> -			is not operational */
> +			/* Set 2-wire transfer rate of SFP+ module EEPROM
> +			to 100Khz since some DACs(direct attached cables) do
> +			not work at 400Khz.*/

This is not the correct way to format a multi-line comment.
It should be:

			/* Set 2-wire transfer rate of SFP+ module EEPROM
			 * to 100Khz since some DACs(direct attached cables) do
			 * not work at 400Khz.
			 */

^ permalink raw reply

* Re: [RFC patch net/next] net: Hoist assigns from if?
From: David Miller @ 2010-06-15  5:59 UTC (permalink / raw)
  To: eric.dumazet; +Cc: joe, netdev
In-Reply-To: <1276580526.30434.330.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 15 Jun 2010 07:42:06 +0200

> Quite honestly, this kind of patch sucks, because it pollutes 'git
> blame' output. Its hard to point out the origin of a particular
> bug/code, and we have to spend precious time playing with complex git
> commands to go over cleanup patches.

I have to agree with Eric on this.

Pundits of these changes will argue that this is a deficiency in
git itself.

But that to me just means that until git has a friendlier way to
walk backwards through blame information for a line to skip past
the cleanup crapola, we shouldn't make a lot of these kinds of
changes.

So that means I'm really not excited to see this kind of patch
submitted, it's just noise that hurts scanning through history
and thus hurts development.

^ permalink raw reply

* Re: [RFC patch net/next] net: Hoist assigns from if?
From: Eric Dumazet @ 2010-06-15  5:42 UTC (permalink / raw)
  To: Joe Perches; +Cc: netdev, David Miller
In-Reply-To: <1276561234.4897.38.camel@Joe-Laptop.home>

Le lundi 14 juin 2010 à 17:20 -0700, Joe Perches a écrit :
> Awhile back I posted a script to reformat source code,
> similar to Lindent, but able to select in a piecemeal
> manner what source code style to convert.
> 
> http://lkml.org/lkml/2010/3/24/447
> 
> One of the options is to convert code from:
> 	if ((err = function(args)) != NULL) {
> to:
> 	err = function(args);
> 	if (err != NULL) {
> 
> I ran this script against net/ and get this result:
> 
> $ grep -rPl --include=*.[ch] "\bif\s*\(\s*\(" net/ | \
>   grep -v netfilter | \
>   xargs ./scripts/cvt_kernel_style.pl -o -convert=hoist_assigns_from_if 
> 
> and after a little cleanup, compilation verification, etc
> I get the diffstat below.  Should I post the actual patch?
> 

I'll answer for myself, but wait for David answer ;)

Quite honestly, this kind of patch sucks, because it pollutes 'git
blame' output. Its hard to point out the origin of a particular
bug/code, and we have to spend precious time playing with complex git
commands to go over cleanup patches.

Maybe its possible to mark a patch with a 'cleanups only' git qualifier
that can be ignored by 'git blame' ?

If not, that would be a nice git improvement to work on.

Alternatively, you could change real old stuff only (marked as the
original commit from Linus (1da177e4c3f4), creation of the known
universe back in 2005.




^ permalink raw reply

* [PATCH net-next-2.6] inetpeer: various changes
From: Eric Dumazet @ 2010-06-15  5:35 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Try to reduce cache line contentions in peer management, to reduce IP
defragmentation overhead.

- peer_fake_node is marked 'const' to make sure its not modified.
  (tested with CONFIG_DEBUG_RODATA=y)

- Group variables in two structures to reduce number of dirtied cache
lines. One named "peers" for avl tree root, its number of entries, and
associated lock. (candidate for RCU conversion)

- A second one named "unused_peers" for unused list and its lock 

- Add a !list_empty() test in unlink_from_unused() to avoid taking lock
when entry is not unused.

- Use atomic_dec_and_lock() in inet_putpeer() to avoid taking lock in
some cases.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/ipv4/inetpeer.c |   94 +++++++++++++++++++++++++-----------------
 1 file changed, 56 insertions(+), 38 deletions(-)

diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 6bcfe52..035673f 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -70,17 +70,25 @@
 static struct kmem_cache *peer_cachep __read_mostly;
 
 #define node_height(x) x->avl_height
-static struct inet_peer peer_fake_node = {
-	.avl_left	= &peer_fake_node,
-	.avl_right	= &peer_fake_node,
+
+#define peer_avl_empty ((struct inet_peer *)&peer_fake_node)
+static const struct inet_peer peer_fake_node = {
+	.avl_left	= peer_avl_empty,
+	.avl_right	= peer_avl_empty,
 	.avl_height	= 0
 };
-#define peer_avl_empty (&peer_fake_node)
-static struct inet_peer *peer_root = peer_avl_empty;
-static DEFINE_RWLOCK(peer_pool_lock);
+
+static struct {
+	struct inet_peer *root;
+	rwlock_t	lock;
+	int		total;
+} peers = {
+	.root		= peer_avl_empty,
+	.lock		= __RW_LOCK_UNLOCKED(peers.lock),
+	.total		= 0,
+};
 #define PEER_MAXDEPTH 40 /* sufficient for about 2^27 nodes */
 
-static int peer_total;
 /* Exported for sysctl_net_ipv4.  */
 int inet_peer_threshold __read_mostly = 65536 + 128;	/* start to throw entries more
 					 * aggressively at this stage */
@@ -89,8 +97,13 @@ int inet_peer_maxttl __read_mostly = 10 * 60 * HZ;	/* usual time to live: 10 min
 int inet_peer_gc_mintime __read_mostly = 10 * HZ;
 int inet_peer_gc_maxtime __read_mostly = 120 * HZ;
 
-static LIST_HEAD(unused_peers);
-static DEFINE_SPINLOCK(inet_peer_unused_lock);
+static struct {
+	struct list_head	list;
+	spinlock_t		lock;
+} unused_peers = {
+	.list			= LIST_HEAD_INIT(unused_peers.list),
+	.lock			= __SPIN_LOCK_UNLOCKED(unused_peers.lock),
+};
 
 static void peer_check_expire(unsigned long dummy);
 static DEFINE_TIMER(peer_periodic_timer, peer_check_expire, 0, 0);
@@ -131,9 +144,11 @@ void __init inet_initpeers(void)
 /* Called with or without local BH being disabled. */
 static void unlink_from_unused(struct inet_peer *p)
 {
-	spin_lock_bh(&inet_peer_unused_lock);
-	list_del_init(&p->unused);
-	spin_unlock_bh(&inet_peer_unused_lock);
+	if (!list_empty(&p->unused)) {
+		spin_lock_bh(&unused_peers.lock);
+		list_del_init(&p->unused);
+		spin_unlock_bh(&unused_peers.lock);
+	}
 }
 
 /*
@@ -146,9 +161,9 @@ static void unlink_from_unused(struct inet_peer *p)
 	struct inet_peer *u, **v;				\
 	if (_stack != NULL) {					\
 		stackptr = _stack;				\
-		*stackptr++ = &peer_root;			\
+		*stackptr++ = &peers.root;			\
 	}							\
-	for (u = peer_root; u != peer_avl_empty; ) {		\
+	for (u = peers.root; u != peer_avl_empty; ) {		\
 		if (_daddr == u->v4daddr)			\
 			break;					\
 		if ((__force __u32)_daddr < (__force __u32)u->v4daddr)	\
@@ -262,7 +277,7 @@ do {								\
 	n->avl_right = peer_avl_empty;				\
 	**--stackptr = n;					\
 	peer_avl_rebalance(stack, stackptr);			\
-} while(0)
+} while (0)
 
 /* May be called with local BH enabled. */
 static void unlink_from_pool(struct inet_peer *p)
@@ -271,7 +286,7 @@ static void unlink_from_pool(struct inet_peer *p)
 
 	do_free = 0;
 
-	write_lock_bh(&peer_pool_lock);
+	write_lock_bh(&peers.lock);
 	/* Check the reference counter.  It was artificially incremented by 1
 	 * in cleanup() function to prevent sudden disappearing.  If the
 	 * reference count is still 1 then the node is referenced only as `p'
@@ -303,10 +318,10 @@ static void unlink_from_pool(struct inet_peer *p)
 			delp[1] = &t->avl_left; /* was &p->avl_left */
 		}
 		peer_avl_rebalance(stack, stackptr);
-		peer_total--;
+		peers.total--;
 		do_free = 1;
 	}
-	write_unlock_bh(&peer_pool_lock);
+	write_unlock_bh(&peers.lock);
 
 	if (do_free)
 		kmem_cache_free(peer_cachep, p);
@@ -326,16 +341,16 @@ static int cleanup_once(unsigned long ttl)
 	struct inet_peer *p = NULL;
 
 	/* Remove the first entry from the list of unused nodes. */
-	spin_lock_bh(&inet_peer_unused_lock);
-	if (!list_empty(&unused_peers)) {
+	spin_lock_bh(&unused_peers.lock);
+	if (!list_empty(&unused_peers.list)) {
 		__u32 delta;
 
-		p = list_first_entry(&unused_peers, struct inet_peer, unused);
+		p = list_first_entry(&unused_peers.list, struct inet_peer, unused);
 		delta = (__u32)jiffies - p->dtime;
 
 		if (delta < ttl) {
 			/* Do not prune fresh entries. */
-			spin_unlock_bh(&inet_peer_unused_lock);
+			spin_unlock_bh(&unused_peers.lock);
 			return -1;
 		}
 
@@ -345,7 +360,7 @@ static int cleanup_once(unsigned long ttl)
 		 * before unlink_from_pool() call. */
 		atomic_inc(&p->refcnt);
 	}
-	spin_unlock_bh(&inet_peer_unused_lock);
+	spin_unlock_bh(&unused_peers.lock);
 
 	if (p == NULL)
 		/* It means that the total number of USED entries has
@@ -364,11 +379,11 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create)
 	struct inet_peer **stack[PEER_MAXDEPTH], ***stackptr;
 
 	/* Look up for the address quickly. */
-	read_lock_bh(&peer_pool_lock);
+	read_lock_bh(&peers.lock);
 	p = lookup(daddr, NULL);
 	if (p != peer_avl_empty)
 		atomic_inc(&p->refcnt);
-	read_unlock_bh(&peer_pool_lock);
+	read_unlock_bh(&peers.lock);
 
 	if (p != peer_avl_empty) {
 		/* The existing node has been found. */
@@ -390,7 +405,7 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create)
 	atomic_set(&n->ip_id_count, secure_ip_id(daddr));
 	n->tcp_ts_stamp = 0;
 
-	write_lock_bh(&peer_pool_lock);
+	write_lock_bh(&peers.lock);
 	/* Check if an entry has suddenly appeared. */
 	p = lookup(daddr, stack);
 	if (p != peer_avl_empty)
@@ -399,10 +414,10 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create)
 	/* Link the node. */
 	link_to_pool(n);
 	INIT_LIST_HEAD(&n->unused);
-	peer_total++;
-	write_unlock_bh(&peer_pool_lock);
+	peers.total++;
+	write_unlock_bh(&peers.lock);
 
-	if (peer_total >= inet_peer_threshold)
+	if (peers.total >= inet_peer_threshold)
 		/* Remove one less-recently-used entry. */
 		cleanup_once(0);
 
@@ -411,7 +426,7 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create)
 out_free:
 	/* The appropriate node is already in the pool. */
 	atomic_inc(&p->refcnt);
-	write_unlock_bh(&peer_pool_lock);
+	write_unlock_bh(&peers.lock);
 	/* Remove the entry from unused list if it was there. */
 	unlink_from_unused(p);
 	/* Free preallocated the preallocated node. */
@@ -425,12 +440,12 @@ static void peer_check_expire(unsigned long dummy)
 	unsigned long now = jiffies;
 	int ttl;
 
-	if (peer_total >= inet_peer_threshold)
+	if (peers.total >= inet_peer_threshold)
 		ttl = inet_peer_minttl;
 	else
 		ttl = inet_peer_maxttl
 				- (inet_peer_maxttl - inet_peer_minttl) / HZ *
-					peer_total / inet_peer_threshold * HZ;
+					peers.total / inet_peer_threshold * HZ;
 	while (!cleanup_once(ttl)) {
 		if (jiffies != now)
 			break;
@@ -439,22 +454,25 @@ static void peer_check_expire(unsigned long dummy)
 	/* Trigger the timer after inet_peer_gc_mintime .. inet_peer_gc_maxtime
 	 * interval depending on the total number of entries (more entries,
 	 * less interval). */
-	if (peer_total >= inet_peer_threshold)
+	if (peers.total >= inet_peer_threshold)
 		peer_periodic_timer.expires = jiffies + inet_peer_gc_mintime;
 	else
 		peer_periodic_timer.expires = jiffies
 			+ inet_peer_gc_maxtime
 			- (inet_peer_gc_maxtime - inet_peer_gc_mintime) / HZ *
-				peer_total / inet_peer_threshold * HZ;
+				peers.total / inet_peer_threshold * HZ;
 	add_timer(&peer_periodic_timer);
 }
 
 void inet_putpeer(struct inet_peer *p)
 {
-	spin_lock_bh(&inet_peer_unused_lock);
-	if (atomic_dec_and_test(&p->refcnt)) {
-		list_add_tail(&p->unused, &unused_peers);
+	local_bh_disable();
+
+	if (atomic_dec_and_lock(&p->refcnt, &unused_peers.lock)) {
+		list_add_tail(&p->unused, &unused_peers.list);
 		p->dtime = (__u32)jiffies;
+		spin_unlock(&unused_peers.lock);
 	}
-	spin_unlock_bh(&inet_peer_unused_lock);
+
+	local_bh_enable();
 }



^ permalink raw reply related

* Re: [PATCH] virtio_net: implements ethtool_ops.get_drvinfo
From: Taku Izumi @ 2010-06-15  5:20 UTC (permalink / raw)
  To: Rusty Russell; +Cc: David S. Miller, netdev@vger.kernel.org, Michael S. Tsirkin
In-Reply-To: <201006151358.12071.rusty@rustcorp.com.au>

Hi Rusty,

(2010/06/15 13:28), Rusty Russell wrote:
> On Fri, 11 Jun 2010 10:59:02 am Taku Izumi wrote:
>> This patch implements ethtool_ops.get_drvinfo interface of virtio_net driver.
>>
>> Signed-off-by: Taku Izumi<izumi.taku@jp.fujitsu.com>
> 
> Hi Taku!
> 
>     Does this have any useful effect?

I often use "ethtool -i" command to check what driver controls the ehternet device.
But because current virtio_net driver doesn't support "ethtool -i", it becomes the
following:

	# ethtool -i eth3
	Cannot get driver information: Operation not supported

My patch simply adds the "ethtool -i" support. The following is the result when
using the virtio_net driver with my patch applied to.

	# ethtool -i eth3
	driver: virtio_net
	version: N/A
	firmware-version: N/A
	bus-info: virtio0

Personally, "-i" is one of the most frequently-used option, and
most network drivers support "ethtool -i", so I think virtio_net also should do.

Taku Izumi <izumi.taku@jp.fujitsu.com>






^ permalink raw reply

* Re: [PATCH] virtio_net: implements ethtool_ops.get_drvinfo
From: Rusty Russell @ 2010-06-15  4:28 UTC (permalink / raw)
  To: Taku Izumi; +Cc: David S. Miller, netdev@vger.kernel.org, Michael S. Tsirkin
In-Reply-To: <4C11915E.6090201@jp.fujitsu.com>

On Fri, 11 Jun 2010 10:59:02 am Taku Izumi wrote:
> This patch implements ethtool_ops.get_drvinfo interface of virtio_net driver.
> 
> Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>

Hi Taku!

   Does this have any useful effect?

Thanks,
Rusty.

> ---
>  drivers/net/virtio_net.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> Index: net-next.35/drivers/net/virtio_net.c
> ===================================================================
> --- net-next.35.orig/drivers/net/virtio_net.c
> +++ net-next.35/drivers/net/virtio_net.c
> @@ -701,6 +701,18 @@ static int virtnet_close(struct net_devi
>  	return 0;
>  }
> 
> +static void virtnet_get_drvinfo(struct net_device *dev,
> +				struct ethtool_drvinfo *drvinfo)
> +{
> +	struct virtnet_info *vi = netdev_priv(dev);
> +	struct virtio_device *vdev = vi->vdev;
> +
> +	strncpy(drvinfo->driver, KBUILD_MODNAME, 32);
> +	strncpy(drvinfo->version, "N/A", 32);
> +	strncpy(drvinfo->fw_version, "N/A", 32);
> +	strncpy(drvinfo->bus_info, dev_name(&vdev->dev), 32);
> +}
> +
>  static int virtnet_set_tx_csum(struct net_device *dev, u32 data)
>  {
>  	struct virtnet_info *vi = netdev_priv(dev);
> @@ -813,6 +825,7 @@ static void virtnet_vlan_rx_kill_vid(str
>  }
> 
>  static const struct ethtool_ops virtnet_ethtool_ops = {
> +	.get_drvinfo = virtnet_get_drvinfo,
>  	.set_tx_csum = virtnet_set_tx_csum,
>  	.set_sg = ethtool_op_set_sg,
>  	.set_tso = ethtool_op_set_tso,
> 

^ permalink raw reply

* Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx
From: Rusty Russell @ 2010-06-15  4:23 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Stephen Hemminger, Sridhar Samudrala, virtualization, Jiri Pirko,
	Shirley Ma, netdev, linux-kernel
In-Reply-To: <20100610190343.GC4044@redhat.com>

On Fri, 11 Jun 2010 04:33:43 am Michael S. Tsirkin wrote:
> On Thu, Jun 10, 2010 at 10:46:53AM -0700, Stephen Hemminger wrote:
> > It makes more sense to have the device increment tx_droppped, 
> > and return NETDEV_TX_OK. Skip the message (or make it a pr_debug()). 
> > Network devices do not guarantee packet delivery, and if out of
> > resources then holding more data in the
> > queue is going to hurt not help the situation.

Yes, actually oom should be a ratelimited message and TX_OK, the other
case is a "should never happen" logic bug which warrants an error and
I don't care what it returns (whatever's easiest).

Please fix both at once since you're touching it.

Thanks,
Rusty.

^ permalink raw reply

* Re: linux-next: build failure after merge of the net tree
From: Stephen Rothwell @ 2010-06-15  3:42 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, linux-next, linux-kernel, andy, emil.s.tantilov,
	jeffrey.t.kirsher
In-Reply-To: <20100614.191356.193722104.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

Hi Dave,

On Mon, 14 Jun 2010 19:13:56 -0700 (PDT) David Miller <davem@davemloft.net> wrote:
>
> I'll incorporate your merge and build fixups when I merge net-2.6 into
> net-next-2.6 later tonight, thanks Stephen!

Great, thanks.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* Re: linux-next: build failure after merge of the net tree
From: David Miller @ 2010-06-15  2:13 UTC (permalink / raw)
  To: sfr
  Cc: netdev, linux-next, linux-kernel, andy, emil.s.tantilov,
	jeffrey.t.kirsher
In-Reply-To: <20100615120052.7202f20d.sfr@canb.auug.org.au>

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 15 Jun 2010 12:00:52 +1000

> Hi Dave,
> 
> After merging the wireless tree, today's linux-next build (powerpc ppc64_defconfig)
> failed like this:
> 
> drivers/net/ixgbe/ixgbe_ethtool.c: In function 'ixgbe_set_flags':
> drivers/net/ixgbe/ixgbe_ethtool.c:2232: error: implicit declaration of function 'DPRINTK'
> drivers/net/ixgbe/ixgbe_ethtool.c:2232: error: 'PROBE' undeclared (first use in this function)
> drivers/net/ixgbe/ixgbe_ethtool.c:2232: error: 'INFO' undeclared (first use in this function)
> 
> Commit 28c8e4790ca5ef75f54895ca46437f9fbb433ddf ("ixgbe: fix automatic
> LRO/RSC settings for low latency") from the net-current tree added
> another use of DPRINTK which needs comverting to e_info().  I applied the
> following patch:
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 15 Jun 2010 11:43:33 +1000
> Subject: [PATCH] net: ixgbe_ethtool merge fix up
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

I'll incorporate your merge and build fixups when I merge net-2.6 into
net-next-2.6 later tonight, thanks Stephen!

^ permalink raw reply

* linux-next: build failure after merge of the net tree
From: Stephen Rothwell @ 2010-06-15  2:00 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-next, linux-kernel, Andy Gospodarek, Emil Tantilov,
	Jeff Kirsher

Hi Dave,

After merging the wireless tree, today's linux-next build (powerpc ppc64_defconfig)
failed like this:

drivers/net/ixgbe/ixgbe_ethtool.c: In function 'ixgbe_set_flags':
drivers/net/ixgbe/ixgbe_ethtool.c:2232: error: implicit declaration of function 'DPRINTK'
drivers/net/ixgbe/ixgbe_ethtool.c:2232: error: 'PROBE' undeclared (first use in this function)
drivers/net/ixgbe/ixgbe_ethtool.c:2232: error: 'INFO' undeclared (first use in this function)

Commit 28c8e4790ca5ef75f54895ca46437f9fbb433ddf ("ixgbe: fix automatic
LRO/RSC settings for low latency") from the net-current tree added
another use of DPRINTK which needs comverting to e_info().  I applied the
following patch:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 15 Jun 2010 11:43:33 +1000
Subject: [PATCH] net: ixgbe_ethtool merge fix up

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/net/ixgbe/ixgbe_ethtool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 65fe1f5..093461b 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -2229,7 +2229,7 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data)
 		} else if (!adapter->rx_itr_setting) {
 			netdev->features &= ~ETH_FLAG_LRO;
 			if (data & ETH_FLAG_LRO)
-				DPRINTK(PROBE, INFO, "rx-usecs set to 0, "
+				e_info("rx-usecs set to 0, "
 					"LRO/RSC cannot be enabled.\n");
 		}
 	}
-- 
1.7.1

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

^ permalink raw reply related

* linux-next: manual merge of the net tree with the net-current tree
From: Stephen Rothwell @ 2010-06-15  2:00 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-next, linux-kernel, Emil Tantilov, Jeff Kirsher,
	Andy Gospodarek

Hi all,

Today's linux-next merge of the net tree got a conflict in
drivers/net/ixgbe/ixgbe_ethtool.c between commit
28c8e4790ca5ef75f54895ca46437f9fbb433ddf ("ixgbe: fix automatic LRO/RSC
settings for low latency") from the net-current tree and commit
849c45423c0c108e08d67644728cc9b0ed225fa1 ("ixgbe: Use netdev_<level>,
dev_<level>, pr_<level>") from the net tree.

I fixed it up (see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/net/ixgbe/ixgbe_ethtool.c
index 3a93a81,644e3d2..0000000
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@@ -2132,11 -2155,9 +2130,10 @@@ static int ixgbe_set_coalesce(struct ne
  		 */
  		if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
  			adapter->flags2 &= ~IXGBE_FLAG2_RSC_ENABLED;
 -			netdev->features &= ~NETIF_F_LRO;
 -			e_info("rx-usecs set to 0, disabling RSC\n");
 -
 +			if (netdev->features & NETIF_F_LRO) {
 +				netdev->features &= ~NETIF_F_LRO;
- 				DPRINTK(PROBE, INFO, "rx-usecs set to 0, "
- 					"disabling LRO/RSC\n");
++				e_info("rx-usecs set to 0, disabling LRO/RSC\n");
 +			}
  			need_reset = true;
  		}
  	}

^ permalink raw reply

* suspend/resume not working in MSIX mode
From: Michael Chan @ 2010-06-15  1:13 UTC (permalink / raw)
  To: linux-pci, netdev

I'm debugging the bnx2 driver which doesn't work after suspend/resume if
it is running in MSI-X mode.  The problem is that during suspend, the
MSI-X vectors are disabled by the following sequence on x86:

take_cpu_down() -> cpu_disable_common() -> fixup_irqs()

The MSI-X address/data used to disable the vectors are remembered in the
above sequence.  During resume, these address/data are then programmed
back to the device during pci_restore_state(), causing all the vectors
to remain disabled.

Some drivers call free_irq() during suspend and request_irq() during
resume, and that should avoid the problem.  bnx2 and some other drivers
do not do that.  These drivers rely on pci_restore_state() to restore
the MSI-X vectors to the same working state before suspend.

What's the right way to fix this?  Thanks.

^ permalink raw reply

* [RFC patch net/next] net: Hoist assigns from if?
From: Joe Perches @ 2010-06-15  0:20 UTC (permalink / raw)
  To: netdev; +Cc: David Miller

Awhile back I posted a script to reformat source code,
similar to Lindent, but able to select in a piecemeal
manner what source code style to convert.

http://lkml.org/lkml/2010/3/24/447

One of the options is to convert code from:
	if ((err = function(args)) != NULL) {
to:
	err = function(args);
	if (err != NULL) {

I ran this script against net/ and get this result:

$ grep -rPl --include=*.[ch] "\bif\s*\(\s*\(" net/ | \
  grep -v netfilter | \
  xargs ./scripts/cvt_kernel_style.pl -o -convert=hoist_assigns_from_if 

and after a little cleanup, compilation verification, etc
I get the diffstat below.  Should I post the actual patch?

 net/802/tr.c                            |    3 +-
 net/appletalk/ddp.c                     |   15 +++++---
 net/ax25/af_ax25.c                      |   34 ++++++++++++------
 net/ax25/ax25_addr.c                    |    3 +-
 net/ax25/ax25_dev.c                     |   18 ++++++---
 net/ax25/ax25_ds_subr.c                 |    3 +-
 net/ax25/ax25_iface.c                   |    3 +-
 net/ax25/ax25_in.c                      |   12 ++++--
 net/ax25/ax25_ip.c                      |    9 +++--
 net/ax25/ax25_out.c                     |   21 +++++++----
 net/ax25/ax25_route.c                   |   27 +++++++++-----
 net/ax25/ax25_subr.c                    |    6 ++-
 net/ax25/ax25_uid.c                     |    3 +-
 net/ax25/sysctl_net_ax25.c              |    3 +-
 net/bluetooth/cmtp/capi.c               |    3 +-
 net/bluetooth/cmtp/core.c               |    9 +++--
 net/bluetooth/hci_conn.c                |   21 +++++++----
 net/bluetooth/hci_core.c                |   45 ++++++++++++++++--------
 net/bluetooth/hci_event.c               |   18 ++++++---
 net/bluetooth/hci_sock.c                |   15 +++++---
 net/bluetooth/rfcomm/sock.c             |    3 +-
 net/bluetooth/rfcomm/tty.c              |   15 +++++---
 net/bluetooth/sco.c                     |   15 +++++---
 net/bridge/br_ioctl.c                   |    9 +++--
 net/core/datagram.c                     |   24 ++++++++----
 net/core/net-sysfs.c                    |    3 +-
 net/core/netpoll.c                      |   30 +++++++++++-----
 net/core/skbuff.c                       |   36 +++++++++++++------
 net/dccp/ccids/ccid3.c                  |    3 +-
 net/dccp/ipv4.c                         |    3 +-
 net/dccp/proto.c                        |    6 ++-
 net/decnet/af_decnet.c                  |    6 ++-
 net/decnet/dn_dev.c                     |   36 +++++++++++++------
 net/decnet/dn_fib.c                     |   15 +++++---
 net/decnet/dn_nsp_in.c                  |    6 ++-
 net/decnet/dn_nsp_out.c                 |   30 +++++++++++-----
 net/decnet/dn_route.c                   |   24 ++++++++----
 net/decnet/dn_table.c                   |    6 ++-
 net/econet/af_econet.c                  |   17 +++++----
 net/ipv4/ah4.c                          |    6 ++-
 net/ipv4/arp.c                          |   18 ++++++---
 net/ipv4/esp4.c                         |    6 ++-
 net/ipv4/fib_hash.c                     |    3 +-
 net/ipv4/fib_rules.c                    |    3 +-
 net/ipv4/fib_semantics.c                |   15 +++++---
 net/ipv4/ip_fragment.c                  |    6 ++-
 net/ipv4/ip_gre.c                       |   20 +++++++----
 net/ipv4/ip_input.c                     |    3 +-
 net/ipv4/ip_output.c                    |   21 +++++++----
 net/ipv4/ipconfig.c                     |   45 ++++++++++++++++--------
 net/ipv4/ipip.c                         |   20 +++++++----
 net/ipv4/ipmr.c                         |    9 +++--
 net/ipv4/route.c                        |    6 ++-
 net/ipv4/tcp.c                          |   24 ++++++++----
 net/ipv4/tcp_ipv4.c                     |    3 +-
 net/ipv4/tcp_minisocks.c                |    3 +-
 net/ipv4/tcp_output.c                   |    6 ++-
 net/ipv4/udp.c                          |    3 +-
 net/ipv6/addrconf.c                     |   12 ++++--
 net/ipv6/addrlabel.c                    |    8 +++--
 net/ipv6/af_inet6.c                     |   12 ++++--
 net/ipv6/ah6.c                          |    6 ++-
 net/ipv6/datagram.c                     |    3 +-
 net/ipv6/esp6.c                         |    6 ++-
 net/ipv6/icmp.c                         |    6 ++-
 net/ipv6/inet6_connection_sock.c        |    3 +-
 net/ipv6/ip6_input.c                    |    6 ++-
 net/ipv6/ip6_output.c                   |   18 ++++++---
 net/ipv6/ip6_tunnel.c                   |   23 +++++++-----
 net/ipv6/raw.c                          |    3 +-
 net/ipv6/reassembly.c                   |    3 +-
 net/ipv6/sit.c                          |   15 +++++---
 net/ipv6/tcp_ipv6.c                     |   12 ++++--
 net/ipv6/udp.c                          |    6 ++-
 net/ipx/af_ipx.c                        |    3 +-
 net/irda/af_irda.c                      |   12 ++++--
 net/irda/ircomm/ircomm_tty.c            |    3 +-
 net/irda/irlap_frame.c                  |    6 ++-
 net/irda/irnet/irnet_irda.c             |    6 ++-
 net/irda/irqueue.c                      |    3 +-
 net/key/af_key.c                        |   42 +++++++++++++++-------
 net/lapb/lapb_out.c                     |    3 +-
 net/lapb/lapb_subr.c                    |    6 ++-
 net/netrom/af_netrom.c                  |   24 ++++++++----
 net/netrom/nr_in.c                      |    3 +-
 net/netrom/nr_loopback.c                |    6 ++-
 net/netrom/nr_out.c                     |   12 ++++--
 net/netrom/nr_route.c                   |   30 +++++++++++-----
 net/netrom/nr_subr.c                    |    6 ++-
 net/packet/af_packet.c                  |    3 +-
 net/rose/af_rose.c                      |   21 +++++++----
 net/rose/rose_dev.c                     |    3 +-
 net/rose/rose_link.c                    |    9 +++--
 net/rose/rose_loopback.c                |    3 +-
 net/rose/rose_out.c                     |    3 +-
 net/rose/rose_route.c                   |   39 ++++++++++++++-------
 net/rose/rose_subr.c                    |    3 +-
 net/sched/act_api.c                     |    3 +-
 net/sched/act_ipt.c                     |    3 +-
 net/sched/cls_api.c                     |    9 +++--
 net/sched/cls_route.c                   |   21 +++++++----
 net/sched/cls_rsvp.h                    |    6 ++-
 net/sched/cls_u32.c                     |    3 +-
 net/sched/sch_api.c                     |   30 +++++++++++-----
 net/sched/sch_cbq.c                     |   33 +++++++++++------
 net/sched/sch_gred.c                    |    3 +-
 net/sched/sch_hfsc.c                    |   12 ++++--
 net/sched/sch_htb.c                     |   24 ++++++++----
 net/sched/sch_prio.c                    |    3 +-
 net/sched/sch_teql.c                    |    9 +++--
 net/sctp/input.c                        |    3 +-
 net/sctp/inqueue.c                      |    3 +-
 net/sctp/ipv6.c                         |    3 +-
 net/sctp/protocol.c                     |    6 ++-
 net/sctp/sm_make_chunk.c                |    3 +-
 net/sctp/socket.c                       |    4 +-
 net/sunrpc/auth.c                       |    9 +++--
 net/sunrpc/auth_gss/auth_gss.c          |    9 +++--
 net/sunrpc/auth_gss/gss_generic_token.c |   20 +++++++----
 net/sunrpc/auth_gss/gss_krb5_seqnum.c   |    3 +-
 net/sunrpc/auth_gss/gss_mech_switch.c   |    3 +-
 net/sunrpc/auth_gss/gss_spkm3_token.c   |    3 +-
 net/sunrpc/auth_gss/gss_spkm3_unseal.c  |    3 +-
 net/sunrpc/clnt.c                       |    9 +++--
 net/sunrpc/svcsock.c                    |   17 ++++++---
 net/sunrpc/xdr.c                        |    3 +-
 net/sunrpc/xprtsock.c                   |   18 ++++++---
 net/tipc/bearer.c                       |    3 +-
 net/tipc/core.c                         |    3 +-
 net/tipc/link.c                         |   15 +++++---
 net/tipc/net.c                          |    3 +-
 net/tipc/socket.c                       |   18 ++++++---
 net/tipc/user_reg.c                     |    3 +-
 net/wireless/wext-core.c                |    3 +-
 net/x25/af_x25.c                        |    9 +++--
 net/x25/x25_dev.c                       |    6 ++-
 net/x25/x25_forward.c                   |   21 +++++++----
 net/x25/x25_in.c                        |    3 +-
 net/x25/x25_link.c                      |    6 ++-
 net/x25/x25_out.c                       |   10 +++--
 net/x25/x25_subr.c                      |    3 +-
 net/xfrm/xfrm_policy.c                  |   21 +++++++----
 net/xfrm/xfrm_state.c                   |    3 +-
 net/xfrm/xfrm_user.c                    |   58 ++++++++++++++----------------
 144 files changed, 1071 insertions(+), 564 deletions(-)




^ permalink raw reply

* Re: [PATCH] KVM: add schedule check to napi_enable call
From: Bruce Rogers @ 2010-06-14 20:44 UTC (permalink / raw)
  To: Herbert Xu; +Cc: rusty, netdev
In-Reply-To: <20100606094048.GA1979@gondor.apana.org.au>

 >>> On 6/6/2010 at 03:40 AM, Herbert Xu <herbert@gondor.apana.org.au> wrote: 
> Bruce Rogers <brogers@novell.com> wrote:
>> Please consider this patch for the 2.6.32, 2.6.33, and 2.6.34 stable trees 
> as well as current development trees. (I've only tested on 2.6.32 however)
>> 
>>    virtio_net: Add schedule check to napi_enable call
>>    Under harsh testing conditions, including low memory, the guest would
>>    stop receiving packets. With this patch applied we no longer see any
>>    problems in the driver while performing these tests for extended periods
>>    of time.
>> 
>>    Make sure napi is scheduled subsequent to each napi_enable.
>> 
>>    Signed-off-by: Bruce Rogers <brogers@novell.com>
>>    Signed-off-by: Olaf Kirch <okir@suse.de>
>>    Acked-by: Rusty Russell <rusty@rustcorp.com.au>
>>    Cc: stable@kernel.org
> 
> Looks good to me.
> 
> Thanks!


Thanks for the review.

We are hoping to get this into our 2.6.32 based sle11 sp1 maintenance update. Are there any concerns with this patch?

Bruce


^ permalink raw reply

* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Eric Dumazet @ 2010-06-14 20:03 UTC (permalink / raw)
  To: Joe Perches; +Cc: Pedro Garcia, Patrick McHardy, Ben Hutchings, netdev
In-Reply-To: <1276544573.4897.6.camel@Joe-Laptop.home>

Le lundi 14 juin 2010 à 12:42 -0700, Joe Perches a écrit :
> On Mon, 2010-06-14 at 19:11 +0200, Patrick McHardy wrote:

> > Additionally:
> > - the pr_debug statements may be useful for debugging, but are
> >   a bit excessive for the final version
> 
> Patrick, what's wrong with pr_debug?
> Do you prefer pr_devel?

In the patch context, this pr_debug() is not necessary.

Just remove it, since its a normal situation, no need to log anything,
ever.




^ permalink raw reply

* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Joe Perches @ 2010-06-14 19:42 UTC (permalink / raw)
  To: Pedro Garcia, Patrick McHardy; +Cc: Ben Hutchings, netdev
In-Reply-To: <4C1662C3.3070708@trash.net>

On Mon, 2010-06-14 at 19:11 +0200, Patrick McHardy wrote:
> Ben Hutchings wrote:
> > On Mon, 2010-06-14 at 18:49 +0200, Pedro Garcia wrote:
> >> On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
> >> <bhutchings@solarflare.com> wrote:
> >>> I have no particular opinion on this change, but you need to read and
> >>> follow Documentation/SubmittingPatches.
> >> Sorry, first kernel patch, and I did not know about it. I resubmit with
> >> the correct style / format:
> > Sorry, no you haven't.
> > - Networking changes go through David Miller's net-next-2.6 tree so you
> > need to use that as the baseline, not 2.6.26
> > - Patches should be applicable with -p1, not -p0 (so if you use diff,
> > you should run it from one directory level up)
> > - The patch was word-wrapped

Pedro, you could use git format-patch and git send-email
http://linux.yyz.us/git-howto.html
http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html

> Additionally:
> - the pr_debug statements may be useful for debugging, but are
>   a bit excessive for the final version

Patrick, what's wrong with pr_debug?
Do you prefer pr_devel?

> - Please CC the maintainer (which is me)

scripts/get_maintainer.pl 


^ permalink raw reply

* Re: [2.6.35-rc3 regression] TCP connections on 'lo' interface randomly stall
From: Thomas Bächler @ 2010-06-14 19:36 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: David S. Miller, John Fastabend, netdev, linux-kernel
In-Reply-To: <20100614112319.9a2758f2.randy.dunlap@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

Am 14.06.2010 20:23, schrieb Randy Dunlap:
> On Mon, 14 Jun 2010 20:10:27 +0200 Thomas Bächler wrote:
> 
>> With 2.6.35-rc3, I cannot use TCP over the 'lo' interface any more. This
>> is reproduced easily by running 'ssh localhost' and executing a few
>> commands inside the ssh session (if you are able to log in, 'ls -lhFR /'
>> does a good job) - the connection will stall completely after a very
>> short time. As far as I can see, all applications are affected.
>>
>> It also seems that once a service is "stalled", I cannot open a new
>> connection to the same TCP port anymore. However, I can open a
>> connection to a different port until that one is stalled, too.
>>
>> Running wireshark, I can see that TCP retransmissions are sent, but
>> never acknowledged.
>>
>> Bisection (starting with 7908a9e as good and v2.6.35-rc3 as bad) leads
>> to the following commit. Please CC me on replies to this issue. Thanks
>> for your help.
> 
> Does this patch fix it for you?
> http://lkml.org/lkml/2010/6/13/155

Yes, it seems to fix it. Thanks.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply

* [RFC] [PATCH] ethtool: Flags for fibre speed switching
From: Ben Hutchings @ 2010-06-14 19:26 UTC (permalink / raw)
  To: netdev; +Cc: Jeff Garzik, sf-linux-drivers

ethtool.h currently defines only SUPPORTED_FIBRE to cover all fibre
modes.  However, SFP+ slots support both 1G and 10G fibre modules and
some modules are dual-speed.  Some drivers use the BASE-T flags for SFP+
modules of all media types, but this is strictly incorrect and can be
confusing as there are real BASE-T modules for SFP+.  There should be
distinct flags for fibre modes.  However I'm not sure whether it's worth
defining flags for each fibre mode (there are quite a few) or only for
each speed.

Similarly there is only ADVERTISED_FIBRE to cover all fibre modes.
Although there is no AN protocol for fibre, an SFP+ NIC effectively
autonegotiates its speed with the module.  By default, an SFP+ NIC will
accept both 1G and 10G modules and switch speed automatically.  With a
dual-speed module, the NIC driver can allow forcing the speed through
ethtool, but unless it maintains some hidden state it must reset the
speed whenever the module is hotplugged (perhaps accidentally).  So it
should be possible for the administrator to control speed selection in a
sticky way through the advertising mask.

Ben.

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 2c8af09..e3decb9 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -664,6 +664,9 @@ struct ethtool_ops {
 #define SUPPORTED_10000baseKX4_Full	(1 << 18)
 #define SUPPORTED_10000baseKR_Full	(1 << 19)
 #define SUPPORTED_10000baseR_FEC	(1 << 20)
+#define SUPPORTED_1000_FIBRE		(1 << 21)
+#define SUPPORTED_10000_FIBRE		(1 << 22)
+#define SUPPORTED_40000_FIBRE		(1 << 23)
 
 /* Indicates what features are advertised by the interface. */
 #define ADVERTISED_10baseT_Half		(1 << 0)
@@ -687,6 +690,9 @@ struct ethtool_ops {
 #define ADVERTISED_10000baseKX4_Full	(1 << 18)
 #define ADVERTISED_10000baseKR_Full	(1 << 19)
 #define ADVERTISED_10000baseR_FEC	(1 << 20)
+#define ADVERTISED_1000_FIBRE		(1 << 21)
+#define ADVERTISED_10000_FIBRE		(1 << 22)
+#define ADVERTISED_40000_FIBRE		(1 << 23)
 
 /* The following are all involved in forcing a particular link
  * mode for the device for setting things.  When getting the

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Eric Dumazet @ 2010-06-14 19:12 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Ben Hutchings, Pedro Garcia, netdev
In-Reply-To: <4C1662C3.3070708@trash.net>

Le lundi 14 juin 2010 à 19:11 +0200, Patrick McHardy a écrit :
> Ben Hutchings wrote:
> > On Mon, 2010-06-14 at 18:49 +0200, Pedro Garcia wrote:
> >   
> >> On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
> >> <bhutchings@solarflare.com> wrote:
> >>     
> >>> I have no particular opinion on this change, but you need to read and
> >>> follow Documentation/SubmittingPatches.
> >>>
> >>> Ben.
> >>>       
> >> Sorry, first kernel patch, and I did not know about it. I resubmit with
> >> the correct style / format:
> >>     
> > [...]
> >
> > Sorry, no you haven't.
> >
> > - Networking changes go through David Miller's net-next-2.6 tree so you
> > need to use that as the baseline, not 2.6.26
> > - Patches should be applicable with -p1, not -p0 (so if you use diff,
> > you should run it from one directory level up)
> > - The patch was word-wrapped
> 
> Additionally:
> 
> - please use the proper comment style, meaning each line begins
>   with a '*'
> 
> - the pr_debug statements may be useful for debugging, but are
>   a bit excessive for the final version
> 
> - + /* 2010-06-13: Pedro Garcia
> 
>    We have changelogs for this, simply explaining what the code
>    does is enough.
> 
> - Please CC the maintainer (which is me)
> --

Pedro, we have two kind of vlan setups :

accelerated and non accelerated ones.

Your patch address non accelated ones only, since you only touch
vlan_skb_recv()

Accelerated vlan can follow these paths :

1) NAPI devices

vlan_gro_receive() -> vlan_gro_common()

2) non NAPI devices

__vlan_hwaccel_rx() 

So you might also patch __vlan_hwaccel_rx() and vlan_gro_common()

Please merge following bits to your patch submission :

http://kerneltrap.org/mailarchive/linux-netdev/2010/5/23/6277868


Good luck for your first patch !



^ permalink raw reply

* [PATCH] ethtool: Revert incorrect indentation changes
From: Ben Hutchings @ 2010-06-14 18:53 UTC (permalink / raw)
  To: David Miller; +Cc: laurent chavey, netdev

commit 97f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6 "net: fix ethtool
coding style errors and warnings" changed the indentation of several
macro definitions in ethtool.h.  These definitions line up in the diff
where there is an extra character at the start of each line, but not
in the resulting file.

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

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 276b40a..2c8af09 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -586,29 +586,29 @@ struct ethtool_ops {
 #define ETHTOOL_GREGS		0x00000004 /* Get NIC registers. */
 #define ETHTOOL_GWOL		0x00000005 /* Get wake-on-lan options. */
 #define ETHTOOL_SWOL		0x00000006 /* Set wake-on-lan options. */
-#define ETHTOOL_GMSGLVL	0x00000007 /* Get driver message level */
-#define ETHTOOL_SMSGLVL	0x00000008 /* Set driver msg level. */
+#define ETHTOOL_GMSGLVL		0x00000007 /* Get driver message level */
+#define ETHTOOL_SMSGLVL		0x00000008 /* Set driver msg level. */
 #define ETHTOOL_NWAY_RST	0x00000009 /* Restart autonegotiation. */
 #define ETHTOOL_GLINK		0x0000000a /* Get link status (ethtool_value) */
-#define ETHTOOL_GEEPROM	0x0000000b /* Get EEPROM data */
-#define ETHTOOL_SEEPROM	0x0000000c /* Set EEPROM data. */
+#define ETHTOOL_GEEPROM		0x0000000b /* Get EEPROM data */
+#define ETHTOOL_SEEPROM		0x0000000c /* Set EEPROM data. */
 #define ETHTOOL_GCOALESCE	0x0000000e /* Get coalesce config */
 #define ETHTOOL_SCOALESCE	0x0000000f /* Set coalesce config. */
 #define ETHTOOL_GRINGPARAM	0x00000010 /* Get ring parameters */
 #define ETHTOOL_SRINGPARAM	0x00000011 /* Set ring parameters. */
 #define ETHTOOL_GPAUSEPARAM	0x00000012 /* Get pause parameters */
 #define ETHTOOL_SPAUSEPARAM	0x00000013 /* Set pause parameters. */
-#define ETHTOOL_GRXCSUM	0x00000014 /* Get RX hw csum enable (ethtool_value) */
-#define ETHTOOL_SRXCSUM	0x00000015 /* Set RX hw csum enable (ethtool_value) */
-#define ETHTOOL_GTXCSUM	0x00000016 /* Get TX hw csum enable (ethtool_value) */
-#define ETHTOOL_STXCSUM	0x00000017 /* Set TX hw csum enable (ethtool_value) */
+#define ETHTOOL_GRXCSUM		0x00000014 /* Get RX hw csum enable (ethtool_value) */
+#define ETHTOOL_SRXCSUM		0x00000015 /* Set RX hw csum enable (ethtool_value) */
+#define ETHTOOL_GTXCSUM		0x00000016 /* Get TX hw csum enable (ethtool_value) */
+#define ETHTOOL_STXCSUM		0x00000017 /* Set TX hw csum enable (ethtool_value) */
 #define ETHTOOL_GSG		0x00000018 /* Get scatter-gather enable
 					    * (ethtool_value) */
 #define ETHTOOL_SSG		0x00000019 /* Set scatter-gather enable
 					    * (ethtool_value). */
 #define ETHTOOL_TEST		0x0000001a /* execute NIC self-test. */
 #define ETHTOOL_GSTRINGS	0x0000001b /* get specified string set */
-#define ETHTOOL_PHYS_ID	0x0000001c /* identify the NIC */
+#define ETHTOOL_PHYS_ID		0x0000001c /* identify the NIC */
 #define ETHTOOL_GSTATS		0x0000001d /* get NIC-specific statistics */
 #define ETHTOOL_GTSO		0x0000001e /* Get TSO enable (ethtool_value) */
 #define ETHTOOL_STSO		0x0000001f /* Set TSO enable (ethtool_value) */
@@ -619,8 +619,8 @@ struct ethtool_ops {
 #define ETHTOOL_SGSO		0x00000024 /* Set GSO enable (ethtool_value) */
 #define ETHTOOL_GFLAGS		0x00000025 /* Get flags bitmap(ethtool_value) */
 #define ETHTOOL_SFLAGS		0x00000026 /* Set flags bitmap(ethtool_value) */
-#define ETHTOOL_GPFLAGS	0x00000027 /* Get driver-private flags bitmap */
-#define ETHTOOL_SPFLAGS	0x00000028 /* Set driver-private flags bitmap */
+#define ETHTOOL_GPFLAGS		0x00000027 /* Get driver-private flags bitmap */
+#define ETHTOOL_SPFLAGS		0x00000028 /* Set driver-private flags bitmap */
 
 #define ETHTOOL_GRXFH		0x00000029 /* Get RX flow hash configuration */
 #define ETHTOOL_SRXFH		0x0000002a /* Set RX flow hash configuration */
@@ -645,18 +645,18 @@ struct ethtool_ops {
 /* Indicates what features are supported by the interface. */
 #define SUPPORTED_10baseT_Half		(1 << 0)
 #define SUPPORTED_10baseT_Full		(1 << 1)
-#define SUPPORTED_100baseT_Half	(1 << 2)
-#define SUPPORTED_100baseT_Full	(1 << 3)
+#define SUPPORTED_100baseT_Half		(1 << 2)
+#define SUPPORTED_100baseT_Full		(1 << 3)
 #define SUPPORTED_1000baseT_Half	(1 << 4)
 #define SUPPORTED_1000baseT_Full	(1 << 5)
 #define SUPPORTED_Autoneg		(1 << 6)
 #define SUPPORTED_TP			(1 << 7)
 #define SUPPORTED_AUI			(1 << 8)
 #define SUPPORTED_MII			(1 << 9)
-#define SUPPORTED_FIBRE		(1 << 10)
+#define SUPPORTED_FIBRE			(1 << 10)
 #define SUPPORTED_BNC			(1 << 11)
 #define SUPPORTED_10000baseT_Full	(1 << 12)
-#define SUPPORTED_Pause		(1 << 13)
+#define SUPPORTED_Pause			(1 << 13)
 #define SUPPORTED_Asym_Pause		(1 << 14)
 #define SUPPORTED_2500baseX_Full	(1 << 15)
 #define SUPPORTED_Backplane		(1 << 16)
@@ -666,8 +666,8 @@ struct ethtool_ops {
 #define SUPPORTED_10000baseR_FEC	(1 << 20)
 
 /* Indicates what features are advertised by the interface. */
-#define ADVERTISED_10baseT_Half	(1 << 0)
-#define ADVERTISED_10baseT_Full	(1 << 1)
+#define ADVERTISED_10baseT_Half		(1 << 0)
+#define ADVERTISED_10baseT_Full		(1 << 1)
 #define ADVERTISED_100baseT_Half	(1 << 2)
 #define ADVERTISED_100baseT_Full	(1 << 3)
 #define ADVERTISED_1000baseT_Half	(1 << 4)
@@ -706,12 +706,12 @@ struct ethtool_ops {
 #define DUPLEX_FULL		0x01
 
 /* Which connector port. */
-#define PORT_TP		0x00
+#define PORT_TP			0x00
 #define PORT_AUI		0x01
 #define PORT_MII		0x02
 #define PORT_FIBRE		0x03
 #define PORT_BNC		0x04
-#define PORT_DA		0x05
+#define PORT_DA			0x05
 #define PORT_NONE		0xef
 #define PORT_OTHER		0xff
 
@@ -725,7 +725,7 @@ struct ethtool_ops {
 /* Enable or disable autonegotiation.  If this is set to enable,
  * the forced link modes above are completely ignored.
  */
-#define AUTONEG_DISABLE	0x00
+#define AUTONEG_DISABLE		0x00
 #define AUTONEG_ENABLE		0x01
 
 /* Mode MDI or MDI-X */
-- 
1.6.2.5

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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: [2.6.35-rc3 regression] TCP connections on 'lo' interface randomly stall
From: Randy Dunlap @ 2010-06-14 18:23 UTC (permalink / raw)
  To: Thomas Bächler; +Cc: David S. Miller, John Fastabend, netdev, linux-kernel
In-Reply-To: <4C167093.2030308@archlinux.org>

On Mon, 14 Jun 2010 20:10:27 +0200 Thomas Bächler wrote:

> With 2.6.35-rc3, I cannot use TCP over the 'lo' interface any more. This
> is reproduced easily by running 'ssh localhost' and executing a few
> commands inside the ssh session (if you are able to log in, 'ls -lhFR /'
> does a good job) - the connection will stall completely after a very
> short time. As far as I can see, all applications are affected.
> 
> It also seems that once a service is "stalled", I cannot open a new
> connection to the same TCP port anymore. However, I can open a
> connection to a different port until that one is stalled, too.
> 
> Running wireshark, I can see that TCP retransmissions are sent, but
> never acknowledged.
> 
> Bisection (starting with 7908a9e as good and v2.6.35-rc3 as bad) leads
> to the following commit. Please CC me on replies to this issue. Thanks
> for your help.

Does this patch fix it for you?
http://lkml.org/lkml/2010/6/13/155


> commit 597a264b1a9c7e36d1728f677c66c5c1f7e3b837
> Author: John Fastabend <john.r.fastabend@intel.com>
> Date:   Thu Jun 3 09:30:11 2010 +0000
> 
>     net: deliver skbs on inactive slaves to exact matches
> 
>     Currently, the accelerated receive path for VLAN's will
>     drop packets if the real device is an inactive slave and
>     is not one of the special pkts tested for in
>     skb_bond_should_drop().  This behavior is different then
>     the non-accelerated path and for pkts over a bonded vlan.
> 
>     For example,
> 
>     vlanx -> bond0 -> ethx
> 
>     will be dropped in the vlan path and not delivered to any
>     packet handlers at all.  However,
> 
>     bond0 -> vlanx -> ethx
> 
>     and
> 
>     bond0 -> ethx
> 
>     will be delivered to handlers that match the exact dev,
>     because the VLAN path checks the real_dev which is not a
>     slave and netif_recv_skb() doesn't drop frames but only
>     delivers them to exact matches.
> 
>     This patch adds a sk_buff flag which is used for tagging
>     skbs that would previously been dropped and allows the
>     skb to continue to skb_netif_recv().  Here we add
>     logic to check for the deliver_no_wcard flag and if it
>     is set only deliver to handlers that match exactly.  This
>     makes both paths above consistent and gives pkt handlers
>     a way to identify skbs that come from inactive slaves.
>     Without this patch in some configurations skbs will be
>     delivered to handlers with exact matches and in others
>     be dropped out right in the vlan path.
> 
>     I have tested the following 4 configurations in failover modes
>     and load balancing modes.
> 
>     # bond0 -> ethx
> 
>     # vlanx -> bond0 -> ethx
> 
>     # bond0 -> vlanx -> ethx
> 
>     # bond0 -> ethx
>                 |
>       vlanx -> --
> 
>     Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
> 


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply

* [2.6.35-rc3 regression] TCP connections on 'lo' interface randomly stall
From: Thomas Bächler @ 2010-06-14 18:10 UTC (permalink / raw)
  To: David S. Miller, John Fastabend, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2711 bytes --]

With 2.6.35-rc3, I cannot use TCP over the 'lo' interface any more. This
is reproduced easily by running 'ssh localhost' and executing a few
commands inside the ssh session (if you are able to log in, 'ls -lhFR /'
does a good job) - the connection will stall completely after a very
short time. As far as I can see, all applications are affected.

It also seems that once a service is "stalled", I cannot open a new
connection to the same TCP port anymore. However, I can open a
connection to a different port until that one is stalled, too.

Running wireshark, I can see that TCP retransmissions are sent, but
never acknowledged.

Bisection (starting with 7908a9e as good and v2.6.35-rc3 as bad) leads
to the following commit. Please CC me on replies to this issue. Thanks
for your help.

commit 597a264b1a9c7e36d1728f677c66c5c1f7e3b837
Author: John Fastabend <john.r.fastabend@intel.com>
Date:   Thu Jun 3 09:30:11 2010 +0000

    net: deliver skbs on inactive slaves to exact matches

    Currently, the accelerated receive path for VLAN's will
    drop packets if the real device is an inactive slave and
    is not one of the special pkts tested for in
    skb_bond_should_drop().  This behavior is different then
    the non-accelerated path and for pkts over a bonded vlan.

    For example,

    vlanx -> bond0 -> ethx

    will be dropped in the vlan path and not delivered to any
    packet handlers at all.  However,

    bond0 -> vlanx -> ethx

    and

    bond0 -> ethx

    will be delivered to handlers that match the exact dev,
    because the VLAN path checks the real_dev which is not a
    slave and netif_recv_skb() doesn't drop frames but only
    delivers them to exact matches.

    This patch adds a sk_buff flag which is used for tagging
    skbs that would previously been dropped and allows the
    skb to continue to skb_netif_recv().  Here we add
    logic to check for the deliver_no_wcard flag and if it
    is set only deliver to handlers that match exactly.  This
    makes both paths above consistent and gives pkt handlers
    a way to identify skbs that come from inactive slaves.
    Without this patch in some configurations skbs will be
    delivered to handlers with exact matches and in others
    be dropped out right in the vlan path.

    I have tested the following 4 configurations in failover modes
    and load balancing modes.

    # bond0 -> ethx

    # vlanx -> bond0 -> ethx

    # bond0 -> vlanx -> ethx

    # bond0 -> ethx
                |
      vlanx -> --

    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply

* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Patrick McHardy @ 2010-06-14 17:11 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Pedro Garcia, netdev
In-Reply-To: <1276534945.2074.11.camel@achroite.uk.solarflarecom.com>

Ben Hutchings wrote:
> On Mon, 2010-06-14 at 18:49 +0200, Pedro Garcia wrote:
>   
>> On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
>> <bhutchings@solarflare.com> wrote:
>>     
>>> I have no particular opinion on this change, but you need to read and
>>> follow Documentation/SubmittingPatches.
>>>
>>> Ben.
>>>       
>> Sorry, first kernel patch, and I did not know about it. I resubmit with
>> the correct style / format:
>>     
> [...]
>
> Sorry, no you haven't.
>
> - Networking changes go through David Miller's net-next-2.6 tree so you
> need to use that as the baseline, not 2.6.26
> - Patches should be applicable with -p1, not -p0 (so if you use diff,
> you should run it from one directory level up)
> - The patch was word-wrapped

Additionally:

- please use the proper comment style, meaning each line begins
  with a '*'

- the pr_debug statements may be useful for debugging, but are
  a bit excessive for the final version

- + /* 2010-06-13: Pedro Garcia

   We have changelogs for this, simply explaining what the code
   does is enough.

- Please CC the maintainer (which is me)

^ permalink raw reply

* Re: [PATCH] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Ben Hutchings @ 2010-06-14 17:02 UTC (permalink / raw)
  To: Pedro Garcia; +Cc: netdev
In-Reply-To: <5c6d1ac43fd8ad25661ebfba57c02174@dondevamos.com>

On Mon, 2010-06-14 at 18:49 +0200, Pedro Garcia wrote:
> On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> > I have no particular opinion on this change, but you need to read and
> > follow Documentation/SubmittingPatches.
> > 
> > Ben.
> 
> Sorry, first kernel patch, and I did not know about it. I resubmit with
> the correct style / format:
[...]

Sorry, no you haven't.

- Networking changes go through David Miller's net-next-2.6 tree so you
need to use that as the baseline, not 2.6.26
- Patches should be applicable with -p1, not -p0 (so if you use diff,
you should run it from one directory level up)
- The patch was word-wrapped

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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] vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)
From: Pedro Garcia @ 2010-06-14 16:49 UTC (permalink / raw)
  To: netdev; +Cc: Ben Hutchings
In-Reply-To: <1276466190.14011.223.camel@localhost>

On Sun, 13 Jun 2010 22:56:30 +0100, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> I have no particular opinion on this change, but you need to read and
> follow Documentation/SubmittingPatches.
> 
> Ben.

Sorry, first kernel patch, and I did not know about it. I resubmit with
the correct style / format:

I am using kernel 2.6.26 in a linux box, and I have another box in the
network using 802.1p (priority tagging, but no VLAN).

Without the 8021q module loaded in the kernel, all 802.1p packets are
silently discarded (probably as expected, as the protocol is not loaded in
the kernel).

When I load 8021q module, these packets are forwarded to the module, but
they are discarded also as VLAN 0 is not configured.

I think this should not be the default behaviour, as VLAN 0 is not really
a VLAN, so it should be treated differently.

I could define the VLAN 0 (ip link add link eth0 name eth0.dot1p type vlan
id 0), but then I have a lot of issues with the ARP table entries, as to
ping the other box, outgoing traffic goes through eth0, but incoming arp
reply ends up in eth0.dot1p. In the end this means I can not communicate
with the box using 802.1p unless I use 802.1p tagging for all traffic in
the network (the linux box and all other), which is not a must of the
spec.

I have developed a patch for vlan_dev.c which makes VLAN 0 to be just
reintroduced to netif_rx but with no VLAN tagging if VLAN 0 has not been
defined, so the default behaviour is to ignore the VLAN tagging and accept
the packet as if it was not tagged, and one can still define something
different for VLAN 0 if desired (so it is backwards compatible).

Signed-off-by: Pedro Garcia <pedro.netdev@dondevamos.com>
--- net/8021q/vlan_dev.c.orig   2008-07-13 23:51:29.000000000 +0200
+++ net/8021q/vlan_dev.c        2010-06-14 18:07:35.000000000 +0200
@@ -151,6 +151,7 @@ int vlan_skb_recv(struct sk_buff *skb, s
        struct vlan_hdr *vhdr;
        unsigned short vid;
        struct net_device_stats *stats;
+       struct net_device *vlan_dev;
        unsigned short vlan_TCI;
 
        skb = skb_share_check(skb, GFP_ATOMIC);
@@ -165,11 +166,23 @@ int vlan_skb_recv(struct sk_buff *skb, s
        vid = (vlan_TCI & VLAN_VID_MASK);
 
        rcu_read_lock();
-       skb->dev = __find_vlan_dev(dev, vid);
-       if (!skb->dev) {
+       vlan_dev = __find_vlan_dev(dev, vid);
+       if (vlan_dev) {
+               skb->dev = vlan_dev;
+       } else if (vid) {
                pr_debug("%s: ERROR: No net_device for VID: %u on dev:
%s\n",
                         __func__, (unsigned int)vid, dev->name);
                goto err_unlock;
+       } else {
+               /* 2010-06-13: Pedro Garcia
+                  The packet is VLAN tagged, but VID is 0 and the user
has
+                  not defined anything for VLAN 0, so it is a 802.1p
packet.
+                  We will just netif_rx it later to the original
interface,
+                  but with the skb->proto set to the wrapped proto, so we
do
+                  nothing here. */
+
+               pr_debug("%s: INFO: VLAN 0 used as default VLAN on dev:
%s\n",
+                        __func__, dev->name);
        }
 
        skb->dev->last_rx = jiffies;


^ 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