Netdev List
 help / color / mirror / Atom feed
* [PATCH 11/11] forcedeth: Use netdev_dbg for printk(KERN_DEBUG
From: Joe Perches @ 2010-11-29 17:42 UTC (permalink / raw)
  To: netdev; +Cc: Ben Hutchings, Szymon Janc, Michał Mirosław,
	linux-kernel
In-Reply-To: <cover.1291051316.git.joe@perches.com>

Use the normal debugging functions.
Print mac address when using random_ether_addr.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/forcedeth.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index c2945d6..cd2d72d 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -3407,7 +3407,8 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data)
 				mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
 			}
 			spin_unlock_irqrestore(&np->lock, flags);
-			printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_tx.\n", dev->name, i);
+			netdev_dbg(dev, "%s: too many iterations (%d)\n",
+				   __func__, i);
 			break;
 		}
 
@@ -3522,7 +3523,8 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data)
 				mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
 			}
 			spin_unlock_irqrestore(&np->lock, flags);
-			printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_rx.\n", dev->name, i);
+			netdev_dbg(dev, "%s: too many iterations (%d)\n",
+				   __func__, i);
 			break;
 		}
 	}
@@ -3586,7 +3588,8 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data)
 				mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
 			}
 			spin_unlock_irqrestore(&np->lock, flags);
-			printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_other.\n", dev->name, i);
+			netdev_dbg(dev, "%s: too many iterations (%d)\n",
+				   __func__, i);
 			break;
 		}
 
@@ -5463,7 +5466,9 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
 		dev->dev_addr[4] = (np->orig_mac[0] >>  8) & 0xff;
 		dev->dev_addr[5] = (np->orig_mac[0] >>  0) & 0xff;
 		writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll);
-		printk(KERN_DEBUG "nv_probe: set workaround bit for reversed mac addr\n");
+		dev_dbg(&pci_dev->dev,
+			"%s: set workaround bit for reversed mac addr\n",
+			__func__);
 	}
 	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
 
@@ -5473,11 +5478,11 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
 		 * to 01:23:45:67:89:ab
 		 */
 		dev_err(&pci_dev->dev,
-			"Invalid MAC address detected: %pM\n",
+			"Invalid MAC address detected: %pM - Please complain to your hardware vendor.\n",
 			dev->dev_addr);
-		dev_err(&pci_dev->dev,
-			"Please complain to your hardware vendor. Switched to a random MAC address.\n");
 		random_ether_addr(dev->dev_addr);
+		dev_err(&pci_dev->dev,
+			"Using random MAC address: %pM\n", dev->dev_addr);
 	}
 
 	/* set mac address */
-- 
1.7.3.2.245.g03276.dirty


^ permalink raw reply related

* Re: [PATCH net-next-2.6] xps: NUMA allocations for per cpu data
From: David Miller @ 2010-11-29 17:43 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, therbert
In-Reply-To: <1290959004.29196.13.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 28 Nov 2010 16:43:24 +0100

> store_xps_map() allocates maps that are used by single cpu, it makes
> sense to use NUMA allocations.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Tom Herbert <therbert@google.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next-2.6] xps: add __rcu annotations
From: David Miller @ 2010-11-29 17:43 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, therbert
In-Reply-To: <1291016582.29196.136.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 29 Nov 2010 08:43:02 +0100

> Avoid sparse warnings : add __rcu annotations and use
> rcu_dereference_protected() where necessary.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Tom Herbert <therbert@google.com>

Also applied, thanks Eric.

^ permalink raw reply

* Re: Simple kernel attack using socketpair. easy, 100% reproductiblle, works under guest. no way to protect :(
From: David Miller @ 2010-11-29 17:46 UTC (permalink / raw)
  To: eric.dumazet; +Cc: socketpair, netdev
In-Reply-To: <1290694299.2858.330.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 25 Nov 2010 15:11:39 +0100

> [PATCH] af_unix: limit recursion level
> 
> Its easy to eat all kernel memory and trigger NMI watchdog, using an
> exploit program that queues unix sockets on top of others.
> 
> lkml ref : http://lkml.org/lkml/2010/11/25/8
> 
> This mechanism is used in applications, one choice we have is to have a
> recursion limit.
> 
> Other limits might be needed as well (if we queue other types of files),
> since the passfd mechanism is currently limited by socket receive queue
> sizes only.
> 
> Add a recursion_level to unix socket, allowing up to 4 levels.
> 
> Each time we send an unix socket through sendfd mechanism, we copy its
> recursion level (plus one) to receiver. This recursion level is cleared
> when socket receive queue is emptied.
> 
> Reported-by: Марк Коренберг <socketpair@gmail.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Ok, since such deep recursive AF_UNIX fd sends is pretty
rediculious, it seems this is not likely to hit legitimate
use cases and thus I've applied this.

Also queued up for -stable.

Thanks!

^ permalink raw reply

* Re: [PATCH v2 0/4] kthread: NUMA aware kthread_create_on_cpu()
From: Eric Dumazet @ 2010-11-29 17:59 UTC (permalink / raw)
  To: David Miller, Andrew Morton
  Cc: andi, linux-kernel, linux-arch, netdev, tj, rusty, tony.luck,
	fenghua.yu
In-Reply-To: <20101129.093942.104054089.davem@davemloft.net>

Le lundi 29 novembre 2010 à 09:39 -0800, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Mon, 29 Nov 2010 16:13:23 +0100
> 
> > Note : compiled and tested on x86_32 and x86_64 only, but these patches
> > take care of other arches as well.
> > 
> > Cc: linux-arch@vger.kernel.org 
> > 
> > Thanks for your feedback Andi !
> 
> I'm fine with these changes:
> 
> Acked-by: David S. Miller <davem@davemloft.net>
> 
> Since the majority is non-networking it is pretty clear
> that someone other than me should integrate these patches.
> :-)

Sure !

I was thinking Andrew was the guy to carry this patch series, once
things settle down of course...

Thanks

^ permalink raw reply

* Re: Simple kernel attack using socketpair. easy, 100% reproductiblle, works under guest. no way to protect :(
From: Eric Dumazet @ 2010-11-29 18:01 UTC (permalink / raw)
  To: David Miller; +Cc: socketpair, netdev
In-Reply-To: <20101129.094628.39176431.davem@davemloft.net>

Le lundi 29 novembre 2010 à 09:46 -0800, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thu, 25 Nov 2010 15:11:39 +0100
> 
> > [PATCH] af_unix: limit recursion level
> > 
> > Its easy to eat all kernel memory and trigger NMI watchdog, using an
> > exploit program that queues unix sockets on top of others.
> > 
> > lkml ref : http://lkml.org/lkml/2010/11/25/8
> > 
> > This mechanism is used in applications, one choice we have is to have a
> > recursion limit.
> > 
> > Other limits might be needed as well (if we queue other types of files),
> > since the passfd mechanism is currently limited by socket receive queue
> > sizes only.
> > 
> > Add a recursion_level to unix socket, allowing up to 4 levels.
> > 
> > Each time we send an unix socket through sendfd mechanism, we copy its
> > recursion level (plus one) to receiver. This recursion level is cleared
> > when socket receive queue is emptied.
> > 
> > Reported-by: Марк Коренберг <socketpair@gmail.com>
> > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> 
> Ok, since such deep recursive AF_UNIX fd sends is pretty
> rediculious, it seems this is not likely to hit legitimate
> use cases and thus I've applied this.
> 
> Also queued up for -stable.
> 
> Thanks!

I tested FreeBSD (latest) and got a kernel freeze as well with exploit
program.

I dont know yet how to fully fix this problem.




^ permalink raw reply

* Re: [net-next-2.6] XFRM: remove unused member in xfrm_encap_tmpl.
From: Timo Teräs @ 2010-11-29 18:07 UTC (permalink / raw)
  To: David Shwatrz; +Cc: David S. Miller, netdev
In-Reply-To: <AANLkTiknTcWaRykGOTbw6JpFZN-ePnRXd3iWz86yYHKi@mail.gmail.com>

On 01/-10/-28163 09:59 PM, David Shwatrz wrote:
> Hi,
>  The patch removes unused member in xfrm_encap_tmpl.
> 
> Regards,
> David Shwartz
> 
> 
> Signed-off-by: David Shwartz <dshwatrz@gmail.com>
> 
> 
> diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
> index b971e38..7312707 100644
> --- a/include/linux/xfrm.h
> +++ b/include/linux/xfrm.h
> @@ -235,7 +235,6 @@ struct xfrm_encap_tmpl {
>  	__u16		encap_type;
>  	__be16		encap_sport;
>  	__be16		encap_dport;
> -	xfrm_address_t	encap_oa;
>  };
>  
>  /* AEVENT flags  */

struct xfrm_encap_tmpl is exposed to userland via netlink. This would
break ABI.

^ permalink raw reply

* [PATCH net-next-2.6] sched: use xps information for qdisc NUMA affinity
From: Eric Dumazet @ 2010-11-29 18:14 UTC (permalink / raw)
  To: David Miller; +Cc: Tom Herbert, netdev, Ben Hutchings
In-Reply-To: <1290705163.4274.12.camel@localhost>

I was thinking of using XPS tx_queue->cpu mapping to eventually allocate
memory with correct NUMA affinities, for qdisc/class stuff for example.

Here is a first patch to allocate qdisc with proper NUMA affinities.

Tested on my 16-cpus machine

echo 0001 >/sys/class/net/eth1/queues/tx-0/xps_cpus
echo 0002 >/sys/class/net/eth1/queues/tx-1/xps_cpus
echo 0004 >/sys/class/net/eth1/queues/tx-2/xps_cpus
echo 0008 >/sys/class/net/eth1/queues/tx-3/xps_cpus
echo 0010 >/sys/class/net/eth1/queues/tx-4/xps_cpus
echo 0020 >/sys/class/net/eth1/queues/tx-5/xps_cpus
echo 0040 >/sys/class/net/eth1/queues/tx-6/xps_cpus
echo 0080 >/sys/class/net/eth1/queues/tx-7/xps_cpus
echo 0100 >/sys/class/net/eth1/queues/tx-8/xps_cpus
echo 0200 >/sys/class/net/eth1/queues/tx-9/xps_cpus
echo 0400 >/sys/class/net/eth1/queues/tx-10/xps_cpus
echo 0800 >/sys/class/net/eth1/queues/tx-11/xps_cpus
echo 1000 >/sys/class/net/eth1/queues/tx-12/xps_cpus
echo 2000 >/sys/class/net/eth1/queues/tx-13/xps_cpus
echo 4000 >/sys/class/net/eth1/queues/tx-14/xps_cpus
echo 8000 >/sys/class/net/eth1/queues/tx-15/xps_cpus

tc qdisc del dev eth1 root
tc qdisc add dev eth1 root mq

Thanks

[PATCH net-next-2.6] sched: use xps information for qdisc NUMA affinity

Allocate qdisc memory according to NUMA properties of cpus included in
xps map.

To be effective, qdisc should be (re)setup after changes
of /sys/class/net/eth<n>/queues/tx-<n>/xps_cpus

I added a numa_node field in struct netdev_queue, containing NUMA node
if all cpus included in xps_cpus share same node, else -1.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Tom Herbert <therbert@google.com>
---
 include/linux/netdevice.h |   20 +++++++++++++++++++-
 net/core/dev.c            |    5 +++--
 net/core/net-sysfs.c      |   12 +++++++++++-
 net/sched/sch_generic.c   |    4 +++-
 4 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9ae4544..f912de7 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -508,7 +508,9 @@ struct netdev_queue {
 #ifdef CONFIG_RPS
 	struct kobject		kobj;
 #endif
-
+#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
+	int			numa_node;
+#endif
 /*
  * write mostly part
  */
@@ -523,6 +525,22 @@ struct netdev_queue {
 	u64			tx_dropped;
 } ____cacheline_aligned_in_smp;
 
+static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)
+{
+#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
+	return q->numa_node;
+#else
+	return -1;
+#endif
+}
+
+static inline void netdev_queue_numa_node_write(struct netdev_queue *q, int node)
+{
+#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
+	q->numa_node = node;
+#endif
+}
+
 #ifdef CONFIG_RPS
 /*
  * This structure holds an RPS map which can be of variable length.  The
diff --git a/net/core/dev.c b/net/core/dev.c
index 3259d2c..cd24374 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5125,9 +5125,10 @@ static int netif_alloc_netdev_queues(struct net_device *dev)
 	}
 	dev->_tx = tx;
 
-	for (i = 0; i < count; i++)
+	for (i = 0; i < count; i++) {
+		netdev_queue_numa_node_write(&tx[i], -1);
 		tx[i].dev = dev;
-
+	}
 	return 0;
 }
 
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 99c1129..149dde0 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -911,6 +911,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
 	struct xps_map *map, *new_map;
 	struct xps_dev_maps *dev_maps, *new_dev_maps;
 	int nonempty = 0;
+	int numa_node = -2;
 
 	if (!capable(CAP_NET_ADMIN))
 		return -EPERM;
@@ -950,7 +951,14 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
 			pos = map_len = alloc_len = 0;
 
 		need_set = cpu_isset(cpu, *mask) && cpu_online(cpu);
-
+#ifdef CONFIG_NUMA
+		if (need_set) {
+			if (numa_node == -2)
+				numa_node = cpu_to_node(cpu);
+			else if (numa_node != cpu_to_node(cpu))
+				numa_node = -1;
+		}
+#endif
 		if (need_set && pos >= map_len) {
 			/* Need to add queue to this CPU's map */
 			if (map_len >= alloc_len) {
@@ -996,6 +1004,8 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
 	if (dev_maps)
 		call_rcu(&dev_maps->rcu, xps_dev_maps_release);
 
+	netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node : -1);
+
 	mutex_unlock(&xps_map_mutex);
 
 	free_cpumask_var(mask);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 7f0bd89..0918834 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -553,7 +553,9 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
 	size = QDISC_ALIGN(sizeof(*sch));
 	size += ops->priv_size + (QDISC_ALIGNTO - 1);
 
-	p = kzalloc(size, GFP_KERNEL);
+	p = kzalloc_node(size, GFP_KERNEL,
+			 netdev_queue_numa_node_read(dev_queue));
+
 	if (!p)
 		goto errout;
 	sch = (struct Qdisc *) QDISC_ALIGN((unsigned long) p);



^ permalink raw reply related

* Broken TX checksumming offloads
From: Michał Mirosław @ 2010-11-29 18:17 UTC (permalink / raw)
  To: netdev; +Cc: Toshiharu Okada, e1000-devel

Hi!

Unless I'm horribly mistaken, generic HW checksumming works as follows:
 - driver sets netdev->features & NETIF_F_HW_CSUM to indicate support
   for generic checksumming; if the flag is not set, networking core
   will checksum skb before calling ndo_start_xmit (let's ignore
   other checksumming options for now) and not pass skb with
   skb->ip_summed == CHECKSUM_PARTIAL
 - ndo_start_xmit() should use skb->csum_start and skb->csum_offset
   (or skb->csum) to update checksum in software or instruct HW to do so

Looking at pch_gbe_xmit_frame() and its callee - pch_gbe_tx_queue() it
looks like the driver should set NETIF_F_IP_CSUM instead of NETIF_F_HW_CSUM
feature.

Similar thing happens in ixgbe driver: it sets NETIF_F_HW_CSUM and checks
for skb->ip_summed == CHECKSUM_PARTIAL, but then just warns on protocols
other that TCP and SCTP (see: ixgbe_psum()).

This means that these drivers might send packets with broken checksums
when TX checksumming offload is enabled. I haven't checked other drivers, yet.

Best Regards,
Michał Mirosław

^ permalink raw reply

* Re: inet_hash_connect: source port allocation
From: John Haxby @ 2010-11-29 18:29 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: NetDev
In-Reply-To: <1291051560.3435.1198.camel@edumazet-laptop>

On 29/11/10 17:26, Eric Dumazet wrote:
> Le lundi 29 novembre 2010 à 17:04 +0000, John Haxby a écrit :
>> Hello,
>>
>> Please forgive me if this is a stupid question, but is there any
>> particular reason why the source port allocation in
>> __inet_hash_connect() shouldn't use the same random allocation that
>> inet_csk_get_port() uses?  The latter, of course, is used when bind()
>> doesn't specify a source port but the implicit "bind" for a connect()
>> gets its port allocated by __inet_hash_connect().
>>
>> jch
> autobind vs bind
>
> bind() gives more information, like local address (if any)
>
> autobind(), we dont know local address, it'll be chose later by routing.

Sorry,  I think I phrased my question badly.

inet_csk_get_port() starts its search for a free port with

     smallest_rover = rover = net_random() % remaining + low;

whereas __inet_hash_connect() basically misses out that call to 
net_random() so you get a predictable port number.

Is there any good reason why that is the case?

jch



^ permalink raw reply

* Re: [PATCH 2/2] pch_gbe driver: The wrong of initializer entry
From: Dr. David Alan Gilbert @ 2010-11-29 18:32 UTC (permalink / raw)
  To: Toshiharu Okada
  Cc: David S. Miller, Randy Dunlap, John Linn, Ralf Baechle,
	Kristoffer Glembo, Maxime Bizon, Greg Rose, ML netdev, LKML,
	Wang, Qi, Wang, Yong Y, Andrew, Intel OTC, Foster, Margie,
	Ewe, Kok Howg
In-Reply-To: <4CF3D23F.3040003@dsn.okisemi.com>

* Toshiharu Okada (toshiharu-linux@dsn.okisemi.com) wrote:
> The wrong of initializer entry was modified.
> 
> Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
> Reported-by: Dr. David Alan Gilbert <linux@treblig.org>

Thanks.

Dave
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\ gro.gilbert @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply

* Re: inet_hash_connect: source port allocation
From: Eric Dumazet @ 2010-11-29 18:46 UTC (permalink / raw)
  To: John Haxby; +Cc: NetDev, Stephen Hemminger
In-Reply-To: <4CF3F114.2070108@oracle.com>

Le lundi 29 novembre 2010 à 18:29 +0000, John Haxby a écrit :

> Sorry,  I think I phrased my question badly.
> 
> inet_csk_get_port() starts its search for a free port with
> 
>      smallest_rover = rover = net_random() % remaining + low;
> 
> whereas __inet_hash_connect() basically misses out that call to 
> net_random() so you get a predictable port number.
> 
> Is there any good reason why that is the case?
> 

It seems random select was done at bind() time only in commit
6df716340da3a6f ([TCP/DCCP]: Randomize port selection)

It probably should be done in autobind too.




^ permalink raw reply

* Re: [net-next-2.6] XFRM: remove unused member in xfrm_encap_tmpl.
From: David Miller @ 2010-11-29 18:57 UTC (permalink / raw)
  To: timo.teras; +Cc: dshwatrz, netdev
In-Reply-To: <4CF3EBF2.5060308@iki.fi>

From: Timo Teräs <timo.teras@iki.fi>
Date: Mon, 29 Nov 2010 20:07:46 +0200

> On 01/-10/-28163 09:59 PM, David Shwatrz wrote:
>> Hi,
>>  The patch removes unused member in xfrm_encap_tmpl.
>> 
>> Regards,
>> David Shwartz
>> 
>> 
>> Signed-off-by: David Shwartz <dshwatrz@gmail.com>
>> 
>> 
>> diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
>> index b971e38..7312707 100644
>> --- a/include/linux/xfrm.h
>> +++ b/include/linux/xfrm.h
>> @@ -235,7 +235,6 @@ struct xfrm_encap_tmpl {
>>  	__u16		encap_type;
>>  	__be16		encap_sport;
>>  	__be16		encap_dport;
>> -	xfrm_address_t	encap_oa;
>>  };
>>  
>>  /* AEVENT flags  */
> 
> struct xfrm_encap_tmpl is exposed to userland via netlink. This would
> break ABI.

RIght.

^ permalink raw reply

* Re: inet_hash_connect: source port allocation
From: Eric Dumazet @ 2010-11-29 19:07 UTC (permalink / raw)
  To: John Haxby; +Cc: NetDev, Stephen Hemminger
In-Reply-To: <1291056363.3435.1338.camel@edumazet-laptop>

Le lundi 29 novembre 2010 à 19:46 +0100, Eric Dumazet a écrit :
> Le lundi 29 novembre 2010 à 18:29 +0000, John Haxby a écrit :
> 
> > Sorry,  I think I phrased my question badly.
> > 
> > inet_csk_get_port() starts its search for a free port with
> > 
> >      smallest_rover = rover = net_random() % remaining + low;
> > 
> > whereas __inet_hash_connect() basically misses out that call to 
> > net_random() so you get a predictable port number.
> > 
> > Is there any good reason why that is the case?
> > 
> 
> It seems random select was done at bind() time only in commit
> 6df716340da3a6f ([TCP/DCCP]: Randomize port selection)
> 
> It probably should be done in autobind too.
> 
> 

I'll test following patch :

diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index 1b344f3..65c3702 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -466,20 +466,18 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
 	int twrefcnt = 1;
 
 	if (!snum) {
-		int i, remaining, low, high, port;
-		static u32 hint;
-		u32 offset = hint + port_offset;
+		int remaining, low, high, port;
 		struct hlist_node *node;
 		struct inet_timewait_sock *tw = NULL;
 
 		inet_get_local_port_range(&low, &high);
 		remaining = (high - low) + 1;
+		port = net_random() % remaining + low;
 
 		local_bh_disable();
-		for (i = 1; i <= remaining; i++) {
-			port = low + (i + offset) % remaining;
+		do {
 			if (inet_is_reserved_local_port(port))
-				continue;
+				goto next_nolock;
 			head = &hinfo->bhash[inet_bhashfn(net, port,
 					hinfo->bhash_size)];
 			spin_lock(&head->lock);
@@ -510,16 +508,17 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
 			tb->fastreuse = -1;
 			goto ok;
 
-		next_port:
+next_port:
 			spin_unlock(&head->lock);
-		}
+next_nolock:
+			if (++port > high)
+				port = low;
+		} while (--remaining > 0);
 		local_bh_enable();
 
 		return -EADDRNOTAVAIL;
 
 ok:
-		hint += i;
-
 		/* Head lock still held and bh's disabled */
 		inet_bind_hash(sk, tb, port);
 		if (sk_unhashed(sk)) {



^ permalink raw reply related

* Re: Broken TX checksumming offloads
From: Ben Hutchings @ 2010-11-29 19:13 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: netdev, Toshiharu Okada, e1000-devel
In-Reply-To: <20101129181742.GA29192@rere.qmqm.pl>

On Mon, 2010-11-29 at 19:17 +0100, Michał Mirosław wrote:
> Hi!
> 
> Unless I'm horribly mistaken, generic HW checksumming works as follows:
>  - driver sets netdev->features & NETIF_F_HW_CSUM to indicate support
>    for generic checksumming; if the flag is not set, networking core
>    will checksum skb before calling ndo_start_xmit (let's ignore
>    other checksumming options for now) and not pass skb with
>    skb->ip_summed == CHECKSUM_PARTIAL
>  - ndo_start_xmit() should use skb->csum_start and skb->csum_offset
>    (or skb->csum) to update checksum in software or instruct HW to do so
> 
> Looking at pch_gbe_xmit_frame() and its callee - pch_gbe_tx_queue() it
> looks like the driver should set NETIF_F_IP_CSUM instead of NETIF_F_HW_CSUM
> feature.
>
> Similar thing happens in ixgbe driver: it sets NETIF_F_HW_CSUM and checks
> for skb->ip_summed == CHECKSUM_PARTIAL, but then just warns on protocols
> other that TCP and SCTP (see: ixgbe_psum()).

AFAIK only {TCP,UDP}/IPv{4,6} use the simple 16-bit checksum algorithm
that NETIF_F_HW_CSUM implies, so in practice it is equivalent to
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM even though it doesn't mean the same
thing.

Older kernel versions lacked a definititon of NETIF_F_IPV6_CSUM so
out-of-tree drivers and in-tree drivers that started out-of-tree are
likely to use NETIF_F_HW_CSUM as a workaround for that.

Since the minimum size of a {TCP,UDP}/IPv6/Ethernet frame is 62 bytes +
CRC, the workaround in pch_gbe_tx_queue() may not be needed for IPv6.
(I'm assuming that the critical length of 64 bytes actually includes the
CRC, although the workaround code currently assumes otherwise.)

> This means that these drivers might send packets with broken checksums
> when TX checksumming offload is enabled. I haven't checked other drivers, yet.

They might or they might not; it's hard to tell without access to the
hardware.  But if the driver never references csum_{start,offset} then
it is probably valid to replace NETIF_F_HW_CSUM with NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM (and similarly for the ethtool operations).

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

* pull request: wireless-next-2.6 2010-11-29
From: John W. Linville @ 2010-11-29 19:13 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

Dave,

Between celebrating my birthday and the Thanksgiving holiday, this pull
request is a bit bigger than usual...sorry!

For the most part, this is the usual stuff -- driver updates and the
like.  mwl8k, wl1271, ath9k, carl9170, rt2x00, b43, and iwlwifi all get
significant attention, along with a smattering of others.  mac80211 gets
a variety of updates as well.

This includes the movement of an EWMA library to lib for general use.
Also included is some file renaming for drivers/net/wireless/wl12xx.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit e9248fbd6b6f7ef1917bfffe998654e40dfb4cfd:

  vmxnet3: fix compilation when RSS is disabled (2010-11-28 18:25:33 -0800)

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

Arik Nemtsov (2):
      mac80211: support hardware TX fragmentation offload
      wl1271: add support for HW TX fragmentation

Ben Greear (1):
      ath5k: Cleanup opmode setting logic.

Brian Cavagnolo (6):
      mwl8k: revert unnecessary modification of tx descriptor
      mwl8k: factor out firmware loading and hw init code
      mwl8k: choose proper firmware image as directed by user
      mwl8k: add API version checking for AP firmware
      mwl8k: make initial firmware load asynchronous
      mwl8k: use const struct fw pointers throughout

Bruno Randolf (7):
      cfg80211: Add nl80211 antenna configuration
      mac80211: Add antenna configuration
      ath5k: Add support for antenna configuration
      lib: Add generic exponentially weighted moving average (EWMA) function
      ath5k: Use generic EWMA library
      nl80211/mac80211: Report signal average
      cfg80211: Add documentation for antenna ops

Christian Lamparter (2):
      carl9170: fix virtual interface setup crash
      carl9170: fix init-self regression

Daniel Drake (1):
      libertas: don't block usb8388 suspend if no wakeup conditions are set

Daniel Klaffenbach (1):
      ssb: b43-pci-bridge: Add new vendor for BCM4318

Deepak Saxena (1):
      libertas: EHS_REMOVE_WAKEUP is not always supported

Felix Fietkau (36):
      ath9k: remove the unnecessary private xretry tx flag
      ath9k: handle tx underrun in the driver instead of rate control
      ath9k: remove the tx info padding byte abuse
      ath9k: clean up tx buffer setup
      ath9k_hw: add a private op for configuring radar pulse detection
      cfg80211: add support for setting the ad-hoc multicast rate
      mac80211: add support for setting the ad-hoc multicast rate
      ath9k_hw: set default values for radar pulse detection
      ath9k: fix PA predistortion training frame setup
      ath9k: remove bfs_seqno from struct ath_buf_state
      ath9k: remove bfs_tidno from struct ath_buf_state
      ath9k: remove bfs_keytype from struct ath_buf_state
      ath9k: remove bfs_paprd_timestamp from struct ath_buf_state
      ath9k: remove bfs_keyix from struct ath_buf_state
      ath9k: remove bfs_al from struct ath_buf_state
      ath9k: remove bfs_nframes from struct ath_buf_state
      ath9k: remove bfs_frmlen from struct ath_buf_state
      ath9k: remove bf_tx_aborted from struct ath_buf
      ath9k: clean up code duplication around ath_tx_start
      ath9k: block new AMPDU sessions if SC_OP_TXAGGR is not set
      ath9k: more tx setup cleanups
      ath9k: store frame information used by aggregation inside the skb tx info
      ath9k_hw: add support for reading EEPROM data from the internal OTP ROM
      ath9k: add support for reading eeprom from platform data on PCI devices
      ath9k_hw: support reading calibration data from flash on AR9003
      ath9k: fix timeout on stopping rx dma
      ath9k: fix recursive locking in the tx flush path
      ath9k_hw: fix A-MPDU key search issues on AR9003
      ath9k_htc: fix eeprom access
      mac80211: restart beacon miss timer on system resume from suspend
      mac80211: calculate beacon loss time accurately
      mac80211: probe the AP when resuming
      cfg80211/mac80211: improve ad-hoc multicast rate handling
      mac80211: use nullfunc instead of probe request for connection monitoring
      mac80211: reduce the number of retries for nullfunc probing
      ath9k_hw: remove ath9k_hw_stoppcurecv

Gertjan van Wingerde (5):
      rt2x00: Add initial support for RT3370/RT3390 devices.
      rt2x00: Clean up Kconfig for RT2800 devices.
      rt2x00: Remove RT30XX Kconfig variables.
      rt2x00: Remove unneccessary internal Kconfig symbols.
      rt2x00: Use ioremap for SoC devices instead of KSEG1ADDR.

Gery Kahn (1):
      wl1271: cleanup unused code of calibration structures

Guennadi Liakhovetski (1):
      wireless: b43: fix error path in SDIO

Helmut Schaa (1):
      mac80211: Disable hw crypto for GTKs on AP VLAN interfaces

Huang Weiyi (1):
      libertas: remove duplicated #include

Ivo van Doorn (1):
      rt2x00: Increase REGISTER_BUSY_COUNT

Joe Perches (16):
      drivers/net/wireless/ath/debug.c: Use printf extension %pV
      drivers/net/wireless/b43/main.c: Use printf extension %pV
      drivers/net/wireless/b43legacy/main.c: Use printf extension %pV
      ar9170: Use const
      ath5k: Use static const
      ath9k: Use static const
      carl9170: Use static const
      atmel: Use static const
      b43: Use static const
      iwlwifi: Use static const
      libertas: Use static const
      ray_cs: Use static const
      rndis_wlan: Use static const
      rt2x00: Use static const
      zd1211rw: Use const
      net/wireless: Use pr_<level> and netdev_<level>

Johannes Berg (14):
      iwlagn: fix some naming regarding FIFOs
      iwlagn: remove unused variable swq_id
      iwlagn: remove a bogus AGG_OFF check
      iwlwifi: pass txq to wake/stop queue
      iwlwifi: always build swq_id as virtual queue ID
      iwlagn: fix PAN queues
      iwlagn: avoid crash if vif is not assigned
      iwlagn: reprogram AP STA after assoc
      iwlagn: fix PAN slot timing wrt. DTIM
      mac80211: defines for AC numbers
      mac80211: fix powersaving clients races
      iwlwifi: fix modular 3945 only build
      cfg80211: allow using CQM event to notify packet loss
      mac80211: implement packet loss notification

John W. Linville (6):
      iwmc3200wifi: clarify potentially undefined operation in iwm_scan_ssids
      rndis_wlan: avoid uninitialized var warning in rndis_wlan_craft_connected_bss
      Merge branch 'wireless-next-2.6' of git://git.kernel.org/.../iwlwifi/iwlwifi-2.6
      Revert "nl80211/mac80211: Report signal average"
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next-2.6 into for-davem

Jussi Kivilinna (2):
      rndis_wlan: workaround device not returning bss for currently connected AP
      rndis_wlan: workaround poor scanning with BCM4320a

Juuso Oikarinen (4):
      mac80211: Add function to get probe request template for current AP
      wl1271: Prevent ad-hoc and active scanning on 11a DFS frequencies
      Revert "wl1271: Change supported channel order for a more optimal scan"
      wl12xx: Unset bssid filter, ssid and bssid from firmware on disassoc

Luis R. Rodriguez (6):
      cfg80211: put core regulatory request into queue
      cfg80211: move reg_work and reg_todo above
      cfg80211: move mutex locking to reg_process_pending_hints()
      cfg80211: Fix regulatory bug with multiple cards and delays
      ath9k: avoid aggregation for VO traffic
      mac80211: avoid aggregation for VO traffic

Mohammed Shafi Shajakhan (1):
      ath9k_htc: Use macro for caldata array size

Nishant Sarmukadam (1):
      mwl8k: rf_tx_power cmd not supported by AP firmware APIv1

RA-Jay Hung (3):
      rt2x00: Fix rt2800 USB TX Path DMA issue
      rt2x00: Fix header_length in rt2x00lib_txdone
      rt2x00: Modify rt2x00queue_remove_l2pad to make skb->data two-byte alignment

Rafał Miłecki (12):
      ssb: workarounds: be verbose about hacking SPROM revision, don't duplicate code
      ssb: return -ENOMEM on alloc fail (instead of CRC check's result)
      ssb: drop BCM4328 hack for SPROM revision
      b43: N-PHY: add 2056 radio channels tables
      b43: rfkill: use HI enabled bit for all devices
      b43: N-PHY: fix values for PHY regs in channel tables of 2055 radio
      b43: N-PHY: minor fixes to match specs
      b43: N-PHY: fix some typos, conditions, set gain_boost
      b43: N-PHY: init BPHY when needed
      b43: N-PHY: fix BPHY init
      b43: N-PHY: rev2: save and restore PHY regs on RSSI poll
      b43: N-PHY: little cleanups

Rajkumar Manoharan (4):
      ath: Add a driver_info bitmask field
      ath9k_htc: Add driver_info in usb device list
      ath9k_hw: Fix eeprom offset for AR9287 devices (PCI/USB)
      ath9k_htc: Identify devices using driver_info

Senthil Balasubramanian (6):
      ath9k_hw: Fix a reset failure on AR9382 (2x2).
      ath9k_hw: Add new member into the eeprom structure.
      ath9k_hw: Initialize 2GHz CTL properly.
      ath9k_hw: Fix paprd training frame failure.
      ath9k_hw: add eeprom templates for ar9003 family chipsets
      ath9k_hw: Fix low throughput issue with AR93xx

Shahar Levi (1):
      wl1271: Change wl12xx Files Names

Shanyu Zhao (2):
      iwlagn: update QoS before commit associated RXON
      iwlagn: check change before commit RXON cmd

Stanislaw Gruszka (3):
      iwl3945: remove unused len_org variable
      iwlagn: simplify iwlagn_tx_skb
      iwlwifi: kill elapsed_jiffies

Vasanthakumar Thiagarajan (5):
      ath9k_hw: Fix XPABIAS level configuration for AR9003
      ath9k_hw: Enable strong signal detection for AR9003
      ath9k_hw: Improve power control accuracy for AR9003
      ath9k_hw: Add helper function for interpolation
      ath9k: Fix bug in delimiter padding computation

Wey-Yi Guy (12):
      iwlagn: used frame count info in compressed ba packet
      iwlagn: set dynamic aggregation threshold for BT
      iwlagn: support dynamic aggregation for BT coex
      iwlagn: change default ACK/CTS MASK setting for WiFi/BT coex
      iwlwifi: change default led mode for different devices
      iwlagn: use SKU information in the EEPROM
      iwlwifi: set STATUS_READY before commit_rxon
      iwlagn: name change for BT config flag
      iwlwifi: add more power management flags
      iwlwifi: consider BT for power management
      iwlwifi: power management checking for shadow register
      iwlwifi: advance power management support

 drivers/net/wireless/ath/ar9170/cmd.c              |    2 +-
 drivers/net/wireless/ath/ath.h                     |    6 +
 drivers/net/wireless/ath/ath5k/Kconfig             |    1 +
 drivers/net/wireless/ath/ath5k/ani.c               |   38 +-
 drivers/net/wireless/ath/ath5k/ath5k.h             |   26 +-
 drivers/net/wireless/ath/ath5k/base.c              |   50 +-
 drivers/net/wireless/ath/ath5k/debug.c             |    2 +-
 drivers/net/wireless/ath/ath9k/ani.c               |    8 +-
 drivers/net/wireless/ath/ath9k/ar5008_phy.c        |   79 +-
 drivers/net/wireless/ath/ath9k/ar9002_phy.c        |   12 +-
 drivers/net/wireless/ath/ath9k/ar9003_calib.c      |   27 +-
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c     | 2758 +++++++++-
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h     |   27 +-
 drivers/net/wireless/ath/ath9k/ar9003_mac.c        |   28 +-
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c      |    4 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c        |   51 +-
 drivers/net/wireless/ath/ath9k/ath9k.h             |   42 +-
 drivers/net/wireless/ath/ath9k/beacon.c            |   19 +
 drivers/net/wireless/ath/ath9k/eeprom_4k.c         |   12 +-
 drivers/net/wireless/ath/ath9k/eeprom_9287.c       |   20 +-
 drivers/net/wireless/ath/ath9k/eeprom_def.c        |   17 +-
 drivers/net/wireless/ath/ath9k/hif_usb.c           |   61 +-
 drivers/net/wireless/ath/ath9k/htc.h               |    4 +-
 drivers/net/wireless/ath/ath9k/htc_drv_init.c      |   38 +-
 drivers/net/wireless/ath/ath9k/htc_hst.c           |    5 +-
 drivers/net/wireless/ath/ath9k/htc_hst.h           |    3 +-
 drivers/net/wireless/ath/ath9k/hw.c                |   20 +-
 drivers/net/wireless/ath/ath9k/hw.h                |   41 +
 drivers/net/wireless/ath/ath9k/init.c              |    3 +
 drivers/net/wireless/ath/ath9k/mac.c               |    8 -
 drivers/net/wireless/ath/ath9k/mac.h               |    1 -
 drivers/net/wireless/ath/ath9k/main.c              |   30 +-
 drivers/net/wireless/ath/ath9k/pci.c               |   42 +-
 drivers/net/wireless/ath/ath9k/rc.c                |   29 +-
 drivers/net/wireless/ath/ath9k/rc.h                |    6 -
 drivers/net/wireless/ath/ath9k/recv.c              |    2 +-
 drivers/net/wireless/ath/ath9k/reg.h               |   14 +-
 drivers/net/wireless/ath/ath9k/virtual.c           |    5 +-
 drivers/net/wireless/ath/ath9k/xmit.c              |  631 +--
 drivers/net/wireless/ath/carl9170/cmd.c            |    2 +-
 drivers/net/wireless/ath/carl9170/main.c           |    2 +-
 drivers/net/wireless/ath/carl9170/tx.c             |    2 +-
 drivers/net/wireless/ath/debug.c                   |    9 +-
 drivers/net/wireless/atmel.c                       |    6 +-
 drivers/net/wireless/b43/main.c                    |   48 +-
 drivers/net/wireless/b43/phy_common.c              |    8 +-
 drivers/net/wireless/b43/phy_n.c                   |   86 +-
 drivers/net/wireless/b43/radio_2055.c              |  248 +-
 drivers/net/wireless/b43/radio_2056.c              | 5968 ++++++++++++++++++++
 drivers/net/wireless/b43/rfkill.c                  |   19 +-
 drivers/net/wireless/b43/sdio.c                    |    1 +
 drivers/net/wireless/b43legacy/main.c              |   47 +-
 drivers/net/wireless/iwlwifi/Makefile              |    4 +
 drivers/net/wireless/iwlwifi/iwl-1000.c            |    8 +-
 drivers/net/wireless/iwlwifi/iwl-3945.c            |    6 +-
 drivers/net/wireless/iwlwifi/iwl-4965.c            |   13 +-
 drivers/net/wireless/iwlwifi/iwl-5000.c            |   14 +-
 drivers/net/wireless/iwlwifi/iwl-6000.c            |   46 +-
 drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c      |   21 +
 drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c        |    5 +-
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c         |   27 +-
 drivers/net/wireless/iwlwifi/iwl-agn-rs.c          |   32 +-
 drivers/net/wireless/iwlwifi/iwl-agn-rxon.c        |  103 +-
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c          |  110 +-
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c       |   65 +-
 drivers/net/wireless/iwlwifi/iwl-agn.c             |   11 +-
 drivers/net/wireless/iwlwifi/iwl-commands.h        |   25 +-
 drivers/net/wireless/iwlwifi/iwl-core.c            |    2 +-
 drivers/net/wireless/iwlwifi/iwl-core.h            |   11 +-
 drivers/net/wireless/iwlwifi/iwl-debugfs.c         |    9 +-
 drivers/net/wireless/iwlwifi/iwl-dev.h             |    3 +-
 drivers/net/wireless/iwlwifi/iwl-eeprom.h          |   12 +-
 drivers/net/wireless/iwlwifi/iwl-helpers.h         |   45 +-
 drivers/net/wireless/iwlwifi/iwl-led.c             |   10 +-
 drivers/net/wireless/iwlwifi/iwl-led.h             |    6 +-
 drivers/net/wireless/iwlwifi/iwl-power.c           |   95 +-
 drivers/net/wireless/iwlwifi/iwl-scan.c            |    3 +-
 drivers/net/wireless/iwlwifi/iwl-sta.c             |   51 +-
 drivers/net/wireless/iwlwifi/iwl-sta.h             |    1 +
 drivers/net/wireless/iwlwifi/iwl-tx.c              |   11 +-
 drivers/net/wireless/iwlwifi/iwl3945-base.c        |   11 +-
 drivers/net/wireless/iwmc3200wifi/commands.c       |    2 +-
 drivers/net/wireless/libertas/cfg.c                |    4 +-
 drivers/net/wireless/libertas/cmd.c                |    8 +
 drivers/net/wireless/libertas/dev.h                |    1 +
 drivers/net/wireless/libertas/if_usb.c             |   13 +-
 drivers/net/wireless/libertas/main.c               |    3 +-
 drivers/net/wireless/libertas/rx.c                 |    4 +-
 drivers/net/wireless/mwl8k.c                       |  677 ++-
 drivers/net/wireless/ray_cs.c                      |    4 +-
 drivers/net/wireless/rndis_wlan.c                  |  206 +-
 drivers/net/wireless/rt2x00/Kconfig                |   72 +-
 drivers/net/wireless/rt2x00/rt2800.h               |    1 +
 drivers/net/wireless/rt2x00/rt2800lib.c            |   11 +-
 drivers/net/wireless/rt2x00/rt2800pci.c            |   49 +-
 drivers/net/wireless/rt2x00/rt2800usb.c            |  212 +-
 drivers/net/wireless/rt2x00/rt2x00.h               |    2 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c            |    8 +-
 drivers/net/wireless/rt2x00/rt2x00queue.c          |    6 +-
 drivers/net/wireless/rt2x00/rt2x00soc.c            |    6 +-
 drivers/net/wireless/wl12xx/Kconfig                |   52 +-
 drivers/net/wireless/wl12xx/Makefile               |   17 +-
 .../net/wireless/wl12xx/{wl1271_acx.c => acx.c}    |   12 +-
 .../net/wireless/wl12xx/{wl1271_acx.h => acx.h}    |   10 +-
 .../net/wireless/wl12xx/{wl1271_boot.c => boot.c}  |   10 +-
 .../net/wireless/wl12xx/{wl1271_boot.h => boot.h}  |    2 +-
 .../net/wireless/wl12xx/{wl1271_cmd.c => cmd.c}    |   12 +-
 .../net/wireless/wl12xx/{wl1271_cmd.h => cmd.h}    |   54 +-
 .../net/wireless/wl12xx/{wl1271_conf.h => conf.h}  |    4 +-
 .../wl12xx/{wl1271_debugfs.c => debugfs.c}         |   10 +-
 .../wl12xx/{wl1271_debugfs.h => debugfs.h}         |    6 +-
 .../wireless/wl12xx/{wl1271_event.c => event.c}    |   12 +-
 .../wireless/wl12xx/{wl1271_event.h => event.h}    |    4 +-
 .../net/wireless/wl12xx/{wl1271_ini.h => ini.h}    |    4 +-
 .../net/wireless/wl12xx/{wl1271_init.c => init.c}  |   10 +-
 .../net/wireless/wl12xx/{wl1271_init.h => init.h}  |    6 +-
 drivers/net/wireless/wl12xx/{wl1271_io.c => io.c}  |    4 +-
 drivers/net/wireless/wl12xx/{wl1271_io.h => io.h}  |    6 +-
 .../net/wireless/wl12xx/{wl1271_main.c => main.c}  |  183 +-
 drivers/net/wireless/wl12xx/{wl1271_ps.c => ps.c}  |    6 +-
 drivers/net/wireless/wl12xx/{wl1271_ps.h => ps.h}  |    8 +-
 .../net/wireless/wl12xx/{wl1271_reg.h => reg.h}    |    0
 drivers/net/wireless/wl12xx/{wl1271_rx.c => rx.c}  |   12 +-
 drivers/net/wireless/wl12xx/{wl1271_rx.h => rx.h}  |    4 +-
 .../net/wireless/wl12xx/{wl1271_scan.c => scan.c}  |    8 +-
 .../net/wireless/wl12xx/{wl1271_scan.h => scan.h}  |    6 +-
 .../net/wireless/wl12xx/{wl1271_sdio.c => sdio.c}  |    4 +-
 .../net/wireless/wl12xx/{wl1271_spi.c => spi.c}    |    6 +-
 .../wl12xx/{wl1271_testmode.c => testmode.c}       |    6 +-
 .../wl12xx/{wl1271_testmode.h => testmode.h}       |    4 +-
 drivers/net/wireless/wl12xx/{wl1271_tx.c => tx.c}  |   12 +-
 drivers/net/wireless/wl12xx/{wl1271_tx.h => tx.h}  |    4 +-
 drivers/net/wireless/wl12xx/{wl1271.h => wl12xx.h} |    8 +-
 drivers/net/wireless/zd1211rw/zd_chip.c            |    4 +-
 drivers/ssb/b43_pci_bridge.c                       |    1 +
 drivers/ssb/pci.c                                  |   52 +-
 include/linux/average.h                            |   32 +
 include/linux/nl80211.h                            |   32 +
 include/linux/pci_ids.h                            |    1 +
 include/net/cfg80211.h                             |   17 +
 include/net/mac80211.h                             |   50 +-
 include/net/regulatory.h                           |    7 +
 lib/Kconfig                                        |    3 +
 lib/Makefile                                       |    2 +
 lib/average.c                                      |   57 +
 net/mac80211/cfg.c                                 |   26 +
 net/mac80211/driver-ops.h                          |   37 +
 net/mac80211/driver-trace.h                        |   71 +
 net/mac80211/ibss.c                                |    2 +
 net/mac80211/ieee80211_i.h                         |   10 +
 net/mac80211/key.c                                 |    9 +-
 net/mac80211/mlme.c                                |  143 +-
 net/mac80211/rate.c                                |   18 +-
 net/mac80211/rc80211_minstrel_ht.c                 |    3 +
 net/mac80211/rx.c                                  |    2 -
 net/mac80211/sta_info.c                            |   17 +-
 net/mac80211/sta_info.h                            |    3 +
 net/mac80211/status.c                              |   26 +
 net/mac80211/tx.c                                  |   16 +-
 net/mac80211/util.c                                |   40 +-
 net/mac80211/wme.c                                 |   11 +-
 net/wireless/core.c                                |    8 +-
 net/wireless/lib80211.c                            |    8 +-
 net/wireless/lib80211_crypt_tkip.c                 |   16 +-
 net/wireless/mlme.c                                |   12 +
 net/wireless/nl80211.c                             |  111 +-
 net/wireless/nl80211.h                             |    4 +
 net/wireless/reg.c                                 |  127 +-
 net/wireless/util.c                                |   11 +-
 net/wireless/wext-core.c                           |   10 +-
 170 files changed, 12136 insertions(+), 2036 deletions(-)
 rename drivers/net/wireless/wl12xx/{wl1271_acx.c => acx.c} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271_acx.h => acx.h} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271_boot.c => boot.c} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271_boot.h => boot.h} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_cmd.c => cmd.c} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271_cmd.h => cmd.h} (91%)
 rename drivers/net/wireless/wl12xx/{wl1271_conf.h => conf.h} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271_debugfs.c => debugfs.c} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271_debugfs.h => debugfs.h} (93%)
 rename drivers/net/wireless/wl12xx/{wl1271_event.c => event.c} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_event.h => event.h} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_ini.h => ini.h} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_init.c => init.c} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_init.h => init.h} (93%)
 rename drivers/net/wireless/wl12xx/{wl1271_io.c => io.c} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271_io.h => io.h} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_main.c => main.c} (97%)
 rename drivers/net/wireless/wl12xx/{wl1271_ps.c => ps.c} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_ps.h => ps.h} (92%)
 rename drivers/net/wireless/wl12xx/{wl1271_reg.h => reg.h} (100%)
 rename drivers/net/wireless/wl12xx/{wl1271_rx.c => rx.c} (97%)
 rename drivers/net/wireless/wl12xx/{wl1271_rx.h => rx.h} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_scan.c => scan.c} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_scan.h => scan.h} (97%)
 rename drivers/net/wireless/wl12xx/{wl1271_sdio.c => sdio.c} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271_spi.c => spi.c} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271_testmode.c => testmode.c} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_testmode.h => testmode.h} (93%)
 rename drivers/net/wireless/wl12xx/{wl1271_tx.c => tx.c} (98%)
 rename drivers/net/wireless/wl12xx/{wl1271_tx.h => tx.h} (99%)
 rename drivers/net/wireless/wl12xx/{wl1271.h => wl12xx.h} (99%)
 create mode 100644 include/linux/average.h
 create mode 100644 lib/average.c

Omnibus patch is available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2010-11-29.patch.bz2

-- 
John W. Linville		Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org			might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2010-11-29 19:15 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


1) Two fixes for some exploitable cases in AF_UNIX file descriptor
   passing.  Both from Eric Dumazet.

2) DECnet uninitialized data to userspace fix from Dan Rosenberg.

3) Unit allocation passes incorrect error back to userspace, fix
   from Cyrill Gorcunov.

4) Inet port binding optimization maintains it's counters
   erroneously, fix from Nagendra Tomar.

5) Three econet CVE fixes from Phil Blundell.

6) ucc_geth halts in half-duplex due to over-aggressive fifo
   size setting, fix from Yang Li.

7) mcast/ucast Address handling fix in cxgb4vf from Casey Leedom.

8) tcp_adv_win_scale can cause undefined behavior if the
   abos() of it's value is >31 since it is used in shifts.
   Fix from Alexey Dobriyan

9) Regression in au1000_eth MAC enable register accesses, fix
   from Wolfgang Grandegger.

10) Struct initializer fix in pch_gbe from Toshiharu Okada.

11) Stack corruption bug in isdn icn driver from Steven Rostedt.

12) DCCP ACK tracking fix from Gerrit Renker.

13) HSO driver does not honor disable_net setting, from Filip Aben.

14) ath9k wireless timeout fix from Felix Fietkau.

Please pull, thanks a lot!

The following changes since commit 72083646528d4887b920deb71b37e09bc7d227bb:

  Un-inline get_pipe_info() helper function (2010-11-28 16:27:19 -0800)

are available in the git repository at:
  master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master

Alexey Dobriyan (1):
      tcp: restrict net.ipv4.tcp_adv_win_scale (#20312)

Breno Leitao (1):
      ehea: Add some info messages and fix an issue

Casey Leedom (1):
      cxgb4vf: fix setting unicast/multicast addresses ...

Christian Lamparter (1):
      carl9170: fix virtual interface setup crash

Cyrill Gorcunov (1):
      net, ppp: Report correct error code if unit allocation failed

Dan Rosenberg (1):
      DECnet: don't leak uninitialized stack byte

Daniel Klaffenbach (1):
      ssb: b43-pci-bridge: Add new vendor for BCM4318

David S. Miller (3):
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
      tcp: Make TCP_MAXSEG minimum more correct.
      Merge branch 'vhost-net' of git://git.kernel.org/.../mst/vhost

Eric Dumazet (2):
      af_unix: limit unix_tot_inflight
      af_unix: limit recursion level

Felix Fietkau (1):
      ath9k: fix timeout on stopping rx dma

Filip Aben (1):
      hso: fix disable_net

Gerrit Renker (1):
      dccp: fix error in updating the GAR

Guennadi Liakhovetski (1):
      wireless: b43: fix error path in SDIO

Jiri Slaby (1):
      NET: wan/x25_asy, move lapb_unregister to x25_asy_close_tty

Michael S. Tsirkin (1):
      vhost/net: fix rcu check usage

Nagendra Tomar (1):
      inet: Fix __inet_inherit_port() to correctly increment bsockets and num_owners

Pavel Emelyanov (1):
      netns: Don't leak others' openreq-s in proc

Phil Blundell (3):
      econet: disallow NULL remote addr for sendmsg(), fixes CVE-2010-3849
      econet: fix CVE-2010-3850
      econet: fix CVE-2010-3848

Steven Rostedt (1):
      isdn: icn: Fix stack corruption bug.

Toshiharu Okada (2):
      pch_gbe dreiver: chang author
      pch_gbe driver: The wrong of initializer entry

Tracey Dent (1):
      Net: ceph: Makefile: Remove unnessary code

Wolfgang Grandegger (1):
      au1000_eth: fix invalid address accessing the MAC enable register

Yang Li (1):
      ucc_geth: fix ucc halt problem in half duplex mode

 Documentation/networking/ip-sysctl.txt   |    1 +
 drivers/isdn/icn/icn.c                   |    7 +-
 drivers/net/Kconfig                      |    6 +-
 drivers/net/au1000_eth.c                 |   10 ++--
 drivers/net/cxgb4vf/cxgb4vf_main.c       |   73 ++++++++++++++---------
 drivers/net/cxgb4vf/t4vf_hw.c            |   96 +++++++++++++++++++-----------
 drivers/net/ehea/ehea_main.c             |   18 ++++-
 drivers/net/pch_gbe/pch_gbe_main.c       |    6 +-
 drivers/net/pch_gbe/pch_gbe_param.c      |    8 +-
 drivers/net/ppp_generic.c                |   43 +++++++-------
 drivers/net/ucc_geth.h                   |    3 +-
 drivers/net/usb/hso.c                    |   10 ++-
 drivers/net/wan/x25_asy.c                |   11 ++--
 drivers/net/wireless/ath/ath9k/recv.c    |    2 +-
 drivers/net/wireless/ath/carl9170/main.c |    2 +-
 drivers/net/wireless/b43/sdio.c          |    1 +
 drivers/ssb/b43_pci_bridge.c             |    1 +
 drivers/vhost/net.c                      |    5 +-
 include/linux/pci_ids.h                  |    1 +
 include/net/af_unix.h                    |    2 +
 net/ceph/Makefile                        |   22 -------
 net/dccp/input.c                         |    3 +-
 net/decnet/af_decnet.c                   |    2 +
 net/econet/af_econet.c                   |   91 +++++++++++++---------------
 net/ipv4/inet_hashtables.c               |    3 +-
 net/ipv4/sysctl_net_ipv4.c               |    6 ++-
 net/ipv4/tcp.c                           |    2 +-
 net/ipv4/tcp_ipv4.c                      |    4 +-
 net/unix/af_unix.c                       |   37 ++++++++++--
 net/unix/garbage.c                       |    9 +++-
 30 files changed, 281 insertions(+), 204 deletions(-)

^ permalink raw reply

* Re: [net-next-2.6] XFRM: remove unused member in xfrm_encap_tmpl.
From: David Shwatrz @ 2010-11-29 19:15 UTC (permalink / raw)
  To: Timo Teräs; +Cc: David S. Miller, netdev
In-Reply-To: <4CF3EBF2.5060308@iki.fi>

Hi,
Thanks, Timo.

But isn't something wrong here ?

According to RFC 3948:
...
3.1.2.  Transport Mode Decapsulation NAT Procedure

When a transport mode has been used to transmit packets, contained
   TCP or UDP headers will have incorrect checksums due to the change of
   parts of the IP header during transit.  This procedure defines how to
   fix these checksums
...
incrementally recompute the
       TCP/UDP checksum:

       *  Subtract the IP source address in the received packet from the
          checksum.
       *  Add the real IP source address received via IKE to the
          checksum (obtained from the NAT-OA)
...

So where do we pass the NAT-OA, received from IKE messages,  to this
checksum recalculation process, which should be done in the kernel
(layer 4 TCP/UDP I suppose) ?

Should'nt this process be done in the kernel ?

Isn't there something missing here ?

Rgs,
DS

2010/11/29 Timo Teräs <timo.teras@iki.fi>:
> On 01/-10/-28163 09:59 PM, David Shwatrz wrote:
>> Hi,
>>  The patch removes unused member in xfrm_encap_tmpl.
>>
>> Regards,
>> David Shwartz
>>
>>
>> Signed-off-by: David Shwartz <dshwatrz@gmail.com>
>>
>>
>> diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
>> index b971e38..7312707 100644
>> --- a/include/linux/xfrm.h
>> +++ b/include/linux/xfrm.h
>> @@ -235,7 +235,6 @@ struct xfrm_encap_tmpl {
>>       __u16           encap_type;
>>       __be16          encap_sport;
>>       __be16          encap_dport;
>> -     xfrm_address_t  encap_oa;
>>  };
>>
>>  /* AEVENT flags  */
>
> struct xfrm_encap_tmpl is exposed to userland via netlink. This would
> break ABI.
>

^ permalink raw reply

* 2.6.35 -> 2.6.36 panic when vlan and promisc with tg3
From: Michael Leun @ 2010-11-29 19:17 UTC (permalink / raw)
  To: linux-kernel, netdev

Hi,

only kernel message I was able to capture on serial were:

UG: unable to handle kernel paging request at 01cc921c
IP: [<c034bfce>] vlan_hwaccel_do_receive+0x59/0xd0
*pdpt = 0000000036a2a001 *pde = 0000000000000000
Oops: 0002 [#1] SMP
last sysfs

Then machine dead.

In 2.6.35.x this did not happen (but vlans broken - cannot see vlan
tags with tcpdump),

To reproduce:

ip link set eth0 up
vconfig add eth0 2
ip link set eth0 promisc on

Machines with these ethernet cards I've seen to be affected:

Ethernet controller: Broadcom Corporation NetXtreme BCM5714 Gigabit
Ethernet (rev a3)

Ethernet controller: Broadcom Corporation NetXtreme BCM5752M Gigabit
Ethernet PCI Express (rev 02)

Machine with this card is NOT affected (no vlan hw accel?):

Ethernet controller: Broadcom Corporation NetLink BCM5906M Fast
Ethernet PCI Express (rev 02)


-- 
MfG,

Michael Leun

^ permalink raw reply

* Re: inet_hash_connect: source port allocation
From: Eric Dumazet @ 2010-11-29 19:21 UTC (permalink / raw)
  To: John Haxby; +Cc: NetDev, Stephen Hemminger
In-Reply-To: <1291057655.3435.1363.camel@edumazet-laptop>

Le lundi 29 novembre 2010 à 20:07 +0100, Eric Dumazet a écrit :
> Le lundi 29 novembre 2010 à 19:46 +0100, Eric Dumazet a écrit :
> > Le lundi 29 novembre 2010 à 18:29 +0000, John Haxby a écrit :
> > 
> > > Sorry,  I think I phrased my question badly.
> > > 
> > > inet_csk_get_port() starts its search for a free port with
> > > 
> > >      smallest_rover = rover = net_random() % remaining + low;
> > > 
> > > whereas __inet_hash_connect() basically misses out that call to 
> > > net_random() so you get a predictable port number.
> > > 
> > > Is there any good reason why that is the case?
> > > 
> > 
> > It seems random select was done at bind() time only in commit
> > 6df716340da3a6f ([TCP/DCCP]: Randomize port selection)
> > 
> > It probably should be done in autobind too.
> > 
> > 
> 
> I'll test following patch :

Oh well, forget this, there is something about inet_sk_port_offset()
using secure_ipv4_port_ephemeral()

We want to avoid reusing same port too fast.

http://www.tcpipguide.com/free/t_TCPIPClientEphemeralPortsandClientServerApplicatio-2.htm

Port is predictable only for same destination, and if no other
connections are attempted by other threads.




^ permalink raw reply

* Re: pull request: wireless-next-2.6 2010-11-29
From: David Miller @ 2010-11-29 19:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20101129191352.GB8199@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 29 Nov 2010 14:13:52 -0500

> Between celebrating my birthday and the Thanksgiving holiday, this pull
> request is a bit bigger than usual...sorry!

Hey another November boy :-)

> For the most part, this is the usual stuff -- driver updates and the
> like.  mwl8k, wl1271, ath9k, carl9170, rt2x00, b43, and iwlwifi all get
> significant attention, along with a smattering of others.  mac80211 gets
> a variety of updates as well.
> 
> This includes the movement of an EWMA library to lib for general use.
> Also included is some file renaming for drivers/net/wireless/wl12xx.
> 
> Please let me know if there are problems!

Pulled, thanks!

^ permalink raw reply

* Re: [net-next-2.6] XFRM: remove unused member in xfrm_encap_tmpl.
From: Timo Teräs @ 2010-11-29 19:27 UTC (permalink / raw)
  To: David Shwatrz; +Cc: David S. Miller, netdev
In-Reply-To: <AANLkTinQ1qbp9SyWgw7TdvH=5x_1AA6zqLkaa7c4PBGQ@mail.gmail.com>

On 11/29/2010 09:15 PM, David Shwatrz wrote:
> But isn't something wrong here ?
> 
> According to RFC 3948:
> ...
> 3.1.2.  Transport Mode Decapsulation NAT Procedure
> 
> When a transport mode has been used to transmit packets, contained
>    TCP or UDP headers will have incorrect checksums due to the change of
>    parts of the IP header during transit.  This procedure defines how to
>    fix these checksums
> ...
> incrementally recompute the
>        TCP/UDP checksum:
> 
>        *  Subtract the IP source address in the received packet from the
>           checksum.
>        *  Add the real IP source address received via IKE to the
>           checksum (obtained from the NAT-OA)
> ...
> 
> So where do we pass the NAT-OA, received from IKE messages,  to this
> checksum recalculation process, which should be done in the kernel
> (layer 4 TCP/UDP I suppose) ?
> 
> Should'nt this process be done in the kernel ?
> 
> Isn't there something missing here ?

That's what the field was intended for. Also it's passed around by e.g.
'ip xfrm' command. The header change would break compilation of iproute2
too.

Alternatively the other RFCs say that the checksum can be just
recalculated. That's what the linux stack does: it throws the old
checksum away (ignored on local receive and recalculated on send /
forward paths). The ESP/AH packets are usually also configured to
contain a cryptographic hash, so the packet modifications are detected
even before trying to check the TCP/UDP checksum (making the check
redundant).

There's also probably some legacy reasons why the nat-oa field is useful
in kernel; and why the tcp/udp is not updated according the above
mentioned scheme. I guess doing that might speed up forwarding from one
tunnel to another where hardware checksum acceleration is not available;
maybe no one just had the time to implement it.

- Timo

^ permalink raw reply

* Re: inet_hash_connect: source port allocation
From: Stephen Hemminger @ 2010-11-29 19:38 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: John Haxby, NetDev
In-Reply-To: <1291057655.3435.1363.camel@edumazet-laptop>

On Mon, 29 Nov 2010 20:07:35 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Le lundi 29 novembre 2010 à 19:46 +0100, Eric Dumazet a écrit :
> > Le lundi 29 novembre 2010 à 18:29 +0000, John Haxby a écrit :
> > 
> > > Sorry,  I think I phrased my question badly.
> > > 
> > > inet_csk_get_port() starts its search for a free port with
> > > 
> > >      smallest_rover = rover = net_random() % remaining + low;
> > > 
> > > whereas __inet_hash_connect() basically misses out that call to 
> > > net_random() so you get a predictable port number.
> > > 
> > > Is there any good reason why that is the case?
> > > 
> > 
> > It seems random select was done at bind() time only in commit
> > 6df716340da3a6f ([TCP/DCCP]: Randomize port selection)
> > 
> > It probably should be done in autobind too.
> > 
> > 
> 
> I'll test following patch :
> 
> diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
> index 1b344f3..65c3702 100644
> --- a/net/ipv4/inet_hashtables.c
> +++ b/net/ipv4/inet_hashtables.c
> @@ -466,20 +466,18 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
>  	int twrefcnt = 1;
>  
>  	if (!snum) {
> -		int i, remaining, low, high, port;
> -		static u32 hint;
> -		u32 offset = hint + port_offset;
> +		int remaining, low, high, port;
>  		struct hlist_node *node;
>  		struct inet_timewait_sock *tw = NULL;
>  
>  		inet_get_local_port_range(&low, &high);
>  		remaining = (high - low) + 1;
> +		port = net_random() % remaining + low;
>  
>  		local_bh_disable();
> -		for (i = 1; i <= remaining; i++) {
> -			port = low + (i + offset) % remaining;
> +		do {
>  			if (inet_is_reserved_local_port(port))
> -				continue;
> +				goto next_nolock;
>  			head = &hinfo->bhash[inet_bhashfn(net, port,
>  					hinfo->bhash_size)];
>  			spin_lock(&head->lock);
> @@ -510,16 +508,17 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
>  			tb->fastreuse = -1;
>  			goto ok;
>  
> -		next_port:
> +next_port:
>  			spin_unlock(&head->lock);
> -		}
> +next_nolock:
> +			if (++port > high)
> +				port = low;
> +		} while (--remaining > 0);
>  		local_bh_enable();
>  
>  		return -EADDRNOTAVAIL;
>  
>  ok:
> -		hint += i;
> -
>  		/* Head lock still held and bh's disabled */
>  		inet_bind_hash(sk, tb, port);
>  		if (sk_unhashed(sk)) {
> 

The original algorithm works better than uses if the port space is small
and being reused rapidly. Because the hint in the old algorithm is sequential ports
get used up sequentially.

You should look a the port randomization RFC. The earlier versions of the
RFC were better before the BSD guys started putting in their non-scalable
algorithms :-)


-- 

^ permalink raw reply

* [PATCH 3/3] ipip: add module alias for tunl0 tunnel device
From: Stephen Hemminger @ 2010-11-29 19:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20101129194746.724222156@vyatta.com>

[-- Attachment #1: ipip-alias.patch --]
[-- Type: text/plain, Size: 536 bytes --]

If ipip is built as a module the 'ip tunnel add' command would fail because
the ipip module was not being autoloaded.  Adding an alias for
the tunl0 device name cause dev_load() to autoload it when needed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/net/ipv4/ipip.c	2010-11-29 11:40:25.026277890 -0800
+++ b/net/ipv4/ipip.c	2010-11-29 11:41:05.790681069 -0800
@@ -913,3 +913,4 @@ static void __exit ipip_fini(void)
 module_init(ipip_init);
 module_exit(ipip_fini);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("tunl0");



^ permalink raw reply

* [PATCH 2/3] gre: add module alias for gre0 tunnel device
From: Stephen Hemminger @ 2010-11-29 19:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20101129194746.724222156@vyatta.com>

[-- Attachment #1: gre-alias.patch --]
[-- Type: text/plain, Size: 549 bytes --]

If gre is built as a module the 'ip tunnel add' command would fail because
the ip_gre module was not being autoloaded.  Adding an alias for
the gre0 device name cause dev_load() to autoload it when needed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/net/ipv4/ip_gre.c	2010-11-29 11:35:36.388589982 -0800
+++ b/net/ipv4/ip_gre.c	2010-11-29 11:35:46.675624021 -0800
@@ -1764,3 +1764,4 @@ module_exit(ipgre_fini);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_RTNL_LINK("gre");
 MODULE_ALIAS_RTNL_LINK("gretap");
+MODULE_ALIAS("gre0");



^ 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