Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next-2.6 3/3] bonding,ipv4,ipv6,vlan: Handle NETDEV_BONDING_FAILOVER like NETDEV_NOTIFY_PEERS
From: Brian Haley @ 2011-04-19  1:32 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Jay Vosburgh, David Miller, Andy Gospodarek, Patrick McHardy,
	netdev
In-Reply-To: <1303153792.2857.32.camel@bwh-desktop>

On 04/18/2011 03:09 PM, Ben Hutchings wrote:
> How about restoring the parameters like this:
> 
> ---
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Mon, 18 Apr 2011 19:36:48 +0100
> Subject: [PATCH net-next-2.6] ipv4,ipv6,bonding: Restore control over number of peer notifications
> 
> For backward compatibility, we should retain the module parameters and
> sysfs attributes to control the number of peer notifications
> (gratuitous ARPs and unsolicited NAs) sent after bonding failover.
> Also, it is possible for failover to take place even though the new
> active slave does not have link up, and in that case the peer
> notification should be deferred until it does.
> 
> Change ipv4 and ipv6 so they do not automatically send peer
> notifications on bonding failover.  Change the bonding driver to send
> separate NETDEV_NOTIFY_PEERS notifications when the link is up, as
> many times as requested.  Since it does not directly control which
> protocols send notifications, make num_grat_arp and num_unsol_na
> aliases for a single parameter.

Hi Ben,

I think this looks good, I'll try and get this tested here when I have
a chance, but for now I can:

Acked-by: Brian Haley <brian.haley@hp.com>

Should we just go ahead and make a new parameter for peer notification?
Compiled but untested patch below.

Thanks,

-Brian

--
Make a new bonding parameter, called num_peer_notif, to control how
many peer notifications are sent on fail-over.  Mark the old values,
num_grat_arp and num_unsol_na, as deprecated in the documentation.

Signed-off-by: Brian Haley <brian.haley@hp.com>

diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index 511b4e5..8b16beb 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -585,8 +585,15 @@ mode
 		chosen.
 
 num_grat_arp
+
+	Deprecated.  Use num_peer_notif instead.
+
 num_unsol_na
 
+	Deprecated.  Use num_peer_notif instead.
+
+num_peer_notif
+
 	Specify the number of peer notifications (gratuitous ARPs and
 	unsolicited IPv6 Neighbor Advertisements) to be issued after a
 	failover event.  As soon as the link is up on the new slave
@@ -595,7 +602,7 @@ num_unsol_na
 	each link monitor interval (arp_interval or miimon, whichever
 	is active) if the number is greater than 1.
 
-	These notifications are now generated by the ipv4 and ipv6 code
+	These notifications are now generated by the IPv4 and IPv6 code
 	and the numbers of repetitions cannot be set independently.
 
 	The valid range is 0 - 255; the default value is 1.  These options
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 956a6f7..631ca9e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -116,6 +116,8 @@ module_param_named(num_grat_arp, num_peer_notif, int, 0644);
 MODULE_PARM_DESC(num_grat_arp, "Number of peer notifications to send on failover event");
 module_param_named(num_unsol_na, num_peer_notif, int, 0644);
 MODULE_PARM_DESC(num_unsol_na, "Number of peer notifications to send on failover event");
+module_param_named(num_peer_notif, num_peer_notif, int, 0644);
+MODULE_PARM_DESC(num_unsol_na, "Number of peer notifications to send on failover event");
 module_param(miimon, int, 0);
 MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");
 module_param(updelay, int, 0);
@@ -4699,7 +4701,7 @@ static int bond_check_params(struct bond_params *params)
 	}
 
 	if (num_peer_notif < 0 || num_peer_notif > 255) {
-		pr_warning("Warning: num_grat_arp/num_unsol_na (%d) not in range 0-255 so it was reset to 1\n",
+		pr_warning("Warning: num_peer_notif (%d) not in range 0-255 so it was reset to 1\n",
 			   num_peer_notif);
 		num_peer_notif = 1;
 	}
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 58fb3e9..b03e7be 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -896,6 +896,8 @@ static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR,
 		   bonding_show_num_peer_notif, bonding_store_num_peer_notif);
 static DEVICE_ATTR(num_unsol_na, S_IRUGO | S_IWUSR,
 		   bonding_show_num_peer_notif, bonding_store_num_peer_notif);
+static DEVICE_ATTR(num_peer_notif, S_IRUGO | S_IWUSR,
+		   bonding_show_num_peer_notif, bonding_store_num_peer_notif);
 
 /*
  * Show and set the MII monitor interval.  There are two tricky bits
@@ -1598,6 +1600,7 @@ static struct attribute *per_bond_attrs[] = {
 	&dev_attr_xmit_hash_policy.attr,
 	&dev_attr_num_grat_arp.attr,
 	&dev_attr_num_unsol_na.attr,
+	&dev_attr_num_peer_notif.attr,
 	&dev_attr_miimon.attr,
 	&dev_attr_primary.attr,
 	&dev_attr_primary_reselect.attr,

^ permalink raw reply related

* Re: Network performance with small packets
From: Rusty Russell @ 2011-04-19  0:33 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: habanero, Shirley Ma, Krishna Kumar2, David Miller, kvm, netdev,
	steved, Tom Lendacky, borntraeger
In-Reply-To: <20110414160359.GA11218@redhat.com>

On Thu, 14 Apr 2011 19:03:59 +0300, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> On Thu, Apr 14, 2011 at 08:58:41PM +0930, Rusty Russell wrote:
> > They have to offer the feature, so if the have some way of allocating
> > non-page-aligned amounts of memory, they'll have to add those extra 2
> > bytes.
> > 
> > So I think it's OK...
> > Rusty.
> 
> To clarify, my concern is that we always seem to try to map
> these extra 2 bytes, which thinkably might fail?

No, if you look at the layout it's clear that there's always most of a
page left for this extra room, both in the middle and at the end.

Cheers,
Rusty.

^ permalink raw reply

* [PATCH 2.6.36 1/1] IPv6: Create temp address based on advertised network prefix
From: Glenn Wurster @ 2011-04-19  1:24 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
	James Morris, Hideaki YOSHIFUJI <yosh
  Cc: linux-kernel, dbarrera

As discussed ;Login: Volume 36, number 1, create a temporary address
by hashing a random value along with the advertised network
prefix.  This results on the temporary address changing whenever
the network prefix changes (i.e., the host changes networks), or
whenever the random value (which can be set by a user-space
application with sufficient privilege) changes.

Signed-off-by: Glenn Wurster <gwurster@scs.carleton.ca>
---
 Documentation/networking/ip-sysctl.txt |   20 ++++-
 include/linux/ipv6.h                   |    4 +
 include/net/if_inet6.h                 |    3 +
 net/ipv6/Kconfig                       |   22 +++++
 net/ipv6/addrconf.c                    |  159 
+++++++++++++++++++++++++-------
 5 files changed, 175 insertions(+), 33 deletions(-)

diff --git a/Documentation/networking/ip-sysctl.txt 
b/Documentation/networking/ip-sysctl.txt
index f350c69..b366c28 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -1128,11 +1128,18 @@ router_solicitations - INTEGER
 
 use_tempaddr - INTEGER
 	Preference for Privacy Extensions (RFC3041).
+    Bits 0 and 1:
 	  <= 0 : disable Privacy Extensions
 	  == 1 : enable Privacy Extensions, but prefer public
 	         addresses over temporary addresses.
-	  >  1 : enable Privacy Extensions and prefer temporary
+	  >= 2 : enable Privacy Extensions and prefer temporary
 	         addresses over public addresses.
+    Bit 2:
+	  == 0 : Use RFC3041 random algorithm for generating
+             temporary addresses.
+	  == 1 : Use the output of a hash based on the network prefix
+	         and random number from temp_random.
+
 	Default:  0 (for most devices)
 		 -1 (for point-to-point devices and loopback devices)
 
@@ -1144,6 +1151,17 @@ temp_prefered_lft - INTEGER
 	Preferred lifetime (in seconds) for temporary addresses.
 	Default: 86400 (1 day)
 
+temp_random - INTEGER[4]
+    Random number used as input to the hash function when
+	generating temporary addresses also based on the network
+    prefix.
+	 == 0 : Generate a new random value when a temporary address
+	        is created.  This random value replaces the 0 in
+			temp_random	
+      > 0 : A random number used as input to the hash
+
+	Default:  0
+
 max_desync_factor - INTEGER
 	Maximum value for DESYNC_FACTOR, which is a random value
 	that ensures that clients don't synchronize with each
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index e62683b..b9bd404 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -172,6 +172,9 @@ struct ipv6_devconf {
 	__s32		disable_ipv6;
 	__s32		accept_dad;
 	__s32		force_tllao;
+#ifdef CONFIG_IPV6_PRIVACY_HASH
+	__u32		temp_random[4];
+#endif
 	void		*sysctl;
 };
 
@@ -213,6 +216,7 @@ enum {
 	DEVCONF_DISABLE_IPV6,
 	DEVCONF_ACCEPT_DAD,
 	DEVCONF_FORCE_TLLAO,
+	DEVCONF_TEMP_RANDOM,
 	DEVCONF_MAX
 };
 
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index f95ff8d..99428bf 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -183,6 +183,9 @@ struct inet6_dev {
 
 #ifdef CONFIG_IPV6_PRIVACY
 	u8			rndid[8];
+#ifdef CONFIG_IPV6_PRIVACY_HASH
+	__u32       rndid_inc;
+#endif
 	struct timer_list	regen_timer;
 	struct list_head	tempaddr_list;
 #endif
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index 36d7437..c0bc79a 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -39,6 +39,28 @@ config IPV6_PRIVACY
 
 	  See <file:Documentation/networking/ip-sysctl.txt> for details.
 
+if IPV6_PRIVACY
+
+config IPV6_PRIVACY_HASH
+	bool "IPv6: Privacy Extension Hash Support"
+	select CRYPTO
+	select CRYPTO_SHA256
+	---help---
+	  Generate the pseudo-random global-scope unicast address(es) based on
+	  the output of hashing together the broadcast prefix with a random
+	  value.  The algorithm is discussed in Volume 36, Number 1 of the USENIX
+	  ;Login: publication.
+
+	  To use hash-based temorary addresses, do
+
+	         echo 6 >/proc/sys/net/ipv6/conf/all/use_tempaddr
+
+	  To modify the input to the hash, do
+
+	         echo <random> >/proc/sys/net/ipv6/conf/all/temp_random
+
+endif # if IPV6_PRIVACY
+
 config IPV6_ROUTER_PREF
 	bool "IPv6: Router Preference (RFC 4191) support"
 	---help---
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 89bcb62..4a2eaca 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -118,6 +118,7 @@ static inline void addrconf_sysctl_unregister(struct 
inet6_dev *idev)
 #endif
 
 #ifdef CONFIG_IPV6_PRIVACY
+static int __ipv6_is_invalid_rndid(const __u8 * rndid);
 static int __ipv6_regen_rndid(struct inet6_dev *idev);
 static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr 
*tmpaddr);
 static void ipv6_regen_rndid(unsigned long data);
@@ -177,6 +178,9 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
 	.temp_prefered_lft	= TEMP_PREFERRED_LIFETIME,
 	.regen_max_retry	= REGEN_MAX_RETRY,
 	.max_desync_factor	= MAX_DESYNC_FACTOR,
+#ifdef CONFIG_IPV6_PRIVACY_HASH
+	.temp_random		= { 0, 0, 0, 0 },
+#endif
 #endif
 	.max_addresses		= IPV6_MAX_ADDRESSES,
 	.accept_ra_defrtr	= 1,
@@ -211,6 +215,9 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly 
= {
 	.temp_prefered_lft	= TEMP_PREFERRED_LIFETIME,
 	.regen_max_retry	= REGEN_MAX_RETRY,
 	.max_desync_factor	= MAX_DESYNC_FACTOR,
+#ifdef CONFIG_IPV6_PRIVACY_HASH
+	.temp_random		= { 0, 0, 0, 0 },
+#endif
 #endif
 	.max_addresses		= IPV6_MAX_ADDRESSES,
 	.accept_ra_defrtr	= 1,
@@ -849,6 +856,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, 
struct inet6_ifaddr *i
 		memcpy(&addr.s6_addr[8], &ift->addr.s6_addr[8], 8);
 		spin_unlock_bh(&ift->lock);
 		tmpaddr = &addr;
+		ift = NULL;
 	} else {
 		tmpaddr = NULL;
 	}
@@ -875,17 +883,71 @@ retry:
 	}
 	in6_ifa_hold(ifp);
 	memcpy(addr.s6_addr, ifp->addr.s6_addr, 8);
-	if (__ipv6_try_regen_rndid(idev, tmpaddr) < 0) {
-		spin_unlock_bh(&ifp->lock);
-		write_unlock(&idev->lock);
-		printk(KERN_WARNING
-			"ipv6_create_tempaddr(): regeneration of randomized 
interface id failed.\n");
-		in6_ifa_put(ifp);
-		in6_dev_put(idev);
-		ret = -1;
-		goto out;
+#ifdef CONFIG_IPV6_PRIVACY_HASH
+	while (idev->cnf.use_tempaddr > 4) {
+		char hash[32];
+		__u32 temp_random[4];
+		int i;
+
+		struct hash_desc desc = { .tfm = NULL, .flags = 0 };
+		struct scatterlist sg;
+
+		BUG_ON (sizeof(temp_random) != sizeof(idev->cnf.temp_random));
+
+		for (i = 0; unlikely(idev->cnf.temp_random[i] == 0) && i < 4; i++);
+		if (unlikely(i == 4))
+			get_random_bytes(idev->cnf.temp_random, sizeof(idev-
>cnf.temp_random));
+
+		desc.tfm = crypto_alloc_hash ("sha256", 0, CRYPTO_ALG_ASYNC);
+		if (IS_ERR(desc.tfm)) {
+			idev->cnf.use_tempaddr &= 0x03;
+			printk (KERN_WARNING
+					"ipv6_create_tempaddr(): Hash unavailable, 
reverting use_tempaddr to %d.\n",
+					idev->cnf.use_tempaddr);
+			break;
+		}
+
+		BUG_ON (crypto_hash_digestsize(desc.tfm) > sizeof(hash));
+		BUG_ON (sizeof(idev->rndid) < 8);
+
+		crypto_hash_init (&desc);
+
+		sg_init_one (&sg, (u8 *)addr.s6_addr, 8);
+		crypto_hash_update (&desc, &sg, 8);
+
+		memcpy (temp_random, idev->cnf.temp_random, sizeof(temp_random));
+		temp_random[3] += idev->rndid_inc;
+		sg_init_one (&sg, (u8 *)temp_random, sizeof(temp_random));
+		crypto_hash_update (&desc, &sg, sizeof(temp_random));
+
+		crypto_hash_final (&desc, hash);
+		crypto_free_hash (desc.tfm);
+
+		memcpy (&addr.s6_addr[8], hash, 8);
+		if (__ipv6_is_invalid_rndid(&addr.s6_addr[8])) {
+			idev->rndid_inc++;
+			continue;
+		}
+
+		ift = ipv6_get_ifaddr (dev_net(idev->dev), &addr, idev->dev, 0);
+		break;
+	}
+#else
+	idev->cnf.use_tempaddr &= 0x03;
+#endif
+	if (idev->cnf.use_tempaddr < 4) {
+		if (__ipv6_try_regen_rndid(idev, tmpaddr) < 0) {
+			spin_unlock_bh(&ifp->lock);
+			write_unlock(&idev->lock);
+			printk(KERN_WARNING
+				   "ipv6_create_tempaddr(): regeneration of randomized 
interface id failed.\n");
+			in6_ifa_put(ifp);
+			in6_dev_put(idev);
+			ret = -1;
+			goto out;
+		}
+		memcpy(&addr.s6_addr[8], idev->rndid, 8);
 	}
-	memcpy(&addr.s6_addr[8], idev->rndid, 8);
 	age = (jiffies - ifp->tstamp) / HZ;
 	tmp_valid_lft = min_t(__u32,
 			      ifp->valid_lft,
@@ -922,11 +984,11 @@ retry:
 	if (ifp->flags & IFA_F_OPTIMISTIC)
 		addr_flags |= IFA_F_OPTIMISTIC;
 
-	ift = !max_addresses ||
-	      ipv6_count_addresses(idev) < max_addresses ?
-		ipv6_add_addr(idev, &addr, tmp_plen,
-			      ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK,
-			      addr_flags) : NULL;
+	if (!ift && (!max_addresses || ipv6_count_addresses(idev) < 
max_addresses)) {
+		ift = ipv6_add_addr(idev, &addr, tmp_plen,
+		                    ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK,
+		                    addr_flags);
+	}
 	if (!ift || IS_ERR(ift)) {
 		in6_ifa_put(ifp);
 		in6_dev_put(idev);
@@ -943,9 +1005,11 @@ retry:
 	ift->prefered_lft = tmp_prefered_lft;
 	ift->cstamp = tmp_cstamp;
 	ift->tstamp = tmp_tstamp;
+	ift->regen_count = 0;
 	spin_unlock_bh(&ift->lock);
 
-	addrconf_dad_start(ift, 0);
+	if (ift->flags & IFA_F_TENTATIVE)
+		addrconf_dad_start(ift, 0);
 	in6_ifa_put(ift);
 	in6_dev_put(idev);
 out:
@@ -1090,7 +1154,7 @@ static int ipv6_get_saddr_eval(struct net *net,
 		 */
 		int preftmp = dst->prefs & (IPV6_PREFER_SRC_PUBLIC|
IPV6_PREFER_SRC_TMP) ?
 				!!(dst->prefs & IPV6_PREFER_SRC_TMP) :
-				score->ifa->idev->cnf.use_tempaddr >= 2;
+				!!(score->ifa->idev->cnf.use_tempaddr & 2);
 		ret = (!(score->ifa->flags & IFA_F_TEMPORARY)) ^ preftmp;
 		break;
 	    }
@@ -1398,6 +1462,9 @@ static void addrconf_dad_stop(struct inet6_ifaddr *ifp, 
int dad_failed)
 		if (ifpub) {
 			in6_ifa_hold(ifpub);
 			spin_unlock_bh(&ifp->lock);
+#ifdef CONFIG_IPV6_PRIVACY_HASH
+			ifp->idev->rndid_inc++;
+#endif
 			ipv6_create_tempaddr(ifpub, ifp);
 			in6_ifa_put(ifpub);
 		} else {
@@ -1605,13 +1672,8 @@ static int ipv6_inherit_eui64(u8 *eui, struct inet6_dev 
*idev)
 }
 
 #ifdef CONFIG_IPV6_PRIVACY
-/* (re)generation of randomized interface identifier (RFC 3041 3.2, 3.5) */
-static int __ipv6_regen_rndid(struct inet6_dev *idev)
+static int __ipv6_is_invalid_rndid(const __u8 * rndid)
 {
-regen:
-	get_random_bytes(idev->rndid, sizeof(idev->rndid));
-	idev->rndid[0] &= ~0x02;
-
 	/*
 	 * <draft-ietf-ipngwg-temp-addresses-v2-00.txt>:
 	 * check if generated address is not inappropriate
@@ -1623,15 +1685,35 @@ regen:
 	 *  - value 0
 	 *  - XXX: already assigned to an address on the device
 	 */
-	if (idev->rndid[0] == 0xfd &&
-	    (idev->rndid[1]&idev->rndid[2]&idev->rndid[3]&idev->rndid[4]&idev-
>rndid[5]&idev->rndid[6]) == 0xff &&
-	    (idev->rndid[7]&0x80))
-		goto regen;
-	if ((idev->rndid[0]|idev->rndid[1]) == 0) {
-		if (idev->rndid[2] == 0x5e && idev->rndid[3] == 0xfe)
-			goto regen;
-		if ((idev->rndid[2]|idev->rndid[3]|idev->rndid[4]|idev->rndid[5]|
idev->rndid[6]|idev->rndid[7]) == 0x00)
-			goto regen;
+
+	if (rndid[0] == 0xfd &&
+	    (rndid[1]&rndid[2]&rndid[3]&rndid[4]&rndid[5]&rndid[6]) == 0xff &&
+	    (rndid[7]&0x80))
+		return -1;
+	if ((rndid[0]|rndid[1]) == 0) {
+		if (rndid[2] == 0x5e && rndid[3] == 0xfe)
+			return -1;
+		if ((rndid[2]|rndid[3]|rndid[4]|rndid[5]|rndid[6]|rndid[7]) == 
0x00)
+			return -1;
+	}
+	return 0;
+}
+
+/* (re)generation of randomized interface identifier (RFC 3041 3.2, 3.5) */
+static int __ipv6_regen_rndid(struct inet6_dev *idev)
+{
+#ifdef CONFIG_IPV6_PRIVACY_HASH
+	if (idev->cnf.use_tempaddr > 4) {
+		get_random_bytes(idev->cnf.temp_random, sizeof(idev-
>cnf.temp_random));
+	}
+#else
+	idev->cnf.use_tempaddr &= 0x03;
+#endif
+	if (idev->cnf.use_tempaddr < 4) {
+		do {
+			get_random_bytes(idev->rndid, sizeof(idev->rndid));
+			idev->rndid[0] &= ~0x02;
+		} while (__ipv6_is_invalid_rndid(idev->rndid));
 	}
 
 	return 0;
@@ -1903,6 +1985,10 @@ ok:
 			int max_addresses = in6_dev->cnf.max_addresses;
 			u32 addr_flags = 0;
 
+#ifdef CONFIG_IPV6_PRIVACY_HASH
+			in6_dev->rndid_inc = 0;
+#endif
+
 #ifdef CONFIG_IPV6_OPTIMISTIC_DAD
 			if (in6_dev->cnf.optimistic_dad &&
 			    !net->ipv6.devconf_all->forwarding)
@@ -4454,6 +4540,15 @@ static struct addrconf_sysctl_table
 			.mode           = 0644,
 			.proc_handler   = proc_dointvec
 		},
+#ifdef CONFIG_IPV6_PRIVACY_HASH
+		{
+			.procname	= "temp_random",
+			.data		= &ipv6_devconf.temp_random,
+			.maxlen		= sizeof(ipv6_devconf.temp_random),
+			.mode		= 0640,
+			.proc_handler	= proc_dointvec,
+		},
+#endif
 		{
 			/* sentinel */
 		}
-- 
1.7.2.3


^ permalink raw reply related

* Re: [Bugme-new] [Bug 33502] New: Caught 64-bit read from uninitialized memory in __alloc_skb
From: Eric Dumazet @ 2011-04-19  2:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: netdev, bugzilla-daemon, bugme-daemon, casteyde.christian,
	Vegard Nossum, Pekka Enberg, Christoph Lameter
In-Reply-To: <20110418153852.153d3ed3.akpm@linux-foundation.org>

Le lundi 18 avril 2011 à 15:38 -0700, Andrew Morton a écrit :
> (switched to email.  Please respond via emailed reply-to-all, not via the
> bugzilla web interface).
> 
> On Sun, 17 Apr 2011 19:29:39 GMT
> bugzilla-daemon@bugzilla.kernel.org wrote:
> 
> > https://bugzilla.kernel.org/show_bug.cgi?id=33502
> > 
> >            Summary: Caught 64-bit read from uninitialized memory in
> >                     __alloc_skb
> >            Product: Networking
> >            Version: 2.5
> >     Kernel Version: 2.6.39-rc3
> >           Platform: All
> >         OS/Version: Linux
> >               Tree: Mainline
> >             Status: NEW
> >           Severity: normal
> >           Priority: P1
> >          Component: IPV4
> >         AssignedTo: shemminger@linux-foundation.org
> >         ReportedBy: casteyde.christian@free.fr
> >         Regression: Yes
> > 
> > 
> > Acer Aspire 1511LMi
> > Athlon 64 3GHz in 64bits mode
> > Slackware 64 13.1
> > 
> > Since 2.6.39-rc3 with kmemcheck enabled, I get the following warning:
> > ...
> > pcmcia_socket pcmcia_socket0: cs: memory probe 0x0c0000-0x0fffff: excluding
> > 0xc0000-0xfffff
> > pcmcia_socket pcmcia_socket0: cs: memory probe 0x60000000-0x60ffffff: excluding
> > 0x60000000-0x
> > 60ffffff
> > pcmcia_socket pcmcia_socket0: cs: memory probe 0xa0000000-0xa0ffffff: excluding
> > 0xa0000000-0x
> > a0ffffff
> > udev: renamed network interface wlan0 to eth1
> > WARNING: kmemcheck: Caught 64-bit read from uninitialized memory
> > (ffff88001b0bb800)
> > 00b00b1b0088ffff0000000000000000cafe1dea20009b0000299a3100000000
> >  u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u
> >  ^
> > 
> > Pid: 1511, comm: udevd Not tainted 2.6.39-rc3 #1 Acer,Inc. Aspire 1510  /Aspire
> > 1510
> > RIP: 0010:[<ffffffff810c2f0c>]  [<ffffffff810c2f0c>]
> > __kmalloc_track_caller+0xbc/0x1d0
> > RSP: 0018:ffff88001d3a7a18  EFLAGS: 00010246
> > RAX: 0000000000000000 RBX: 0000000000000010 RCX: 000000000000284f
> > RDX: 000000000000284e RSI: ffff88001fe5b160 RDI: ffffffff8177e39a
> > RBP: ffff88001d3a7a48 R08: 0000000000000000 R09: ffff88001b931100
> > R10: 0000000000000000 R11: 0000000000000003 R12: ffff88001b0bb800
> > R13: ffff88001f803840 R14: 00000000000004d0 R15: ffffffff814769c6
> > FS:  00007f6ee81f1700(0000) GS:ffffffff81a1b000(0000) knlGS:0000000000000000
> > CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> > CR2: ffff88001d0b3938 CR3: 000000001d38b000 CR4: 00000000000006f0
> > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > DR3: 0000000000000000 DR6: 00000000ffff4ff0 DR7: 0000000000000400
> >  [<ffffffff8147ccf2>] __alloc_skb+0x72/0x190
> >  [<ffffffff814769c6>] sock_alloc_send_pskb+0x236/0x3a0
> >  [<ffffffff81476b40>] sock_alloc_send_skb+0x10/0x20
> >  [<ffffffff81523c18>] unix_dgram_sendmsg+0x298/0x770
> >  [<ffffffff814715f3>] sock_sendmsg+0xe3/0x110
> >  [<ffffffff81472603>] sys_sendmsg+0x243/0x3c0
> >  [<ffffffff815e7238>] system_call_fastpath+0x16/0x1b
> >  [<ffffffffffffffff>] 0xffffffffffffffff
> 
> hum.  I wonder if kmemcheck is disliking prefetchw()?

Nope, prefetchw() is OK versus kmemcheck.

This is in __kmalloc_track_caller(), not in networking stuff.

CC Christoph Lameter

I guess this_cpu_cmpxchg16b() is the offender.

A disassembly of __kmalloc_track_caller() would help, but I feel its the
read of s->cpu_slab->freelist

It seems to be at address 
0xffff88001b0bb800 and contains 0xffff88001b0bb000 but kmemcheck thinks
its not initialized.

Its located in percpu zone, maybe kmemcheck has a problem with it ?

alloc_kmem_cache_cpus() does a call to __alloc_percpu(), so this must
have been zeroed at the very beginning of kmem_cache life.


Hmm, looking at mm/slub.c, I wonder what prevents "object" from pointing
to a now freed and unreachable zone of memory. (Say we are interrupted,
object given to interrupt handler and this one wants to change page bits
to trap access)




^ permalink raw reply

* Re: [Bugme-new] [Bug 33502] New: Caught 64-bit read from uninitialized memory in __alloc_skb
From: Eric Dumazet @ 2011-04-19  3:09 UTC (permalink / raw)
  To: Andrew Morton
  Cc: netdev, bugzilla-daemon, bugme-daemon, casteyde.christian,
	Vegard Nossum, Pekka Enberg, Christoph Lameter
In-Reply-To: <1303181466.4152.39.camel@edumazet-laptop>

Le mardi 19 avril 2011 à 04:51 +0200, Eric Dumazet a écrit :

> Hmm, looking at mm/slub.c, I wonder what prevents "object" from pointing
> to a now freed and unreachable zone of memory. (Say we are interrupted,
> object given to interrupt handler and this one wants to change page bits
> to trap access)


Yes, I suspect this whole business is not kmemcheck compatable, or
DEBUG_PAGEALLOC

get_freepointer(s, object) can access to freed memory and kmemcheck
triggers the fault, while this_cpu_cmpxchg_double() would presumably
detect a change of tid and would not perform the freelist/tid change.





^ permalink raw reply

* linux-next: manual merge of the net tree with the net-current tree
From: Stephen Rothwell @ 2011-04-19  3:16 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-next, linux-kernel, Yaniv Rosner, stephen hemminger

Hi all,

Today's linux-next merge of the net tree got a conflict in
drivers/net/bnx2x/bnx2x_ethtool.c between commit 70dda99c41fc ("bnx2x:
Fix port identification problem") from the net-current tree and commit
32d3613475d8 ("bnx2x: convert to set_phys_id") from the net tree.

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

diff --cc drivers/net/bnx2x/bnx2x_ethtool.c
index 89cb977,e711a22..0000000
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@@ -2097,35 -2013,38 +2013,36 @@@ static void bnx2x_get_ethtool_stats(str
  	}
  }
  
- static int bnx2x_phys_id(struct net_device *dev, u32 data)
+ static int bnx2x_set_phys_id(struct net_device *dev,
+ 			     enum ethtool_phys_id_state state)
  {
  	struct bnx2x *bp = netdev_priv(dev);
- 	int i;
  
  	if (!netif_running(dev))
- 		return 0;
+ 		return -EAGAIN;
  
  	if (!bp->port.pmf)
- 		return 0;
+ 		return -EOPNOTSUPP;
  
- 	if (data == 0)
- 		data = 2;
+ 	switch (state) {
+ 	case ETHTOOL_ID_ACTIVE:
+ 		return 1;	/* cycle on/off once per second */
  
- 	for (i = 0; i < (data * 2); i++) {
- 		if ((i % 2) == 0)
- 			bnx2x_set_led(&bp->link_params, &bp->link_vars,
- 				      LED_MODE_ON, SPEED_1000);
- 		else
- 			bnx2x_set_led(&bp->link_params, &bp->link_vars,
- 				      LED_MODE_FRONT_PANEL_OFF, 0);
+ 	case ETHTOOL_ID_ON:
+ 		bnx2x_set_led(&bp->link_params, &bp->link_vars,
 -			      LED_MODE_OPER, SPEED_1000);
++			      LED_MODE_ON, SPEED_1000);
+ 		break;
  
- 		msleep_interruptible(500);
- 		if (signal_pending(current))
- 			break;
- 	}
+ 	case ETHTOOL_ID_OFF:
+ 		bnx2x_set_led(&bp->link_params, &bp->link_vars,
 -			      LED_MODE_OFF, 0);
++			      LED_MODE_FRONT_PANEL_OFF, 0);
+ 
+ 		break;
  
- 	bnx2x_set_led(&bp->link_params, &bp->link_vars,
- 		      LED_MODE_OPER, bp->link_vars.line_speed);
+ 	case ETHTOOL_ID_INACTIVE:
 -		if (bp->link_vars.link_up)
 -			bnx2x_set_led(&bp->link_params, &bp->link_vars,
 -				      LED_MODE_OPER,
 -				      bp->link_vars.line_speed);
++		bnx2x_set_led(&bp->link_params, &bp->link_vars,
++			      LED_MODE_OPER, bp->link_vars.line_speed);
+ 	}
  
  	return 0;
  }

^ permalink raw reply

* Re: [Bugme-new] [Bug 33502] New: Caught 64-bit read from uninitialized memory in __alloc_skb
From: Eric Dumazet @ 2011-04-19  3:20 UTC (permalink / raw)
  To: Andrew Morton
  Cc: netdev, bugzilla-daemon, bugme-daemon, casteyde.christian,
	Vegard Nossum, Pekka Enberg, Christoph Lameter
In-Reply-To: <1303182557.4152.48.camel@edumazet-laptop>

Le mardi 19 avril 2011 à 05:09 +0200, Eric Dumazet a écrit :
> Le mardi 19 avril 2011 à 04:51 +0200, Eric Dumazet a écrit :
> 
> > Hmm, looking at mm/slub.c, I wonder what prevents "object" from pointing
> > to a now freed and unreachable zone of memory. (Say we are interrupted,
> > object given to interrupt handler and this one wants to change page bits
> > to trap access)
> 
> 
> Yes, I suspect this whole business is not kmemcheck compatable, or
> DEBUG_PAGEALLOC
> 
> get_freepointer(s, object) can access to freed memory and kmemcheck
> triggers the fault, while this_cpu_cmpxchg_double() would presumably
> detect a change of tid and would not perform the freelist/tid change.
> 
> 
> 

Christian, please try following patch, thanks

diff --git a/mm/slub.c b/mm/slub.c
index 94d2a33..84febe9 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1540,7 +1540,12 @@ static void unfreeze_slab(struct kmem_cache *s, struct page *page, int tail)
 	}
 }
 
-#ifdef CONFIG_CMPXCHG_LOCAL
+#if defined(CONFIG_CMPXCHG_LOCAL) && \
+	!defined(CONFIG_KMEMCHECK) && !defined(DEBUG_PAGEALLOC)
+#define SLUB_USE_CMPXCHG_DOUBLE
+#endif
+
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 #ifdef CONFIG_PREEMPT
 /*
  * Calculate the next globally unique transaction for disambiguiation
@@ -1604,7 +1609,7 @@ static inline void note_cmpxchg_failure(const char *n,
 
 void init_kmem_cache_cpus(struct kmem_cache *s)
 {
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	int cpu;
 
 	for_each_possible_cpu(cpu)
@@ -1643,7 +1648,7 @@ static void deactivate_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
 		page->inuse--;
 	}
 	c->page = NULL;
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	c->tid = next_tid(c->tid);
 #endif
 	unfreeze_slab(s, page, tail);
@@ -1780,7 +1785,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
 {
 	void **object;
 	struct page *new;
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	unsigned long flags;
 
 	local_irq_save(flags);
@@ -1819,7 +1824,7 @@ load_freelist:
 	c->node = page_to_nid(c->page);
 unlock_out:
 	slab_unlock(c->page);
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	c->tid = next_tid(c->tid);
 	local_irq_restore(flags);
 #endif
@@ -1858,7 +1863,7 @@ new_slab:
 	}
 	if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
 		slab_out_of_memory(s, gfpflags, node);
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	local_irq_restore(flags);
 #endif
 	return NULL;
@@ -1887,7 +1892,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
 {
 	void **object;
 	struct kmem_cache_cpu *c;
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	unsigned long tid;
 #else
 	unsigned long flags;
@@ -1896,7 +1901,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
 	if (slab_pre_alloc_hook(s, gfpflags))
 		return NULL;
 
-#ifndef CONFIG_CMPXCHG_LOCAL
+#ifndef SLUB_USE_CMPXCHG_DOUBLE
 	local_irq_save(flags);
 #else
 redo:
@@ -1910,7 +1915,7 @@ redo:
 	 */
 	c = __this_cpu_ptr(s->cpu_slab);
 
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	/*
 	 * The transaction ids are globally unique per cpu and per operation on
 	 * a per cpu queue. Thus they can be guarantee that the cmpxchg_double
@@ -1927,7 +1932,7 @@ redo:
 		object = __slab_alloc(s, gfpflags, node, addr, c);
 
 	else {
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 		/*
 		 * The cmpxchg will only match if there was no additional
 		 * operation and if we are on the right processor.
@@ -1954,7 +1959,7 @@ redo:
 		stat(s, ALLOC_FASTPATH);
 	}
 
-#ifndef CONFIG_CMPXCHG_LOCAL
+#ifndef SLUB_USE_CMPXCHG_DOUBLE
 	local_irq_restore(flags);
 #endif
 
@@ -2034,7 +2039,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page,
 {
 	void *prior;
 	void **object = (void *)x;
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	unsigned long flags;
 
 	local_irq_save(flags);
@@ -2070,7 +2075,7 @@ checks_ok:
 
 out_unlock:
 	slab_unlock(page);
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	local_irq_restore(flags);
 #endif
 	return;
@@ -2084,7 +2089,7 @@ slab_empty:
 		stat(s, FREE_REMOVE_PARTIAL);
 	}
 	slab_unlock(page);
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	local_irq_restore(flags);
 #endif
 	stat(s, FREE_SLAB);
@@ -2113,7 +2118,7 @@ static __always_inline void slab_free(struct kmem_cache *s,
 {
 	void **object = (void *)x;
 	struct kmem_cache_cpu *c;
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	unsigned long tid;
 #else
 	unsigned long flags;
@@ -2121,7 +2126,7 @@ static __always_inline void slab_free(struct kmem_cache *s,
 
 	slab_free_hook(s, x);
 
-#ifndef CONFIG_CMPXCHG_LOCAL
+#ifndef SLUB_USE_CMPXCHG_DOUBLE
 	local_irq_save(flags);
 
 #else
@@ -2136,7 +2141,7 @@ redo:
 	 */
 	c = __this_cpu_ptr(s->cpu_slab);
 
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	tid = c->tid;
 	barrier();
 #endif
@@ -2144,7 +2149,7 @@ redo:
 	if (likely(page == c->page && c->node != NUMA_NO_NODE)) {
 		set_freepointer(s, object, c->freelist);
 
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 		if (unlikely(!this_cpu_cmpxchg_double(
 				s->cpu_slab->freelist, s->cpu_slab->tid,
 				c->freelist, tid,
@@ -2160,7 +2165,7 @@ redo:
 	} else
 		__slab_free(s, page, x, addr);
 
-#ifndef CONFIG_CMPXCHG_LOCAL
+#ifndef SLUB_USE_CMPXCHG_DOUBLE
 	local_irq_restore(flags);
 #endif
 }
@@ -2354,7 +2359,7 @@ static inline int alloc_kmem_cache_cpus(struct kmem_cache *s)
 	BUILD_BUG_ON(PERCPU_DYNAMIC_EARLY_SIZE <
 			SLUB_PAGE_SHIFT * sizeof(struct kmem_cache_cpu));
 
-#ifdef CONFIG_CMPXCHG_LOCAL
+#ifdef SLUB_USE_CMPXCHG_DOUBLE
 	/*
 	 * Must align to double word boundary for the double cmpxchg instructions
 	 * to work.



^ permalink raw reply related

* Re: [PATCH v2] net: r8169: convert to hw_features
From: David Dillow @ 2011-04-19  3:24 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev, Realtek, davem
In-Reply-To: <20110418180857.GB18469@electric-eye.fr.zoreil.com>

On Mon, 2011-04-18 at 20:08 +0200, Francois Romieu wrote:
> [...]
> > I've attached my ancient patch, if it helps.
> 
> Thanks, it works way better now (see below). It is ok for me to use
> you s-o-b on it ?

You may have it if you want it -- and I appreciate the offer -- but I
don't think you need it. You had it mostly working prior to my sending
you anything.

You did the work; you deserve the credit.

Thanks,
Dave


^ permalink raw reply

* Re: DSCP values in TCP handshake
From: Mikael Abrahamsson @ 2011-04-19  3:50 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Joe Buehler, Eric Dumazet, netdev
In-Reply-To: <20110418144908.55967b06@nehalam>

On Mon, 18 Apr 2011, Stephen Hemminger wrote:

> If the DSCP bits are reflected, then it could allow for even better SYN 
> flood attack. Attacker could maliciously set DSCP to elevate priority 
> processing of his bogus SYN packets and also cause SYN-ACK on reverse 
> path to also take priority.

Incoming, it's already too late. Outgoing, yes, that might be a problem, 
but if you have a QoS enabled network then you might as well solve that in 
the network, not in the host.

Does Linux internally look at DSCP when deciding what SYNs to handle 
first? If not, I think the above reasoning is misdirected.

-- 
Mikael Abrahamsson    email: swmike@swm.pp.se

^ permalink raw reply

* RE: Low performance Intel 10GE NIC (3.2.10) on 2.6.38 Kernel
From: Wei Gu @ 2011-04-19  4:09 UTC (permalink / raw)
  To: Jesse Brandeburg
  Cc: Peter Zijlstra, Eric Dumazet, Alexander Duyck, netdev,
	Kirsher, Jeffrey T, Mike Galbraith, Thomas Gleixner
In-Reply-To: <BANLkTin_OgBo3N8qi5cF5rOd__pRKifwsg@mail.gmail.com>

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

Hi,
This is the result that I running the turbostat via 2.6.35.3 and perform the same load test on eth10 (8 tx/rx queue binding to core 24-31) according you instruction.
I was add the processor.max_cstate=1 in the boot params, and also disabled the cstate in the BIOS. But looks like the kernel does take them.

Thanks
WeiGu

-----Original Message-----
From: Jesse Brandeburg [mailto:jesse.brandeburg@gmail.com]
Sent: Tuesday, April 19, 2011 5:12 AM
To: Wei Gu
Cc: Peter Zijlstra; Eric Dumazet; Alexander Duyck; netdev; Kirsher, Jeffrey T; Mike Galbraith; Thomas Gleixner
Subject: Re: Low performance Intel 10GE NIC (3.2.10) on 2.6.38 Kernel

On Fri, Apr 15, 2011 at 2:14 AM, Wei Gu <wei.gu@ericsson.com> wrote:
> Is there something that I can provide in order to identify the problem?

for power state concerns you may want to try running turbostat (available in recent kernels, runs also on older kernels) during the workload in question.  Capture the results via something like:
cd /home/jbrandeb/linux-2.6.38.2/tools/power/x86/turbostat
make
for i in `seq 1 10` ; do ./turbostat -v sleep 5 >> turbostat.txt 2>&1 ; done

Jesse

[-- Attachment #2: turbostat.txt --]
[-- Type: text/plain, Size: 44410 bytes --]

GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               3.80 2.14 2.27  15.66  80.54   0.00  72.50   0.00
   0   0   0   2.08 1.89 2.27   2.48  95.44   0.00  94.89   0.00
   0   0  32   0.39 1.81 2.27   4.17  95.44   0.00  94.89   0.00
   0   1   1   0.69 1.90 2.27   1.96  97.35   0.00  94.90   0.00
   0   1  33   0.34 1.90 2.27   2.31  97.35   0.00  94.90   0.00
   0   2   2   0.33 1.93 2.27   0.13  99.54   0.00  94.90   0.00
   0   2  34   0.32 1.93 2.27   0.15  99.54   0.00  94.90   0.00
   0   3   3   0.33 1.93 2.27   1.87  97.80   0.00  94.91   0.00
   0   3  35   0.31 1.93 2.27   1.88  97.80   0.00  94.91   0.00
   0   8   4   0.32 1.93 2.27   1.87  97.80   0.00  94.91   0.00
   0   8  36   0.31 1.94 2.27   1.88  97.81   0.00  94.92   0.00
   0   9   5   0.32 1.93 2.27   1.86  97.82   0.00  94.92   0.00
   0   9  37   0.30 1.95 2.27   1.88  97.82   0.00  94.92   0.00
   0  10   6   0.32 1.96 2.27   1.85  97.83   0.00  94.92   0.00
   0  10  38   0.31 1.96 2.27   1.86  97.83   0.00  94.93   0.00
   0  11   7   0.33 1.89 2.27   1.84  97.83   0.00  94.93   0.00
   0  11  39   0.35 1.92 2.27   1.83  97.83   0.00  94.93   0.00
   1   0   8   0.39 1.98 2.27   1.79  97.81   0.00  97.61   0.00
   1   0  40   0.33 1.92 2.27   1.85  97.82   0.00  97.61   0.00
   1   1   9   0.34 1.92 2.27   1.80  97.86   0.00  97.61   0.00
   1   1  41   0.35 1.94 2.27   1.78  97.87   0.00  97.62   0.00
   1   2  10   0.33 1.92 2.27   1.80  97.88   0.00  97.62   0.00
   1   2  42   0.32 1.89 2.27   1.80  97.88   0.00  97.62   0.00
   1   3  11   0.32 1.93 2.27   1.79  97.89   0.00  97.63   0.00
   1   3  43   0.32 1.90 2.27   1.79  97.89   0.00  97.63   0.00
   1   8  12   0.32 1.94 2.27   1.77  97.91   0.00  97.63   0.00
   1   8  44   0.31 1.95 2.27   1.77  97.92   0.00  97.63   0.00
   1   9  13   0.32 1.96 2.27   1.76  97.92   0.00  97.64   0.00
   1   9  45   0.31 1.96 2.27   1.77  97.92   0.00  97.64   0.00
   1  10  14   0.32 1.95 2.27   1.75  97.93   0.00  97.64   0.00
   1  10  46   0.31 1.96 2.27   1.76  97.93   0.00  97.65   0.00
   1  11  15   0.32 1.87 2.27   1.75  97.93   0.00  97.65   0.00
   1  11  47   0.35 1.93 2.27   1.72  97.93   0.00  97.65   0.00
   2   0  16   0.36 1.89 2.27   1.72  97.92   0.00  97.37   0.00
   2   0  48   0.35 1.90 2.27   1.73  97.92   0.00  97.37   0.00
   2   1  17   0.39 1.86 2.27   1.83  97.78   0.00  97.37   0.00
   2   1  49   0.39 1.83 2.27   1.83  97.78   0.00  97.37   0.00
   2   2  18   0.36 1.89 2.27   1.85  97.79   0.00  97.37   0.00
   2   2  50   0.41 1.81 2.27   1.81  97.79   0.00  97.37   0.00
   2   3  19   0.34 1.94 2.27   1.68  97.98   0.00  97.38   0.00
   2   3  51   0.32 1.95 2.27   1.69  97.98   0.00  97.38   0.00
   2   8  20   0.33 1.95 2.26   1.68  97.99   0.00  97.38   0.00
   2   8  52   0.32 1.96 2.26   1.68  97.99   0.00  97.39   0.00
   2   9  21   0.33 1.95 2.26   1.66  98.00   0.00  97.39   0.00
   2   9  53   0.32 1.97 2.26   1.67  98.00   0.00  97.39   0.00
   2  10  22   0.33 1.95 2.26   1.66  98.01   0.00  97.40   0.00
   2  10  54   0.32 1.97 2.26   1.67  98.01   0.00  97.40   0.00
   2  11  23   0.35 1.88 2.26   1.65  98.00   0.00  97.40   0.00
   2  11  55   0.35 1.94 2.26   1.64  98.00   0.00  97.40   0.00
   3   0  24  45.64 2.25 2.26  24.86  29.51   0.00   0.00   0.00
   3   0  56   0.37 2.35 2.26  70.12  29.51   0.00   0.00   0.00
   3   1  25  24.02 2.11 2.26  52.07  23.91   0.00   0.00   0.00
   3   1  57   0.46 2.36 2.26  75.62  23.92   0.00   0.00   0.00
   3   2  26  26.37 2.14 2.26  38.14  35.49   0.00   0.00   0.00
   3   2  58   0.38 2.36 2.26  64.13  35.50   0.00   0.00   0.00
   3   3  27  26.51 2.13 2.26  38.86  34.63   0.00   0.00   0.00
   3   3  59   0.38 2.36 2.26  64.99  34.63   0.00   0.00   0.00
   3   8  28  26.50 2.13 2.26  39.08  34.41   0.00   0.00   0.00
   3   8  60   0.37 2.36 2.26  65.22  34.41   0.00   0.00   0.00
   3   9  29  21.08 2.17 2.26  71.14   7.78   0.00   0.00   0.00
   3   9  61   0.38 2.35 2.26  91.83   7.78   0.00   0.00   0.00
   3  10  30  26.05 2.12 2.26  41.47  32.48   0.00   0.00   0.00
   3  10  62   0.38 2.36 2.26  67.14  32.48   0.00   0.00   0.00
   3  11  31  25.59 2.11 2.26  43.60  30.81   0.00   0.00   0.00
   3  11  63   0.37 2.36 2.26  68.82  30.81   0.00   0.00   0.00
5.008826 sec
GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               3.15 2.16 2.26  15.01  81.84   0.00  73.01   0.00
   0   0   0   1.40 1.49 2.26   1.74  96.85   0.00  96.43   0.00
   0   0  32   0.36 1.82 2.26   2.79  96.85   0.00  96.43   0.00
   0   1   1   0.48 1.87 2.26   0.30  99.23   0.00  96.42   0.00
   0   1  33   0.34 1.90 2.26   0.43  99.22   0.00  96.42   0.00
   0   2   2   0.32 1.92 2.26   1.14  98.54   0.00  96.42   0.00
   0   2  34   0.31 1.92 2.26   1.16  98.54   0.00  96.42   0.00
   0   3   3   0.32 1.92 2.26   1.14  98.53   0.00  96.41   0.00
   0   3  35   0.31 1.92 2.26   1.16  98.53   0.00  96.41   0.00
   0   8   4   0.32 1.92 2.26   1.15  98.53   0.00  96.41   0.00
   0   8  36   0.30 1.93 2.26   1.17  98.53   0.00  96.41   0.00
   0   9   5   0.32 1.92 2.26   1.14  98.54   0.00  96.41   0.00
   0   9  37   0.30 1.95 2.26   1.17  98.53   0.00  96.41   0.00
   0  10   6   0.31 1.95 2.26   1.15  98.54   0.00  96.41   0.00
   0  10  38   0.31 1.96 2.26   1.15  98.54   0.00  96.41   0.00
   0  11   7   0.33 1.88 2.26   1.14  98.53   0.00  96.41   0.00
   0  11  39   0.34 1.92 2.26   1.13  98.53   0.00  96.41   0.00
   1   0   8   0.36 1.89 2.26   1.10  98.54   0.00  98.28   0.00
   1   0  40   0.33 1.89 2.26   1.13  98.54   0.00  98.27   0.00
   1   1   9   0.34 1.89 2.26   1.12  98.54   0.00  98.27   0.00
   1   1  41   0.32 1.91 2.26   1.14  98.54   0.00  98.26   0.00
   1   2  10   0.33 1.91 2.26   1.12  98.55   0.00  98.26   0.00
   1   2  42   0.33 1.90 2.26   1.13  98.54   0.00  98.26   0.00
   1   3  11   0.34 1.91 2.26   1.13  98.53   0.00  98.25   0.00
   1   3  43   0.33 1.91 2.26   1.14  98.53   0.00  98.25   0.00
   1   8  12   0.33 1.91 2.26   1.11  98.57   0.00  98.24   0.00
   1   8  44   0.31 1.93 2.26   1.13  98.56   0.00  98.24   0.00
   1   9  13   0.32 1.93 2.26   1.11  98.57   0.00  98.24   0.00
   1   9  45   0.31 1.94 2.26   1.13  98.56   0.00  98.23   0.00
   1  10  14   0.33 1.93 2.26   0.15  99.52   0.00  98.23   0.00
   1  10  46   0.32 1.96 2.26   0.16  99.52   0.00  98.22   0.00
   1  11  15   0.33 1.86 2.26   1.11  98.56   0.00  98.22   0.00
   1  11  47   0.35 1.91 2.26   1.10  98.56   0.00  98.22   0.00
   2   0  16   0.36 1.87 2.26   1.10  98.54   0.00  97.45   0.00
   2   0  48   0.35 1.88 2.26   1.11  98.54   0.00  97.45   0.00
   2   1  17   0.36 1.88 2.26   0.87  98.77   0.00  97.44   0.00
   2   1  49   0.98 2.32 2.26   0.25  98.77   0.00  97.44   0.00
   2   2  18   0.35 1.88 2.26   0.25  99.40   0.00  97.44   0.00
   2   2  50   0.38 1.79 2.26   0.23  99.39   0.00  97.43   0.00
   2   3  19   0.34 1.92 2.26   0.11  99.55   0.00  97.43   0.00
   2   3  51   0.32 1.94 2.26   0.13  99.54   0.00  97.43   0.00
   2   8  20   0.34 1.92 2.26   1.08  98.59   0.00  97.43   0.00
   2   8  52   0.32 1.95 2.26   1.09  98.59   0.00  97.43   0.00
   2   9  21   0.34 1.93 2.26   0.12  99.55   0.00  97.43   0.00
   2   9  53   0.31 1.96 2.26   0.14  99.55   0.00  97.43   0.00
   2  10  22   0.34 1.93 2.26   1.07  98.60   0.00  97.42   0.00
   2  10  54   0.31 1.97 2.26   1.09  98.60   0.00  97.42   0.00
   2  11  23   0.35 1.85 2.26   1.06  98.59   0.00  97.42   0.00
   2  11  55   0.35 1.92 2.26   1.06  98.59   0.00  97.42   0.00
   3   0  24  21.01 2.18 2.26  54.73  24.26   0.00   0.00   0.00
   3   0  56   0.37 2.38 2.26  75.37  24.26   0.00   0.00   0.00
   3   1  25  23.36 2.19 2.26  38.47  38.17   0.00   0.00   0.00
   3   1  57   0.37 2.37 2.26  61.46  38.17   0.00   0.00   0.00
   3   2  26  23.38 2.19 2.26  39.01  37.61   0.00   0.00   0.00
   3   2  58   0.35 2.38 2.26  62.03  37.61   0.00   0.00   0.00
   3   3  27  22.87 2.18 2.26  45.41  31.72   0.00   0.00   0.00
   3   3  59   0.36 2.38 2.26  67.92  31.72   0.00   0.00   0.00
   3   8  28  23.61 2.18 2.26  40.81  35.58   0.00   0.00   0.00
   3   8  60   0.36 2.38 2.26  64.06  35.58   0.00   0.00   0.00
   3   9  29  19.13 2.22 2.26  71.34   9.53   0.00   0.00   0.00
   3   9  61   0.38 2.38 2.26  90.09   9.53   0.00   0.00   0.00
   3  10  30  23.70 2.18 2.26  39.58  36.72   0.00   0.00   0.00
   3  10  62   0.37 2.38 2.26  62.92  36.72   0.00   0.00   0.00
   3  11  31  23.86 2.18 2.26  38.77  37.38   0.00   0.00   0.00
   3  11  63   0.37 2.38 2.26  62.26  37.37   0.00   0.00   0.00
5.015708 sec
GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               3.58 2.29 2.26  15.33  81.09   0.00  67.40   0.00
   0   0   0   1.87 1.77 2.27   1.19  96.95   0.00  72.79   0.00
   0   0  32   0.36 1.95 2.27   2.69  96.95   0.00  72.79   0.00
   0   1   1   0.69 1.96 2.27  24.62  74.69   0.00  72.79   0.00
   0   1  33  24.96 2.64 2.27   0.35  74.69   0.00  72.79   0.00
   0   2   2   0.36 2.06 2.27   0.56  99.08   0.00  72.79   0.00
   0   2  34   0.36 2.09 2.27   0.55  99.09   0.00  72.79   0.00
   0   3   3   0.33 2.02 2.27   0.55  99.12   0.00  72.79   0.00
   0   3  35   0.35 2.10 2.27   0.52  99.13   0.00  72.80   0.00
   0   8   4   0.32 2.03 2.27   0.50  99.18   0.00  72.80   0.00
   0   8  36   0.31 2.03 2.27   0.51  99.18   0.00  72.80   0.00
   0   9   5   0.32 2.03 2.27   0.48  99.19   0.00  72.80   0.00
   0   9  37   0.30 2.04 2.27   0.50  99.19   0.00  72.80   0.00
   0  10   6   0.31 2.04 2.27   0.48  99.21   0.00  72.80   0.00
   0  10  38   0.30 2.04 2.27   0.50  99.20   0.00  72.80   0.00
   0  11   7   0.33 1.99 2.27   0.19  99.48   0.00  72.80   0.00
   0  11  39   0.34 2.01 2.27   0.18  99.49   0.00  72.80   0.00
   1   0   8   0.60 1.82 2.27   0.48  98.92   0.00  98.45   0.00
   1   0  40   0.33 1.92 2.27   0.75  98.92   0.00  98.46   0.00
   1   1   9   0.55 1.88 2.27   0.54  98.91   0.00  98.46   0.00
   1   1  41   0.75 2.09 2.27   0.34  98.91   0.00  98.46   0.00
   1   2  10   0.56 1.89 2.27   0.49  98.95   0.00  98.46   0.00
   1   2  42   0.48 1.95 2.26   0.57  98.95   0.00  98.47   0.00
   1   3  11   0.33 1.94 2.26   0.40  99.28   0.00  98.47   0.00
   1   3  43   0.33 1.92 2.26   0.39  99.28   0.00  98.47   0.00
   1   8  12   0.33 1.95 2.26   0.37  99.30   0.00  98.47   0.00
   1   8  44   0.31 1.96 2.26   0.39  99.30   0.00  98.47   0.00
   1   9  13   0.32 1.96 2.26   0.37  99.31   0.00  98.47   0.00
   1   9  45   0.31 1.96 2.26   0.38  99.32   0.00  98.47   0.00
   1  10  14   0.32 1.96 2.26   0.37  99.31   0.00  98.47   0.00
   1  10  46   0.31 1.97 2.26   0.38  99.31   0.00  98.47   0.00
   1  11  15   0.33 1.89 2.26   0.35  99.32   0.00  98.48   0.00
   1  11  47   0.34 1.93 2.26   0.34  99.32   0.00  98.48   0.00
   2   0  16   0.44 1.84 2.26   0.37  99.19   0.00  98.32   0.00
   2   0  48   0.34 1.89 2.26   0.47  99.19   0.00  98.32   0.00
   2   1  17   0.38 1.84 2.26   0.74  98.87   0.00  98.32   0.00
   2   1  49   0.55 1.82 2.26   0.58  98.88   0.00  98.32   0.00
   2   2  18   0.37 1.86 2.26   0.60  99.03   0.00  98.32   0.00
   2   2  50   0.46 1.77 2.26   0.51  99.04   0.00  98.33   0.00
   2   3  19   0.34 1.93 2.26   0.32  99.34   0.00  98.32   0.00
   2   3  51   0.33 1.94 2.26   0.33  99.34   0.00  98.32   0.00
   2   8  20   0.34 1.95 2.26   0.30  99.36   0.00  98.32   0.00
   2   8  52   0.33 1.95 2.26   0.31  99.36   0.00  98.33   0.00
   2   9  21   0.34 1.94 2.26   0.29  99.38   0.00  98.33   0.00
   2   9  53   0.32 1.94 2.26   0.30  99.38   0.00  98.33   0.00
   2  10  22   0.34 1.95 2.26   0.29  99.37   0.00  98.33   0.00
   2  10  54   0.33 1.97 2.26   0.30  99.37   0.00  98.33   0.00
   2  11  23   0.35 1.87 2.26   0.28  99.37   0.00  98.34   0.00
   2  11  55   0.36 1.93 2.26   0.27  99.38   0.00  98.34   0.00
   3   0  24  23.26 2.28 2.26  52.94  23.81   0.00   0.00   0.00
   3   0  56   0.47 2.39 2.26  75.73  23.81   0.00   0.00   0.00
   3   1  25  25.49 2.29 2.26  36.60  37.92   0.00   0.00   0.00
   3   1  57   0.50 2.38 2.26  61.58  37.92   0.00   0.00   0.00
   3   2  26  22.22 2.27 2.26  47.44  30.34   0.00   0.00   0.00
   3   2  58   0.38 2.38 2.26  69.27  30.34   0.00   0.00   0.00
   3   3  27  22.00 2.26 2.26  48.10  29.90   0.00   0.00   0.00
   3   3  59   0.37 2.39 2.26  69.73  29.90   0.00   0.00   0.00
   3   8  28  23.23 2.27 2.26  40.40  36.36   0.00   0.00   0.00
   3   8  60   0.36 2.38 2.26  63.27  36.36   0.00   0.00   0.00
   3   9  29  18.73 2.29 2.26  72.33   8.94   0.00   0.00   0.00
   3   9  61   0.40 2.39 2.26  90.67   8.94   0.00   0.00   0.00
   3  10  30  23.25 2.27 2.26  40.08  36.68   0.00   0.00   0.00
   3  10  62   0.40 2.38 2.26  62.93  36.68   0.00   0.00   0.00
   3  11  31  23.29 2.27 2.26  39.99  36.72   0.00   0.00   0.00
   3  11  63   0.38 2.39 2.26  62.90  36.72   0.00   0.00   0.00
5.009804 sec
GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               3.39 2.04 2.26  15.22  81.39   0.00  72.22   0.00
   0   0   0   1.39 1.49 2.26   2.82  95.79   0.00  95.39   0.00
   0   0  32   0.35 1.82 2.26   3.86  95.79   0.00  95.38   0.00
   0   1   1   0.50 1.96 2.26   0.34  99.16   0.00  95.38   0.00
   0   1  33   0.34 1.93 2.26   0.50  99.16   0.00  95.38   0.00
   0   2   2   0.33 1.93 2.26   2.21  97.46   0.00  95.38   0.00
   0   2  34   0.31 1.93 2.26   2.23  97.46   0.00  95.37   0.00
   0   3   3   0.32 1.91 2.26   2.21  97.47   0.00  95.37   0.00
   0   3  35   0.31 1.92 2.26   2.22  97.47   0.00  95.37   0.00
   0   8   4   0.32 1.93 2.26   2.20  97.48   0.00  95.36   0.00
   0   8  36   0.30 1.94 2.26   2.22  97.48   0.00  95.36   0.00
   0   9   5   0.32 1.92 2.26   2.20  97.48   0.00  95.36   0.00
   0   9  37   0.30 1.95 2.26   2.22  97.48   0.00  95.36   0.00
   0  10   6   0.31 1.96 2.26   2.20  97.49   0.00  95.35   0.00
   0  10  38   0.30 1.95 2.26   2.21  97.49   0.00  95.35   0.00
   0  11   7   0.33 1.89 2.26   2.19  97.48   0.00  95.35   0.00
   0  11  39   0.34 1.92 2.26   2.18  97.48   0.00  95.35   0.00
   1   0   8   0.44 2.03 2.26   2.17  97.40   0.00  97.15   0.00
   1   0  40   0.33 1.90 2.26   2.27  97.40   0.00  97.15   0.00
   1   1   9   0.33 1.89 2.26   2.18  97.48   0.00  97.14   0.00
   1   1  41   0.34 1.93 2.26   2.18  97.48   0.00  97.14   0.00
   1   2  10   0.32 1.90 2.26   2.19  97.49   0.00  97.14   0.00
   1   2  42   0.32 1.90 2.26   2.19  97.49   0.00  97.14   0.00
   1   3  11   0.32 1.91 2.26   2.19  97.49   0.00  97.14   0.00
   1   3  43   0.31 1.90 2.26   2.20  97.49   0.00  97.14   0.00
   1   8  12   0.32 1.92 2.26   2.17  97.52   0.00  97.14   0.00
   1   8  44   0.30 1.93 2.26   2.18  97.52   0.00  97.14   0.00
   1   9  13   0.31 1.93 2.26   2.17  97.52   0.00  97.14   0.00
   1   9  45   0.30 1.94 2.26   2.18  97.52   0.00  97.14   0.00
   1  10  14   0.32 1.93 2.26   2.17  97.50   0.00  97.14   0.00
   1  10  46   0.31 1.95 2.26   2.19  97.50   0.00  97.14   0.00
   1  11  15   0.32 1.86 2.26   2.17  97.51   0.00  97.14   0.00
   1  11  47   0.34 1.92 2.26   2.15  97.50   0.00  97.14   0.00
   2   0  16   0.36 1.86 2.26   2.14  97.50   0.00  96.39   0.00
   2   0  48   0.34 1.87 2.26   2.16  97.50   0.00  96.39   0.00
   2   1  17   0.36 1.88 2.26   2.78  96.86   0.00  96.39   0.00
   2   1  49   0.92 2.31 2.26   2.22  96.86   0.00  96.39   0.00
   2   2  18   0.35 1.88 2.26   2.28  97.37   0.00  96.38   0.00
   2   2  50   0.40 1.81 2.26   2.23  97.37   0.00  96.38   0.00
   2   3  19   0.34 1.91 2.26   2.11  97.56   0.00  96.38   0.00
   2   3  51   0.31 1.94 2.26   2.13  97.56   0.00  96.38   0.00
   2   8  20   0.33 1.93 2.26   2.11  97.56   0.00  96.38   0.00
   2   8  52   0.32 1.95 2.26   2.12  97.56   0.00  96.38   0.00
   2   9  21   0.33 1.93 2.26   2.10  97.57   0.00  96.39   0.00
   2   9  53   0.31 1.96 2.26   2.12  97.57   0.00  96.39   0.00
   2  10  22   0.33 1.92 2.26   2.10  97.56   0.00  96.38   0.00
   2  10  54   0.31 1.95 2.26   2.13  97.56   0.00  96.38   0.00
   2  11  23   0.34 1.85 2.26   2.10  97.56   0.00  96.38   0.00
   2  11  55   0.34 1.93 2.26   2.10  97.56   0.00  96.38   0.00
   3   0  24  23.67 2.05 2.26  45.88  30.45   0.00   0.01   0.00
   3   0  56   0.35 2.34 2.26  69.20  30.45   0.00   0.01   0.00
   3   1  25  25.02 2.06 2.26  36.69  38.29   0.00   0.01   0.00
   3   1  57   0.40 2.35 2.26  61.32  38.29   0.00   0.01   0.00
   3   2  26  25.18 2.05 2.26  36.58  38.23   0.00   0.01   0.00
   3   2  58   0.36 2.35 2.26  61.41  38.23   0.00   0.01   0.00
   3   3  27  25.51 2.04 2.26  36.77  37.72   0.00   0.01   0.00
   3   3  59   0.36 2.34 2.26  61.93  37.72   0.00   0.01   0.00
   3   8  28  25.31 2.04 2.26  37.71  36.98   0.00   0.01   0.00
   3   8  60   0.35 2.35 2.26  62.67  36.98   0.00   0.01   0.00
   3   9  29  20.43 2.10 2.26  70.01   9.56   0.00   0.01   0.00
   3   9  61   0.38 2.35 2.26  90.05   9.56   0.00   0.01   0.00
   3  10  30  25.52 2.04 2.26  37.60  36.88   0.00   0.01   0.00
   3  10  62   0.37 2.35 2.26  62.75  36.88   0.00   0.01   0.00
   3  11  31  25.48 2.04 2.26  37.24  37.28   0.00   0.01   0.00
   3  11  63   0.37 2.35 2.26  62.35  37.28   0.00   0.01   0.00
5.015194 sec
GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               3.54 2.14 2.27  15.67  80.79   0.00  70.38   0.00
   0   0   0   1.37 1.53 2.27   2.01  96.62   0.00  96.29   0.00
   0   0  32   0.38 1.84 2.27   3.00  96.62   0.00  96.29   0.00
   0   1   1   0.43 1.89 2.27   0.47  99.10   0.00  96.29   0.00
   0   1  33   0.34 1.92 2.27   0.55  99.10   0.00  96.30   0.00
   0   2   2   0.33 1.94 2.27   0.12  99.55   0.00  96.30   0.00
   0   2  34   0.32 1.95 2.27   0.13  99.56   0.00  96.31   0.00
   0   3   3   0.33 1.94 2.27   1.48  98.19   0.00  96.31   0.00
   0   3  35   0.32 1.95 2.27   1.49  98.19   0.00  96.31   0.00
   0   8   4   0.33 1.95 2.27   1.47  98.20   0.00  96.32   0.00
   0   8  36   0.31 1.95 2.27   1.49  98.20   0.00  96.32   0.00
   0   9   5   0.33 1.96 2.27   1.46  98.21   0.00  96.32   0.00
   0   9  37   0.30 1.97 2.27   1.48  98.21   0.00  96.33   0.00
   0  10   6   0.33 1.97 2.27   1.45  98.22   0.00  96.33   0.00
   0  10  38   0.30 1.99 2.27   1.47  98.23   0.00  96.33   0.00
   0  11   7   0.34 1.90 2.27   1.44  98.22   0.00  96.34   0.00
   0  11  39   0.34 1.94 2.27   1.44  98.22   0.00  96.34   0.00
   1   0   8  12.29 2.62 2.27   0.09  87.61   0.00  87.37   0.00
   1   0  40   0.34 1.96 2.27  12.05  87.62   0.00  87.37   0.00
   1   1   9   0.35 1.95 2.27   1.41  98.24   0.00  87.37   0.00
   1   1  41   0.32 1.96 2.27   1.43  98.24   0.00  87.38   0.00
   1   2  10   0.34 1.97 2.27   1.41  98.25   0.00  87.38   0.00
   1   2  42   0.33 1.97 2.27   1.41  98.26   0.00  87.38   0.00
   1   3  11   0.34 1.95 2.27   1.41  98.24   0.00  87.38   0.00
   1   3  43   0.33 1.96 2.27   1.42  98.25   0.00  87.39   0.00
   1   8  12   0.33 1.97 2.27   1.38  98.30   0.00  87.39   0.00
   1   8  44   0.30 1.98 2.27   1.40  98.30   0.00  87.39   0.00
   1   9  13   0.32 1.98 2.27   1.37  98.31   0.00  87.40   0.00
   1   9  45   0.31 1.99 2.27   1.39  98.31   0.00  87.40   0.00
   1  10  14   0.33 1.99 2.27   1.37  98.30   0.00  87.40   0.00
   1  10  46   0.32 2.01 2.27   1.38  98.30   0.00  87.40   0.00
   1  11  15   0.34 1.93 2.27   0.13  99.54   0.00  87.41   0.00
   1  11  47   0.35 1.97 2.27   0.11  99.54   0.00  87.41   0.00
   2   0  16   0.36 1.88 2.27   1.35  98.29   0.00  97.75   0.00
   2   0  48   0.35 1.89 2.27   1.37  98.29   0.00  97.75   0.00
   2   1  17   0.36 1.87 2.27   0.37  99.26   0.00  97.75   0.00
   2   1  49   0.50 1.96 2.27   0.23  99.27   0.00  97.75   0.00
   2   2  18   0.35 1.88 2.27   0.54  99.10   0.00  97.75   0.00
   2   2  50   0.41 1.75 2.27   0.49  99.11   0.00  97.75   0.00
   2   3  19   0.33 1.93 2.27   1.31  98.36   0.00  97.76   0.00
   2   3  51   0.32 1.94 2.26   1.32  98.37   0.00  97.76   0.00
   2   8  20   0.34 1.95 2.26   1.30  98.36   0.00  97.76   0.00
   2   8  52   0.33 1.96 2.26   1.31  98.37   0.00  97.77   0.00
   2   9  21   0.33 1.94 2.26   1.28  98.38   0.00  97.77   0.00
   2   9  53   0.31 1.95 2.26   1.30  98.39   0.00  97.77   0.00
   2  10  22   0.33 1.94 2.26   1.28  98.39   0.00  97.78   0.00
   2  10  54   0.31 1.96 2.26   1.29  98.40   0.00  97.78   0.00
   2  11  23   0.35 1.88 2.26   1.26  98.39   0.00  97.78   0.00
   2  11  55   0.35 1.93 2.26   1.26  98.39   0.00  97.79   0.00
   3   0  24  22.63 2.12 2.26  54.65  22.72   0.00   0.01   0.00
   3   0  56   0.38 2.36 2.26  76.90  22.72   0.00   0.01   0.00
   3   1  25  24.08 2.12 2.26  46.84  29.08   0.00   0.01   0.00
   3   1  57   0.40 2.32 2.26  70.52  29.08   0.00   0.01   0.00
   3   2  26  25.21 2.12 2.26  39.84  34.95   0.00   0.01   0.00
   3   2  58   0.37 2.36 2.26  64.68  34.95   0.00   0.01   0.00
   3   3  27  25.35 2.12 2.26  40.20  34.45   0.00   0.01   0.00
   3   3  59   0.37 2.36 2.26  65.18  34.45   0.00   0.01   0.00
   3   8  28  25.60 2.12 2.26  40.30  34.10   0.00   0.01   0.00
   3   8  60   0.36 2.37 2.26  65.54  34.10   0.00   0.01   0.00
   3   9  29  20.63 2.16 2.26  70.53   8.85   0.00   0.01   0.00
   3   9  61   0.38 2.34 2.26  90.77   8.85   0.00   0.01   0.00
   3  10  30  25.61 2.12 2.26  40.04  34.36   0.00   0.01   0.00
   3  10  62   0.37 2.37 2.26  65.28  34.36   0.00   0.01   0.00
   3  11  31  25.58 2.12 2.26  39.80  34.62   0.00   0.01   0.00
   3  11  63   0.38 2.36 2.26  65.00  34.62   0.00   0.01   0.00
5.009084 sec
GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               3.32 2.20 2.26  14.79  81.89   0.00  72.75   0.00
   0   0   0   2.11 1.58 2.26   1.42  96.47   0.00  95.45   0.00
   0   0  32   0.76 2.19 2.26   2.78  96.46   0.00  95.44   0.00
   0   1   1   0.56 1.92 2.26   0.41  99.03   0.00  95.44   0.00
   0   1  33   0.50 2.08 2.26   0.47  99.03   0.00  95.44   0.00
   0   2   2   0.33 1.93 2.26   0.84  98.83   0.00  95.43   0.00
   0   2  34   0.37 1.98 2.26   0.80  98.83   0.00  95.43   0.00
   0   3   3   0.33 1.93 2.26   0.77  98.90   0.00  95.42   0.00
   0   3  35   0.31 1.94 2.26   0.79  98.90   0.00  95.42   0.00
   0   8   4   0.32 1.93 2.26   0.78  98.90   0.00  95.42   0.00
   0   8  36   0.31 1.95 2.26   0.80  98.89   0.00  95.41   0.00
   0   9   5   0.33 1.93 2.26   0.78  98.90   0.00  95.40   0.00
   0   9  37   0.30 1.96 2.26   0.80  98.89   0.00  95.39   0.00
   0  10   6   0.31 1.96 2.26   0.77  98.91   0.00  95.39   0.00
   0  10  38   0.30 1.97 2.26   0.79  98.91   0.00  95.38   0.00
   0  11   7   0.34 1.90 2.26   0.76  98.90   0.00  95.37   0.00
   0  11  39   0.34 1.94 2.26   0.76  98.90   0.00  95.37   0.00
   1   0   8   0.43 1.81 2.26   0.77  98.80   0.00  98.33   0.00
   1   0  40   0.33 1.89 2.26   0.88  98.80   0.00  98.33   0.00
   1   1   9   0.43 1.84 2.26   0.33  99.23   0.00  98.32   0.00
   1   1  41   0.50 2.04 2.26   0.27  99.23   0.00  98.32   0.00
   1   2  10   0.46 1.83 2.26   0.82  98.72   0.00  98.31   0.00
   1   2  42   0.42 1.93 2.26   0.86  98.72   0.00  98.31   0.00
   1   3  11   0.33 1.91 2.26   0.74  98.93   0.00  98.31   0.00
   1   3  43   0.32 1.91 2.26   0.76  98.92   0.00  98.30   0.00
   1   8  12   0.32 1.92 2.26   0.73  98.95   0.00  98.29   0.00
   1   8  44   0.31 1.93 2.26   0.74  98.95   0.00  98.29   0.00
   1   9  13   0.33 1.94 2.26   0.72  98.95   0.00  98.28   0.00
   1   9  45   0.31 1.95 2.26   0.74  98.95   0.00  98.28   0.00
   1  10  14   0.32 1.94 2.26   0.73  98.94   0.00  98.27   0.00
   1  10  46   0.31 1.96 2.26   0.75  98.94   0.00  98.27   0.00
   1  11  15   0.33 1.87 2.26   0.73  98.94   0.00  98.26   0.00
   1  11  47   0.35 1.92 2.26   0.71  98.94   0.00  98.26   0.00
   2   0  16   0.36 1.87 2.26   0.71  98.93   0.00  97.44   0.00
   2   0  48   0.34 1.89 2.26   0.73  98.93   0.00  97.43   0.00
   2   1  17   0.41 1.80 2.26   1.10  98.49   0.00  97.43   0.00
   2   1  49   1.06 2.24 2.26   0.45  98.49   0.00  97.43   0.00
   2   2  18   0.36 1.88 2.26   0.86  98.78   0.00  97.42   0.00
   2   2  50   0.40 1.80 2.26   0.83  98.78   0.00  97.42   0.00
   2   3  19   0.34 1.90 2.26   0.73  98.93   0.00  97.41   0.00
   2   3  51   0.34 1.92 2.26   0.73  98.93   0.00  97.41   0.00
   2   8  20   0.34 1.93 2.26   0.12  99.54   0.00  97.40   0.00
   2   8  52   0.32 1.96 2.26   0.14  99.54   0.00  97.40   0.00
   2   9  21   0.34 1.93 2.26   0.68  98.98   0.00  97.40   0.00
   2   9  53   0.32 1.96 2.26   0.71  98.97   0.00  97.39   0.00
   2  10  22   0.35 1.90 2.26   0.73  98.93   0.00  97.39   0.00
   2  10  54   0.32 1.93 2.26   0.75  98.92   0.00  97.38   0.00
   2  11  23   0.36 1.83 2.26   0.73  98.91   0.00  97.38   0.00
   2  11  55   0.37 1.88 2.26   0.72  98.91   0.00  97.38   0.00
   3   0  24  23.45 2.23 2.26  39.49  37.06   0.00   0.00   0.00
   3   0  56   0.37 2.38 2.26  62.57  37.06   0.00   0.00   0.00
   3   1  25  29.87 2.27 2.26  39.27  30.86   0.00   0.00   0.00
   3   1  57   0.56 2.14 2.26  68.58  30.86   0.00   0.00   0.00
   3   2  26  22.93 2.22 2.26  42.96  34.10   0.00   0.00   0.00
   3   2  58   0.41 2.38 2.26  65.49  34.10   0.00   0.00   0.00
   3   3  27  24.10 2.22 2.26  37.63  38.27   0.00   0.00   0.00
   3   3  59   0.37 2.39 2.26  61.37  38.26   0.00   0.00   0.00
   3   8  28  21.83 2.20 2.26  53.12  25.06   0.00   0.00   0.00
   3   8  60   0.38 2.38 2.26  74.57  25.06   0.00   0.00   0.00
   3   9  29  18.89 2.25 2.26  72.83   8.29   0.00   0.00   0.00
   3   9  61   0.39 2.39 2.26  91.33   8.28   0.00   0.00   0.00
   3  10  30  24.00 2.22 2.26  38.22  37.78   0.00   0.00   0.00
   3  10  62   0.36 2.38 2.26  61.86  37.78   0.00   0.00   0.00
   3  11  31  24.25 2.23 2.26  37.82  37.93   0.00   0.00   0.00
   3  11  63   0.38 2.39 2.26  61.69  37.93   0.00   0.00   0.00
5.023682 sec
GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               3.73 2.33 2.26  17.24  79.03   0.00  72.26   0.00
   0   0   0   1.38 1.54 2.27   0.86  97.76   0.00  95.00   0.00
   0   0  32   0.39 1.78 2.27   1.85  97.76   0.00  94.99   0.00
   0   1   1   0.82 1.95 2.27   0.15  99.02   0.00  95.00   0.00
   0   1  33   0.34 1.90 2.27   0.64  99.02   0.00  95.00   0.00
   0   2   2   0.34 1.93 2.27   2.40  97.26   0.00  95.00   0.00
   0   2  34   0.32 1.95 2.27   2.42  97.26   0.00  95.00   0.00
   0   3   3   0.33 1.93 2.27   2.39  97.28   0.00  95.00   0.00
   0   3  35   0.31 1.94 2.27   2.40  97.28   0.00  95.00   0.00
   0   8   4   0.33 1.94 2.27   2.39  97.28   0.00  95.00   0.00
   0   8  36   0.31 1.95 2.27   2.41  97.28   0.00  95.01   0.00
   0   9   5   0.33 1.95 2.26   2.38  97.30   0.00  95.01   0.00
   0   9  37   0.31 1.96 2.26   2.40  97.30   0.00  95.01   0.00
   0  10   6   0.32 1.97 2.26   2.37  97.31   0.00  95.01   0.00
   0  10  38   0.31 1.97 2.26   2.39  97.31   0.00  95.01   0.00
   0  11   7   0.33 1.88 2.26   2.37  97.30   0.00  95.01   0.00
   0  11  39   0.34 1.93 2.26   2.36  97.30   0.00  95.01   0.00
   1   0   8   0.34 1.88 2.26   2.31  97.35   0.00  97.13   0.00
   1   0  40   0.33 1.89 2.27   2.33  97.34   0.00  97.12   0.00
   1   1   9   0.34 1.92 2.27   0.32  99.33   0.00  97.12   0.00
   1   1  41   0.52 2.10 2.27   0.14  99.34   0.00  97.12   0.00
   1   2  10   0.33 1.93 2.27   2.34  97.33   0.00  97.12   0.00
   1   2  42   0.33 1.90 2.27   2.33  97.33   0.00  97.12   0.00
   1   3  11   0.33 1.93 2.26   2.33  97.34   0.00  97.13   0.00
   1   3  43   0.33 1.91 2.26   2.33  97.34   0.00  97.13   0.00
   1   8  12   0.32 1.94 2.26   2.31  97.37   0.00  97.13   0.00
   1   8  44   0.31 1.94 2.26   2.32  97.37   0.00  97.12   0.00
   1   9  13   0.32 1.95 2.26   2.30  97.37   0.00  97.13   0.00
   1   9  45   0.31 1.95 2.26   2.31  97.37   0.00  97.13   0.00
   1  10  14   0.32 1.95 2.26   2.30  97.37   0.00  97.13   0.00
   1  10  46   0.31 1.96 2.26   2.31  97.37   0.00  97.13   0.00
   1  11  15   0.34 1.89 2.26   2.29  97.37   0.00  97.13   0.00
   1  11  47   0.35 1.93 2.26   2.27  97.38   0.00  97.13   0.00
   2   0  16   0.35 1.89 2.26   2.27  97.38   0.00  96.88   0.00
   2   0  48   0.34 1.89 2.26   2.28  97.38   0.00  96.88   0.00
   2   1  17   0.36 1.89 2.26   2.38  97.26   0.00  96.88   0.00
   2   1  49   0.41 1.86 2.26   2.33  97.26   0.00  96.88   0.00
   2   2  18   0.35 1.89 2.26   2.38  97.27   0.00  96.89   0.00
   2   2  50   0.38 1.86 2.26   2.35  97.27   0.00  96.89   0.00
   2   3  19   0.33 1.93 2.26   2.24  97.42   0.00  96.89   0.00
   2   3  51   0.33 1.94 2.26   2.25  97.42   0.00  96.89   0.00
   2   8  20   0.33 1.95 2.26   2.22  97.44   0.00  96.90   0.00
   2   8  52   0.32 1.96 2.26   2.24  97.44   0.00  96.90   0.00
   2   9  21   0.33 1.94 2.26   2.21  97.46   0.00  96.90   0.00
   2   9  53   0.31 1.95 2.26   2.23  97.46   0.00  96.90   0.00
   2  10  22   0.33 1.94 2.26   2.21  97.45   0.00  96.90   0.00
   2  10  54   0.32 1.96 2.26   2.23  97.45   0.00  96.90   0.00
   2  11  23   0.35 1.88 2.26   2.20  97.45   0.00  96.90   0.00
   2  11  55   0.35 1.93 2.26   2.20  97.45   0.00  96.90   0.00
   3   0  24  38.90 2.37 2.26  46.33  14.77   0.00   0.00   0.00
   3   0  56   0.38 2.40 2.26  84.85  14.77   0.00   0.00   0.00
   3   1  25  38.88 2.37 2.26  43.26  17.86   0.00   0.00   0.00
   3   1  57   0.41 2.40 2.26  81.72  17.86   0.00   0.00   0.00
   3   2  26  24.56 2.36 2.26  42.69  32.75   0.00   0.00   0.00
   3   2  58   0.38 2.40 2.26  66.87  32.75   0.00   0.00   0.00
   3   3  27  23.57 2.35 2.26  47.96  28.48   0.00   0.00   0.00
   3   3  59   0.38 2.40 2.26  71.14  28.48   0.00   0.00   0.00
   3   8  28  24.84 2.35 2.26  43.04  32.12   0.00   0.00   0.00
   3   8  60   0.37 2.40 2.26  67.50  32.13   0.00   0.00   0.00
   3   9  29  19.74 2.36 2.26  73.41   6.85   0.00   0.00   0.00
   3   9  61   0.40 2.40 2.26  92.75   6.85   0.00   0.00   0.00
   3  10  30  23.73 2.35 2.26  49.21  27.06   0.00   0.00   0.00
   3  10  62   0.38 2.40 2.26  72.56  27.06   0.00   0.00   0.00
   3  11  31  24.01 2.35 2.26  47.64  28.35   0.00   0.00   0.00
   3  11  63   0.37 2.40 2.26  71.28  28.35   0.00   0.00   0.00
5.011165 sec
GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               3.27 2.09 2.26  14.38  82.35   0.00  72.86   0.00
   0   0   0   1.42 1.51 2.26   1.95  96.63   0.00  96.14   0.00
   0   0  32   0.36 1.82 2.26   3.01  96.63   0.00  96.13   0.00
   0   1   1   0.57 1.99 2.26   1.39  98.04   0.00  96.13   0.00
   0   1  33   0.33 1.89 2.26   1.63  98.04   0.00  96.13   0.00
   0   2   2   0.33 1.92 2.26   1.36  98.31   0.00  96.12   0.00
   0   2  34   0.31 1.92 2.26   1.38  98.31   0.00  96.12   0.00
   0   3   3   0.32 1.92 2.26   1.36  98.32   0.00  96.12   0.00
   0   3  35   0.31 1.92 2.26   1.37  98.32   0.00  96.11   0.00
   0   8   4   0.32 1.93 2.26   1.37  98.31   0.00  96.11   0.00
   0   8  36   0.31 1.94 2.26   1.38  98.31   0.00  96.11   0.00
   0   9   5   0.33 1.93 2.26   1.36  98.31   0.00  96.10   0.00
   0   9  37   0.31 1.95 2.26   1.38  98.31   0.00  96.10   0.00
   0  10   6   0.32 1.96 2.26   1.32  98.36   0.00  96.10   0.00
   0  10  38   0.31 1.96 2.26   1.33  98.36   0.00  96.09   0.00
   0  11   7   0.33 1.87 2.26   1.32  98.35   0.00  96.09   0.00
   0  11  39   0.34 1.92 2.26   1.31  98.35   0.00  96.09   0.00
   1   0   8   0.34 1.87 2.26   1.21  98.45   0.00  98.20   0.00
   1   0  40   0.33 1.89 2.26   1.22  98.45   0.00  98.19   0.00
   1   1   9   0.34 1.89 2.26   0.25  99.41   0.00  98.19   0.00
   1   1  41   0.43 2.02 2.26   0.17  99.41   0.00  98.19   0.00
   1   2  10   0.33 1.90 2.26   1.14  98.53   0.00  98.18   0.00
   1   2  42   0.32 1.90 2.26   1.15  98.53   0.00  98.18   0.00
   1   3  11   0.34 1.91 2.26   0.98  98.68   0.00  98.17   0.00
   1   3  43   0.32 1.91 2.26   1.00  98.67   0.00  98.17   0.00
   1   8  12   0.33 1.92 2.26   0.96  98.71   0.00  98.17   0.00
   1   8  44   0.31 1.93 2.26   0.98  98.71   0.00  98.16   0.00
   1   9  13   0.32 1.92 2.26   0.96  98.72   0.00  98.16   0.00
   1   9  45   0.30 1.94 2.26   0.98  98.72   0.00  98.15   0.00
   1  10  14   0.33 1.92 2.26   0.81  98.86   0.00  98.15   0.00
   1  10  46   0.31 1.95 2.26   0.83  98.86   0.00  98.15   0.00
   1  11  15   0.34 1.87 2.26   0.79  98.87   0.00  98.14   0.00
   1  11  47   0.34 1.91 2.26   0.79  98.87   0.00  98.14   0.00
   2   0  16   0.36 1.88 2.26   1.30  98.34   0.00  97.27   0.00
   2   0  48   0.35 1.90 2.26   1.32  98.33   0.00  97.26   0.00
   2   1  17   0.36 1.87 2.26   1.98  97.66   0.00  97.26   0.00
   2   1  49   0.93 2.31 2.26   1.41  97.66   0.00  97.26   0.00
   2   2  18   0.36 1.89 2.26   0.73  98.91   0.00  97.25   0.00
   2   2  50   0.37 1.84 2.26   0.72  98.91   0.00  97.25   0.00
   2   3  19   0.34 1.92 2.26   0.46  99.21   0.00  97.24   0.00
   2   3  51   0.32 1.95 2.26   0.48  99.20   0.00  97.24   0.00
   2   8  20   0.34 1.93 2.26   0.45  99.21   0.00  97.23   0.00
   2   8  52   0.32 1.96 2.26   0.47  99.21   0.00  97.23   0.00
   2   9  21   0.33 1.93 2.26   0.44  99.22   0.00  97.22   0.00
   2   9  53   0.31 1.97 2.26   0.47  99.22   0.00  97.22   0.00
   2  10  22   0.34 1.93 2.26   1.28  98.38   0.00  97.22   0.00
   2  10  54   0.32 1.98 2.26   1.30  98.38   0.00  97.22   0.00
   2  11  23   0.35 1.86 2.26   0.28  99.37   0.00  97.21   0.00
   2  11  55   0.35 1.94 2.26   0.29  99.36   0.00  97.21   0.00
   3   0  24  21.60 2.10 2.26  54.17  24.24   0.00   0.01   0.00
   3   0  56   0.36 2.35 2.26  75.40  24.24   0.00   0.01   0.00
   3   1  25  24.37 2.12 2.26  36.34  39.30   0.00   0.01   0.00
   3   1  57   0.40 2.35 2.26  60.31  39.30   0.00   0.01   0.00
   3   2  26  24.36 2.11 2.26  35.56  40.08   0.00   0.01   0.00
   3   2  58   0.37 2.36 2.26  59.55  40.08   0.00   0.01   0.00
   3   3  27  24.50 2.11 2.26  36.15  39.35   0.00   0.01   0.00
   3   3  59   0.36 2.35 2.26  60.29  39.35   0.00   0.01   0.00
   3   8  28  24.59 2.10 2.26  36.24  39.17   0.00   0.01   0.00
   3   8  60   0.35 2.36 2.26  60.48  39.17   0.00   0.01   0.00
   3   9  29  19.32 2.15 2.26  70.96   9.72   0.00   0.01   0.00
   3   9  61   0.42 2.36 2.26  89.87   9.72   0.00   0.01   0.00
   3  10  30  24.61 2.10 2.26  36.09  39.30   0.00   0.01   0.00
   3  10  62   0.36 2.36 2.26  60.34  39.30   0.00   0.01   0.00
   3  11  31  24.66 2.10 2.26  35.88  39.46   0.00   0.01   0.00
   3  11  63   0.36 2.36 2.26  60.18  39.46   0.00   0.01   0.00
5.021344 sec
GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               3.88 2.22 2.26  15.10  81.02   0.00  72.09   0.00
   0   0   0   2.59 1.56 2.26   2.36  95.05   0.00  94.36   0.00
   0   0  32   0.38 1.82 2.26   4.57  95.05   0.00  94.36   0.00
   0   1   1   0.70 1.91 2.26   0.73  98.56   0.00  94.36   0.00
   0   1  33   0.69 2.14 2.26   0.74  98.57   0.00  94.37   0.00
   0   2   2   0.33 1.92 2.26   0.65  99.02   0.00  94.37   0.00
   0   2  34   0.35 1.97 2.26   0.63  99.02   0.00  94.37   0.00
   0   3   3   0.32 1.92 2.26   0.57  99.10   0.00  94.36   0.00
   0   3  35   0.31 1.93 2.26   0.59  99.10   0.00  94.36   0.00
   0   8   4   0.33 1.94 2.26   0.57  99.10   0.00  94.36   0.00
   0   8  36   0.31 1.95 2.26   0.59  99.10   0.00  94.36   0.00
   0   9   5   0.32 1.94 2.26   0.57  99.11   0.00  94.37   0.00
   0   9  37   0.30 1.95 2.26   0.59  99.11   0.00  94.37   0.00
   0  10   6   0.32 1.95 2.26   0.56  99.12   0.00  94.37   0.00
   0  10  38   0.30 1.96 2.26   0.58  99.12   0.00  94.37   0.00
   0  11   7   0.33 1.89 2.26   0.56  99.11   0.00  94.37   0.00
   0  11  39   0.35 1.93 2.26   0.54  99.11   0.00  94.37   0.00
   1   0   8   0.39 1.86 2.26   0.51  99.09   0.00  97.45   0.00
   1   0  40   0.34 1.91 2.26   0.57  99.09   0.00  97.45   0.00
   1   1   9   0.44 1.76 2.26   1.55  98.02   0.00  97.45   0.00
   1   1  41   1.38 2.31 2.26   0.61  98.02   0.00  97.45   0.00
   1   2  10   0.35 1.92 2.26   0.14  99.51   0.00  97.45   0.00
   1   2  42   0.34 1.91 2.26   0.15  99.51   0.00  97.45   0.00
   1   3  11   0.34 1.94 2.26   0.48  99.18   0.00  97.45   0.00
   1   3  43   0.34 1.92 2.26   0.48  99.18   0.00  97.45   0.00
   1   8  12   0.33 1.95 2.26   0.45  99.22   0.00  97.45   0.00
   1   8  44   0.32 1.94 2.26   0.46  99.22   0.00  97.45   0.00
   1   9  13   0.33 1.96 2.26   0.45  99.22   0.00  97.45   0.00
   1   9  45   0.32 1.95 2.26   0.46  99.22   0.00  97.45   0.00
   1  10  14   0.33 1.97 2.26   0.45  99.22   0.00  97.45   0.00
   1  10  46   0.32 1.97 2.26   0.46  99.22   0.00  97.45   0.00
   1  11  15   0.34 1.89 2.26   0.44  99.22   0.00  97.45   0.00
   1  11  47   0.36 1.92 2.26   0.42  99.22   0.00  97.45   0.00
   2   0  16   0.58 1.97 2.26   0.54  98.88   0.00  96.52   0.00
   2   0  48   0.35 1.89 2.26   0.76  98.89   0.00  96.52   0.00
   2   1  17   0.49 1.74 2.26   2.00  97.51   0.00  96.52   0.00
   2   1  49   1.81 2.35 2.26   0.68  97.51   0.00  96.52   0.00
   2   2  18   0.37 1.89 2.26   0.60  99.02   0.00  96.52   0.00
   2   2  50   0.42 1.79 2.26   0.55  99.03   0.00  96.53   0.00
   2   3  19   0.36 1.91 2.26   0.49  99.15   0.00  96.53   0.00
   2   3  51   0.37 1.90 2.26   0.47  99.15   0.00  96.53   0.00
   2   8  20   0.34 1.95 2.26   0.39  99.27   0.00  96.53   0.00
   2   8  52   0.32 1.94 2.26   0.41  99.27   0.00  96.53   0.00
   2   9  21   0.34 1.95 2.26   0.38  99.28   0.00  96.54   0.00
   2   9  53   0.32 1.96 2.26   0.40  99.28   0.00  96.54   0.00
   2  10  22   0.34 1.95 2.26   0.39  99.27   0.00  96.54   0.00
   2  10  54   0.33 1.96 2.26   0.41  99.27   0.00  96.54   0.00
   2  11  23   0.35 1.87 2.26   0.13  99.52   0.00  96.54   0.00
   2  11  55   0.36 1.93 2.26   0.12  99.52   0.00  96.54   0.00
   3   0  24  41.44 2.30 2.26  29.71  28.85   0.00   0.01   0.00
   3   0  56   0.40 2.38 2.26  70.75  28.85   0.00   0.01   0.00
   3   1  25  40.89 2.29 2.26  35.82  23.30   0.00   0.01   0.00
   3   1  57   0.58 2.30 2.26  76.13  23.30   0.00   0.01   0.00
   3   2  26  23.28 2.21 2.26  49.56  27.16   0.00   0.01   0.00
   3   2  58   0.43 2.38 2.26  72.42  27.16   0.00   0.01   0.00
   3   3  27  24.34 2.21 2.26  42.50  33.16   0.00   0.01   0.00
   3   3  59   0.38 2.38 2.26  66.46  33.16   0.00   0.01   0.00
   3   8  28  24.35 2.21 2.26  42.62  33.03   0.00   0.01   0.00
   3   8  60   0.37 2.38 2.26  66.59  33.03   0.00   0.01   0.00
   3   9  29  19.99 2.24 2.26  71.27   8.73   0.00   0.01   0.00
   3   9  61   0.41 2.32 2.26  90.86   8.73   0.00   0.01   0.00
   3  10  30  24.33 2.20 2.26  42.93  32.74   0.00   0.01   0.00
   3  10  62   0.38 2.38 2.26  66.88  32.74   0.00   0.01   0.00
   3  11  31  24.49 2.21 2.26  42.75  32.76   0.00   0.01   0.00
   3  11  63   0.38 2.38 2.26  66.86  32.76   0.00   0.01   0.00
5.009698 sec
GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2e:6 (6:46:6)
8 * 133 = 1067 MHz max efficiency
17 * 133 = 2267 MHz TSC frequency
pkg core CPU   %c0   GHz  TSC   %c1    %c3    %c6   %pc3   %pc6 
               4.10 2.09 2.26  14.93  80.97   0.00  62.47   0.00
   0   0   0   1.41 1.58 2.26   2.84  95.75   0.00  95.27   0.00
   0   0  32   0.36 1.82 2.26   3.90  95.74   0.00  95.26   0.00
   0   1   1   0.60 1.95 2.26   0.34  99.05   0.00  95.26   0.00
   0   1  33   0.51 2.07 2.26   0.44  99.05   0.00  95.25   0.00
   0   2   2   0.33 1.92 2.26   2.04  97.64   0.00  95.25   0.00
   0   2  34   0.31 1.93 2.26   2.05  97.64   0.00  95.25   0.00
   0   3   3   0.32 1.93 2.26   2.37  97.30   0.00  95.25   0.00
   0   3  35   0.31 1.93 2.26   2.39  97.30   0.00  95.25   0.00
   0   8   4   0.32 1.93 2.26   2.37  97.31   0.00  95.25   0.00
   0   8  36   0.30 1.93 2.26   2.38  97.31   0.00  95.25   0.00
   0   9   5   0.32 1.93 2.26   2.36  97.31   0.00  95.25   0.00
   0   9  37   0.30 1.95 2.26   2.39  97.31   0.00  95.25   0.00
   0  10   6   0.32 1.97 2.26   2.36  97.32   0.00  95.25   0.00
   0  10  38   0.31 1.96 2.26   2.37  97.32   0.00  95.25   0.00
   0  11   7   0.32 1.87 2.26   1.70  97.97   0.00  95.25   0.00
   0  11  39   0.33 1.91 2.26   1.70  97.97   0.00  95.24   0.00
   1   0   8   0.33 2.06 2.26   2.31  97.36   0.00  58.44   0.00
   1   0  40   0.31 2.08 2.26   2.33  97.36   0.00  58.44   0.00
   1   1   9   0.32 2.07 2.26   1.50  98.18   0.00  58.44   0.00
   1   1  41   0.32 2.09 2.26   1.51  98.18   0.00  58.44   0.00
   1   2  10   0.32 2.09 2.26   2.31  97.37   0.00  58.45   0.00
   1   2  42   0.31 2.10 2.26   2.32  97.37   0.00  58.45   0.00
   1   3  11  40.11 2.65 2.26   1.31  58.58   0.00  58.45   0.00
   1   3  43   0.34 2.13 2.26  41.08  58.58   0.00  58.44   0.00
   1   8  12   0.32 2.11 2.26   2.30  97.39   0.00  58.44   0.00
   1   8  44   0.30 2.12 2.26   2.32  97.39   0.00  58.44   0.00
   1   9  13   0.32 2.12 2.26   1.32  98.36   0.00  58.44   0.00
   1   9  45   0.30 2.13 2.26   1.34  98.36   0.00  58.44   0.00
   1  10  14   0.31 2.12 2.26   2.30  97.39   0.00  58.43   0.00
   1  10  46   0.29 2.12 2.26   2.31  97.40   0.00  58.44   0.00
   1  11  15   0.32 2.07 2.26   2.28  97.40   0.00  58.43   0.00
   1  11  47   0.32 2.09 2.26   2.28  97.40   0.00  58.43   0.00
   2   0  16   0.51 2.11 2.26   0.16  99.33   0.00  96.18   0.00
   2   0  48   0.34 1.88 2.26   0.32  99.34   0.00  96.19   0.00
   2   1  17   0.40 1.85 2.26   0.87  98.73   0.00  96.19   0.00
   2   1  49   0.94 2.32 2.26   0.33  98.73   0.00  96.18   0.00
   2   2  18   0.35 1.91 2.26   2.36  97.29   0.00  96.18   0.00
   2   2  50   0.36 1.86 2.26   2.35  97.29   0.00  96.18   0.00
   2   3  19   0.33 1.95 2.26   2.26  97.41   0.00  96.18   0.00
   2   3  51   0.32 1.95 2.26   2.28  97.41   0.00  96.17   0.00
   2   8  20   0.33 1.96 2.26   2.25  97.42   0.00  96.18   0.00
   2   8  52   0.31 1.96 2.26   2.27  97.42   0.00  96.18   0.00
   2   9  21   0.33 1.96 2.26   2.25  97.42   0.00  96.17   0.00
   2   9  53   0.31 1.97 2.26   2.27  97.42   0.00  96.18   0.00
   2  10  22   0.33 1.96 2.26   2.25  97.42   0.00  96.17   0.00
   2  10  54   0.31 1.98 2.26   2.27  97.42   0.00  96.17   0.00
   2  11  23   0.34 1.88 2.26   2.25  97.41   0.00  96.18   0.00
   2  11  55   0.34 1.94 2.26   2.24  97.42   0.00  96.18   0.00
   3   0  24  24.70 1.99 2.26  37.79  37.51   0.00   0.02   0.00
   3   0  56   0.36 2.33 2.26  62.13  37.51   0.00   0.02   0.00
   3   1  25  25.58 1.99 2.26  33.83  40.59   0.00   0.02   0.00
   3   1  57   0.38 2.29 2.26  59.03  40.59   0.00   0.02   0.00
   3   2  26  25.92 1.99 2.26  33.57  40.51   0.00   0.02   0.00
   3   2  58   0.35 2.33 2.26  59.14  40.51   0.00   0.02   0.00
   3   3  27  26.09 1.98 2.26  34.14  39.77   0.00   0.02   0.00
   3   3  59   0.37 2.33 2.26  59.87  39.77   0.00   0.02   0.00
   3   8  28  26.04 1.98 2.26  34.60  39.37   0.00   0.02   0.00
   3   8  60   0.36 2.32 2.26  60.28  39.37   0.00   0.02   0.00
   3   9  29  20.88 2.03 2.26  68.17  10.95   0.00   0.02   0.00
   3   9  61   0.42 2.23 2.26  88.63  10.95   0.00   0.02   0.00
   3  10  30  26.22 1.97 2.26  34.80  38.98   0.00   0.02   0.00
   3  10  62   0.36 2.32 2.26  60.66  38.98   0.00   0.02   0.00
   3  11  31  26.08 1.98 2.26  34.48  39.43   0.00   0.02   0.00
   3  11  63   0.35 2.34 2.26  60.21  39.43   0.00   0.02   0.00
5.014038 sec

^ permalink raw reply

* Re: DSCP values in TCP handshake
From: Stephen Hemminger @ 2011-04-19  4:16 UTC (permalink / raw)
  To: Mikael Abrahamsson; +Cc: Joe Buehler, Eric Dumazet, netdev
In-Reply-To: <alpine.DEB.2.00.1104190547300.14027@uplift.swm.pp.se>

On Tue, 19 Apr 2011 05:50:34 +0200 (CEST)
Mikael Abrahamsson <swmike@swm.pp.se> wrote:

> On Mon, 18 Apr 2011, Stephen Hemminger wrote:
> 
> > If the DSCP bits are reflected, then it could allow for even better SYN 
> > flood attack. Attacker could maliciously set DSCP to elevate priority 
> > processing of his bogus SYN packets and also cause SYN-ACK on reverse 
> > path to also take priority.
> 
> Incoming, it's already too late. Outgoing, yes, that might be a problem, 
> but if you have a QoS enabled network then you might as well solve that in 
> the network, not in the host.
> 
> Does Linux internally look at DSCP when deciding what SYNs to handle 
> first? If not, I think the above reasoning is misdirected.

Linux does not look at DSCP of incoming packets (there is no queue).

Of course, you can do anything with qdisc, and iptables.

^ permalink raw reply

* Re: DSCP values in TCP handshake
From: Mikael Abrahamsson @ 2011-04-19  4:28 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Joe Buehler, Eric Dumazet, netdev
In-Reply-To: <20110418211637.57f1cfb8@nehalam>

On Mon, 18 Apr 2011, Stephen Hemminger wrote:

> Linux does not look at DSCP of incoming packets (there is no queue).

Then I see no reason for the policy of not reflecting DSCP.

If we receive the DSCP marked packet then it means the network is either 
not QoS enabled (it doesn't care) or it's actually allowed through the 
border router with DSCP unchanged. Either means it's safe to reflect the 
DSCP value, either it will have no effect or it's actually meant to be 
prioritized.

With precedence, it originally was mandated that if the precedence value 
changed, the TCP session should be reset. Fortunately, this was changed 
but I would still say that it's thought that DSCP values should be 
reflected by the server.

For instance:

<http://tools.ietf.org/html/draft-ietf-ieprep-reflexive-dscp-02>

"The requester could initiate this. Thus, if the DSCP
    received on one TCP segment differs from the TCP used on a prior TCP
    segment in a session, the new DSCP SHOULD be reflected unless local
    policy prevents this."

I don't know why this didn't make it into RFC, I can inquiry if there is 
interest.

-- 
Mikael Abrahamsson    email: swmike@swm.pp.se

^ permalink raw reply

* Re: [PATCH 2.6.36 1/1] IPv6: Create temp address based on advertised network prefix
From: Ben Hutchings @ 2011-04-19  5:01 UTC (permalink / raw)
  To: Glenn Wurster
  Cc: David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy,
	Stephen Hemminger, Eric Dumazet, Herbert Xu, netdev, linux-kernel,
	dbarrera
In-Reply-To: <201104182124.18866.glenn@wurster.ca>

On Mon, 2011-04-18 at 21:24 -0400, Glenn Wurster wrote:
> As discussed ;Login: Volume 36, number 1,

Either provide a non-paywalled reference or a *much* fuller explanation
in the commit message.

> create a temporary address
> by hashing a random value along with the advertised network
> prefix.  This results on the temporary address changing whenever
> the network prefix changes (i.e., the host changes networks), or
> whenever the random value (which can be set by a user-space
> application with sufficient privilege) changes.
> 
> Signed-off-by: Glenn Wurster <gwurster@scs.carleton.ca>
> ---
>  Documentation/networking/ip-sysctl.txt |   20 ++++-
>  include/linux/ipv6.h                   |    4 +
>  include/net/if_inet6.h                 |    3 +
>  net/ipv6/Kconfig                       |   22 +++++
>  net/ipv6/addrconf.c                    |  159 
> +++++++++++++++++++++++++-------
>  5 files changed, 175 insertions(+), 33 deletions(-)
> 
> diff --git a/Documentation/networking/ip-sysctl.txt 
> b/Documentation/networking/ip-sysctl.txt
> index f350c69..b366c28 100644
> --- a/Documentation/networking/ip-sysctl.txt
> +++ b/Documentation/networking/ip-sysctl.txt
> @@ -1128,11 +1128,18 @@ router_solicitations - INTEGER
>  
>  use_tempaddr - INTEGER
>  	Preference for Privacy Extensions (RFC3041).
> +    Bits 0 and 1:
>  	  <= 0 : disable Privacy Extensions
>  	  == 1 : enable Privacy Extensions, but prefer public
>  	         addresses over temporary addresses.
> -	  >  1 : enable Privacy Extensions and prefer temporary
> +	  >= 2 : enable Privacy Extensions and prefer temporary
>  	         addresses over public addresses.
> +    Bit 2:
> +	  == 0 : Use RFC3041 random algorithm for generating
> +             temporary addresses.
> +	  == 1 : Use the output of a hash based on the network prefix
> +	         and random number from temp_random.
> +
>  	Default:  0 (for most devices)
>  		 -1 (for point-to-point devices and loopback devices)

This is pretty awful already, for a sysctl whose name suggests a
boolean.  I think you should add another boolean rather than compounding
it.

> @@ -1144,6 +1151,17 @@ temp_prefered_lft - INTEGER
>  	Preferred lifetime (in seconds) for temporary addresses.
>  	Default: 86400 (1 day)
>  
> +temp_random - INTEGER[4]
> +    Random number used as input to the hash function when
> +	generating temporary addresses also based on the network
> +    prefix.

What's with the
    random
indentation?

> +	 == 0 : Generate a new random value when a temporary address
> +	        is created.  This random value replaces the 0 in
> +			temp_random	
> +      > 0 : A random number used as input to the hash
> +
> +	Default:  0

We have a fairly good random number generator in the kernel; I'm not
sure this setting is really necessary.  We don't do that for e.g. TCP
sequence number generation.

>  max_desync_factor - INTEGER
>  	Maximum value for DESYNC_FACTOR, which is a random value
>  	that ensures that clients don't synchronize with each
> diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
> index e62683b..b9bd404 100644
> --- a/include/linux/ipv6.h
> +++ b/include/linux/ipv6.h
> @@ -172,6 +172,9 @@ struct ipv6_devconf {
>  	__s32		disable_ipv6;
>  	__s32		accept_dad;
>  	__s32		force_tllao;
> +#ifdef CONFIG_IPV6_PRIVACY_HASH
> +	__u32		temp_random[4];
> +#endif
>  	void		*sysctl;
>  };
>  
> @@ -213,6 +216,7 @@ enum {
>  	DEVCONF_DISABLE_IPV6,
>  	DEVCONF_ACCEPT_DAD,
>  	DEVCONF_FORCE_TLLAO,
> +	DEVCONF_TEMP_RANDOM,
>  	DEVCONF_MAX
>  };
>  
> diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
> index f95ff8d..99428bf 100644
> --- a/include/net/if_inet6.h
> +++ b/include/net/if_inet6.h
> @@ -183,6 +183,9 @@ struct inet6_dev {
>  
>  #ifdef CONFIG_IPV6_PRIVACY
>  	u8			rndid[8];
> +#ifdef CONFIG_IPV6_PRIVACY_HASH
> +	__u32       rndid_inc;
> +#endif
>  	struct timer_list	regen_timer;
>  	struct list_head	tempaddr_list;
>  #endif
> diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
> index 36d7437..c0bc79a 100644
> --- a/net/ipv6/Kconfig
> +++ b/net/ipv6/Kconfig
> @@ -39,6 +39,28 @@ config IPV6_PRIVACY
>  
>  	  See <file:Documentation/networking/ip-sysctl.txt> for details.
>  
> +if IPV6_PRIVACY
> +
> +config IPV6_PRIVACY_HASH
> +	bool "IPv6: Privacy Extension Hash Support"
> +	select CRYPTO
> +	select CRYPTO_SHA256
> +	---help---
> +	  Generate the pseudo-random global-scope unicast address(es) based on
> +	  the output of hashing together the broadcast prefix with a random
> +	  value.  The algorithm is discussed in Volume 36, Number 1 of the USENIX
> +	  ;Login: publication.
> +
> +	  To use hash-based temorary addresses, do
> +
> +	         echo 6 >/proc/sys/net/ipv6/conf/all/use_tempaddr
> +
> +	  To modify the input to the hash, do
> +
> +	         echo <random> >/proc/sys/net/ipv6/conf/all/temp_random
> +
> +endif # if IPV6_PRIVACY
> +
>  config IPV6_ROUTER_PREF
>  	bool "IPv6: Router Preference (RFC 4191) support"
>  	---help---
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 89bcb62..4a2eaca 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -118,6 +118,7 @@ static inline void addrconf_sysctl_unregister(struct 
> inet6_dev *idev)
>  #endif
>  
>  #ifdef CONFIG_IPV6_PRIVACY
> +static int __ipv6_is_invalid_rndid(const __u8 * rndid);
>  static int __ipv6_regen_rndid(struct inet6_dev *idev);
>  static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr 
> *tmpaddr);
>  static void ipv6_regen_rndid(unsigned long data);
> @@ -177,6 +178,9 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
>  	.temp_prefered_lft	= TEMP_PREFERRED_LIFETIME,
>  	.regen_max_retry	= REGEN_MAX_RETRY,
>  	.max_desync_factor	= MAX_DESYNC_FACTOR,
> +#ifdef CONFIG_IPV6_PRIVACY_HASH
> +	.temp_random		= { 0, 0, 0, 0 },
> +#endif
>  #endif
>  	.max_addresses		= IPV6_MAX_ADDRESSES,
>  	.accept_ra_defrtr	= 1,
> @@ -211,6 +215,9 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly 
> = {

Your mail client is misconfigured; it wrapped the line above and many
others,

>  	.temp_prefered_lft	= TEMP_PREFERRED_LIFETIME,
>  	.regen_max_retry	= REGEN_MAX_RETRY,
>  	.max_desync_factor	= MAX_DESYNC_FACTOR,
> +#ifdef CONFIG_IPV6_PRIVACY_HASH
> +	.temp_random		= { 0, 0, 0, 0 },
> +#endif
>  #endif
>  	.max_addresses		= IPV6_MAX_ADDRESSES,
>  	.accept_ra_defrtr	= 1,
> @@ -849,6 +856,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, 
> struct inet6_ifaddr *i
>  		memcpy(&addr.s6_addr[8], &ift->addr.s6_addr[8], 8);
>  		spin_unlock_bh(&ift->lock);
>  		tmpaddr = &addr;
> +		ift = NULL;
>  	} else {
>  		tmpaddr = NULL;
>  	}
> @@ -875,17 +883,71 @@ retry:
>  	}
>  	in6_ifa_hold(ifp);
>  	memcpy(addr.s6_addr, ifp->addr.s6_addr, 8);
> -	if (__ipv6_try_regen_rndid(idev, tmpaddr) < 0) {
> -		spin_unlock_bh(&ifp->lock);
> -		write_unlock(&idev->lock);
> -		printk(KERN_WARNING
> -			"ipv6_create_tempaddr(): regeneration of randomized 
> interface id failed.\n");
> -		in6_ifa_put(ifp);
> -		in6_dev_put(idev);
> -		ret = -1;
> -		goto out;
> +#ifdef CONFIG_IPV6_PRIVACY_HASH
> +	while (idev->cnf.use_tempaddr > 4) {

Given that you redefined this as a bitfield, you need to mask out bits
3-31.

> +		char hash[32];
> +		__u32 temp_random[4];
> +		int i;
> +
> +		struct hash_desc desc = { .tfm = NULL, .flags = 0 };
> +		struct scatterlist sg;
> +
> +		BUG_ON (sizeof(temp_random) != sizeof(idev->cnf.temp_random));

BUILD_BUG_ON, please.  And no space after the macro name.

> +		for (i = 0; unlikely(idev->cnf.temp_random[i] == 0) && i < 4; i++);

Last semi-colon goes on a separate line.

Run scripts/checkpatch.pl on your patch and fix the style errors it
points out.

> +		if (unlikely(i == 4))
> +			get_random_bytes(idev->cnf.temp_random, sizeof(idev-
> >cnf.temp_random));
> +
> +		desc.tfm = crypto_alloc_hash ("sha256", 0, CRYPTO_ALG_ASYNC);
> +		if (IS_ERR(desc.tfm)) {
> +			idev->cnf.use_tempaddr &= 0x03;
> +			printk (KERN_WARNING
> +					"ipv6_create_tempaddr(): Hash unavailable, 
> reverting use_tempaddr to %d.\n",
> +					idev->cnf.use_tempaddr);
> +			break;
> +		}
> +
> +		BUG_ON (crypto_hash_digestsize(desc.tfm) > sizeof(hash));
> +		BUG_ON (sizeof(idev->rndid) < 8);

Last of those can be a BUILD_BUG_ON.

> +		crypto_hash_init (&desc);
> +
> +		sg_init_one (&sg, (u8 *)addr.s6_addr, 8);
> +		crypto_hash_update (&desc, &sg, 8);
> +
> +		memcpy (temp_random, idev->cnf.temp_random, sizeof(temp_random));
> +		temp_random[3] += idev->rndid_inc;
> +		sg_init_one (&sg, (u8 *)temp_random, sizeof(temp_random));
> +		crypto_hash_update (&desc, &sg, sizeof(temp_random));
> +
> +		crypto_hash_final (&desc, hash);
> +		crypto_free_hash (desc.tfm);
> +
> +		memcpy (&addr.s6_addr[8], hash, 8);
> +		if (__ipv6_is_invalid_rndid(&addr.s6_addr[8])) {
> +			idev->rndid_inc++;
> +			continue;
> +		}
> +
> +		ift = ipv6_get_ifaddr (dev_net(idev->dev), &addr, idev->dev, 0);
> +		break;
> +	}
> +#else
> +	idev->cnf.use_tempaddr &= 0x03;

Broken when use_tempaddr < 0.

Also if use_tempaddr > 4 then this should warn that the alternate
algorithm is not actually being used.

> +#endif
> +	if (idev->cnf.use_tempaddr < 4) {

What if it's equal to 4?

> +		if (__ipv6_try_regen_rndid(idev, tmpaddr) < 0) {
> +			spin_unlock_bh(&ifp->lock);
> +			write_unlock(&idev->lock);
> +			printk(KERN_WARNING
> +				   "ipv6_create_tempaddr(): regeneration of randomized 
> interface id failed.\n");
> +			in6_ifa_put(ifp);
> +			in6_dev_put(idev);
> +			ret = -1;
> +			goto out;
> +		}
> +		memcpy(&addr.s6_addr[8], idev->rndid, 8);
>  	}
> -	memcpy(&addr.s6_addr[8], idev->rndid, 8);
>  	age = (jiffies - ifp->tstamp) / HZ;
>  	tmp_valid_lft = min_t(__u32,
>  			      ifp->valid_lft,
> @@ -922,11 +984,11 @@ retry:
>  	if (ifp->flags & IFA_F_OPTIMISTIC)
>  		addr_flags |= IFA_F_OPTIMISTIC;
>  
> -	ift = !max_addresses ||
> -	      ipv6_count_addresses(idev) < max_addresses ?
> -		ipv6_add_addr(idev, &addr, tmp_plen,
> -			      ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK,
> -			      addr_flags) : NULL;
> +	if (!ift && (!max_addresses || ipv6_count_addresses(idev) < 
> max_addresses)) {
> +		ift = ipv6_add_addr(idev, &addr, tmp_plen,
> +		                    ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK,
> +		                    addr_flags);
> +	}
>  	if (!ift || IS_ERR(ift)) {
>  		in6_ifa_put(ifp);
>  		in6_dev_put(idev);
> @@ -943,9 +1005,11 @@ retry:
>  	ift->prefered_lft = tmp_prefered_lft;
>  	ift->cstamp = tmp_cstamp;
>  	ift->tstamp = tmp_tstamp;
> +	ift->regen_count = 0;
>  	spin_unlock_bh(&ift->lock);
>  
> -	addrconf_dad_start(ift, 0);
> +	if (ift->flags & IFA_F_TENTATIVE)
> +		addrconf_dad_start(ift, 0);
>  	in6_ifa_put(ift);
>  	in6_dev_put(idev);
>  out:
> @@ -1090,7 +1154,7 @@ static int ipv6_get_saddr_eval(struct net *net,
>  		 */
>  		int preftmp = dst->prefs & (IPV6_PREFER_SRC_PUBLIC|
> IPV6_PREFER_SRC_TMP) ?
>  				!!(dst->prefs & IPV6_PREFER_SRC_TMP) :
> -				score->ifa->idev->cnf.use_tempaddr >= 2;
> +				!!(score->ifa->idev->cnf.use_tempaddr & 2);
[...]

Broken when use_tempaddr < 0.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* Re: ip_rt_bug questions.
From: David Miller @ 2011-04-19  5:04 UTC (permalink / raw)
  To: davej; +Cc: netdev
In-Reply-To: <20110418215922.GA17818@redhat.com>

From: Dave Jones <davej@redhat.com>
Date: Mon, 18 Apr 2011 17:59:23 -0400

> On Mon, Apr 18, 2011 at 02:50:23PM -0700, David Miller wrote:
>  
>  > BTW, if you could modify this thing to spit out a stack
>  > trace (probably by using WARN_ON() or similar) that will
>  > probably show us where the bug is coming from.
> 
> Ok, I'll add that, and see if I can reproduce it again.

Thanks a lot Dave.

^ permalink raw reply

* [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip
From: Wei Yongjun @ 2011-04-19  5:07 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

Series of 8 patches against net-next-2.6, include some cleanup
and tiny fix for add/del ip, which have been waiting on vlad's
lksctp-dev tree for long times.

Shan Wei (5):
      sctp: delete unused macro definition of sctp_chunk_is_control
      sctp: fix the comment of sctp_sf_violation_paramlen()
      sctp: use common head of addr parameter to access member in addr-unrelated code
      sctp: kill abandoned SCTP_CMD_TRANSMIT command
      sctp: use memdup_user to copy data from userspace

Vlad Yasevich (3):
      sctp: teach CACC algorithm about removed transports
      sctp: Allow bindx_del to accept 0 port.
      sctp: Release all routes when processing acks ADD_IP or DEL_IP

 include/net/sctp/command.h   |    1 -
 include/net/sctp/constants.h |    1 -
 net/sctp/input.c             |    2 +-
 net/sctp/outqueue.c          |   11 ++++++++---
 net/sctp/sm_make_chunk.c     |   18 +++++++-----------
 net/sctp/sm_sideeffect.c     |    6 ------
 net/sctp/sm_statefuns.c      |    5 +++--
 net/sctp/socket.c            |   28 +++++++++++-----------------
 8 files changed, 30 insertions(+), 42 deletions(-)



^ permalink raw reply

* [PATCH net-next-2.6 1/8] sctp: delete unused macro definition of sctp_chunk_is_control
From: Wei Yongjun @ 2011-04-19  5:09 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

The macro never be used.
And if needed, can use !sctp_chunk_is_data instead of.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 include/net/sctp/constants.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index c70d8cc..deac13d 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -150,7 +150,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(OTHER,		sctp_event_other_t,	other)
 SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE,	sctp_event_primitive_t,	primitive)
 
 
-#define sctp_chunk_is_control(a) (a->chunk_hdr->type != SCTP_CID_DATA)
 #define sctp_chunk_is_data(a) (a->chunk_hdr->type == SCTP_CID_DATA)
 
 /* Calculate the actual data size in a data chunk */
-- 
1.6.5.2



^ permalink raw reply related

* [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code
From: Wei Yongjun @ 2011-04-19  5:11 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>

The 'p' member of struct sctp_paramhdr is common part for
IPv4 addr parameter and IPv6 addr parameter in union sctp_addr_param.

For addr-related code, use specified addr parameter.
Otherwise, use common header to access type/length member.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/input.c         |    2 +-
 net/sctp/sm_make_chunk.c |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/sctp/input.c b/net/sctp/input.c
index 5436c69..30cec77 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -1017,7 +1017,7 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
 	/* Skip over the ADDIP header and find the Address parameter */
 	param = (union sctp_addr_param *)(asconf + 1);
 
-	af = sctp_get_af_specific(param_type2af(param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(param->p.type));
 	if (unlikely(!af))
 		return NULL;
 
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index b3434cc..844adfd 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2923,7 +2923,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 	    asconf_param->param_hdr.type != SCTP_PARAM_SET_PRIMARY)
 		return SCTP_ERROR_UNKNOWN_PARAM;
 
-	switch (addr_param->v4.param_hdr.type) {
+	switch (addr_param->p.type) {
 	case SCTP_PARAM_IPV6_ADDRESS:
 		if (!asoc->peer.ipv6_address)
 			return SCTP_ERROR_DNS_FAILED;
@@ -2936,7 +2936,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 		return SCTP_ERROR_DNS_FAILED;
 	}
 
-	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(addr_param->p.type));
 	if (unlikely(!af))
 		return SCTP_ERROR_DNS_FAILED;
 
@@ -3100,7 +3100,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
 	/* Skip the address parameter and store a pointer to the first
 	 * asconf parameter.
 	 */
-	length = ntohs(addr_param->v4.param_hdr.length);
+	length = ntohs(addr_param->p.length);
 	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
 	chunk_len -= length;
 
@@ -3177,7 +3177,7 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
 			((void *)asconf_param + sizeof(sctp_addip_param_t));
 
 	/* We have checked the packet before, so we do not check again.	*/
-	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(addr_param->p.type));
 	af->from_addr_param(&addr, addr_param, htons(bp->port), 0);
 
 	switch (asconf_param->param_hdr.type) {
@@ -3304,7 +3304,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
 	/* Skip the address parameter in the last asconf sent and store a
 	 * pointer to the first asconf parameter.
 	 */
-	length = ntohs(addr_param->v4.param_hdr.length);
+	length = ntohs(addr_param->p.length);
 	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
 	asconf_len -= length;
 
-- 
1.6.5.2



^ permalink raw reply related

* [PATCH net-next-2.6 2/8] sctp: fix the comment of sctp_sf_violation_paramlen()
From: Wei Yongjun @ 2011-04-19  5:11 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>

Update the comment about sctp_sf_violation_paramlen() to be
more precise.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/sm_statefuns.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 7679208..c085472 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -4343,8 +4343,9 @@ static sctp_disposition_t sctp_sf_violation_chunklen(
 
 /*
  * Handle a protocol violation when the parameter length is invalid.
- * "Invalid" length is identified as smaller than the minimal length a
- * given parameter can be.
+ * If the length is smaller than the minimum length of a given parameter,
+ * or accumulated length in multi parameters exceeds the end of the chunk,
+ * the length is considered as invalid.
  */
 static sctp_disposition_t sctp_sf_violation_paramlen(
 				     const struct sctp_endpoint *ep,
-- 
1.6.5.2





^ permalink raw reply related

* [PATCH net-next-2.6 4/8] sctp: kill abandoned SCTP_CMD_TRANSMIT command
From: Wei Yongjun @ 2011-04-19  5:12 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>

Remove SCTP_CMD_TRANSMIT command as it never be used.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 include/net/sctp/command.h |    1 -
 net/sctp/sm_sideeffect.c   |    6 ------
 2 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index c01dc99..2b44764 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -73,7 +73,6 @@ typedef enum {
 	SCTP_CMD_INIT_FAILED,   /* High level, do init failure work. */
 	SCTP_CMD_REPORT_DUP,	/* Report a duplicate TSN.  */
 	SCTP_CMD_STRIKE,	/* Mark a strike against a transport.  */
-	SCTP_CMD_TRANSMIT,      /* Transmit the outqueue. */
 	SCTP_CMD_HB_TIMERS_START,    /* Start the heartbeat timers. */
 	SCTP_CMD_HB_TIMER_UPDATE,    /* Update a heartbeat timers.  */
 	SCTP_CMD_HB_TIMERS_STOP,     /* Stop the heartbeat timers.  */
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 5f86ee4..3b80fe2 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1415,12 +1415,6 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
 					SCTP_RTXR_T3_RTX);
 			break;
 
-		case SCTP_CMD_TRANSMIT:
-			/* Kick start transmission. */
-			error = sctp_outq_uncork(&asoc->outqueue);
-			local_cork = 0;
-			break;
-
 		case SCTP_CMD_ECN_CE:
 			/* Do delayed CE processing.   */
 			sctp_do_ecn_ce_work(asoc, cmd->obj.u32);
-- 
1.6.5.2



^ permalink raw reply related

* [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from userspace
From: Wei Yongjun @ 2011-04-19  5:13 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>

Use common function to simply code.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/socket.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index deb82e3..5c9980a 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3215,14 +3215,9 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk,
 	if (optlen < sizeof(struct sctp_hmacalgo))
 		return -EINVAL;
 
-	hmacs = kmalloc(optlen, GFP_KERNEL);
-	if (!hmacs)
-		return -ENOMEM;
-
-	if (copy_from_user(hmacs, optval, optlen)) {
-		err = -EFAULT;
-		goto out;
-	}
+	hmacs= memdup_user(optval, optlen);
+	if (IS_ERR(hmacs))
+		return PTR_ERR(hmacs);
 
 	idents = hmacs->shmac_num_idents;
 	if (idents == 0 || idents > SCTP_AUTH_NUM_HMACS ||
@@ -3257,14 +3252,9 @@ static int sctp_setsockopt_auth_key(struct sock *sk,
 	if (optlen <= sizeof(struct sctp_authkey))
 		return -EINVAL;
 
-	authkey = kmalloc(optlen, GFP_KERNEL);
-	if (!authkey)
-		return -ENOMEM;
-
-	if (copy_from_user(authkey, optval, optlen)) {
-		ret = -EFAULT;
-		goto out;
-	}
+	authkey= memdup_user(optval, optlen);
+	if (IS_ERR(authkey))
+		return PTR_ERR(authkey);
 
 	if (authkey->sca_keylength > optlen - sizeof(struct sctp_authkey)) {
 		ret = -EINVAL;
-- 
1.6.5.2



^ permalink raw reply related

* [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed transports
From: Wei Yongjun @ 2011-04-19  5:13 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

From: Vlad Yasevich <vladislav.yasevich@hp.com>

When we have have to remove a transport due to ASCONF, we move
the data to a new active path.  This can trigger CACC algorithm
to not mark that data as missing when SACKs arrive.  This is
because the transport passed to the CACC algorithm is the one
this data is sitting on, not the one it was sent on (that one
may be gone).  So, by sending the original transport (even if
it's NULL), we may start marking data as missing.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/outqueue.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index bf92a5b..7812772 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -131,7 +131,8 @@ static inline int sctp_cacc_skip_3_1_d(struct sctp_transport *primary,
 static inline int sctp_cacc_skip_3_1_f(struct sctp_transport *transport,
 				       int count_of_newacks)
 {
-	if (count_of_newacks < 2 && !transport->cacc.cacc_saw_newack)
+	if (count_of_newacks < 2 &&
+			(transport && !transport->cacc.cacc_saw_newack))
 		return 1;
 	return 0;
 }
@@ -618,9 +619,12 @@ redo:
 
 			/* If we are retransmitting, we should only
 			 * send a single packet.
+			 * Otherwise, try appending this chunk again.
 			 */
 			if (rtx_timeout || fast_rtx)
 				done = 1;
+			else
+				goto redo;
 
 			/* Bundle next chunk in the next round.  */
 			break;
@@ -1683,8 +1687,9 @@ static void sctp_mark_missing(struct sctp_outq *q,
 			/* SFR-CACC may require us to skip marking
 			 * this chunk as missing.
 			 */
-			if (!transport || !sctp_cacc_skip(primary, transport,
-					    count_of_newacks, tsn)) {
+			if (!transport || !sctp_cacc_skip(primary,
+						chunk->transport,
+						count_of_newacks, tsn)) {
 				chunk->tsn_missing_report++;
 
 				SCTP_DEBUG_PRINTK(
-- 
1.6.5.2



^ permalink raw reply related

* [PATCH net-next-2.6 7/8] sctp: Allow bindx_del to accept 0 port
From: Wei Yongjun @ 2011-04-19  5:14 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

From: Vlad Yasevich <vladislav.yasevich@hp.com>

We allow 0 port when adding new addresses.  It only
makes sence to allow 0 port when removing addresses.
When removing the currently bound port will be used
when the port in the address is set to 0.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/socket.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 5c9980a..431b890 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -658,11 +658,15 @@ static int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt)
 			goto err_bindx_rem;
 		}
 
-		if (sa_addr->v4.sin_port != htons(bp->port)) {
+		if (sa_addr->v4.sin_port &&
+		    sa_addr->v4.sin_port != htons(bp->port)) {
 			retval = -EINVAL;
 			goto err_bindx_rem;
 		}
 
+		if (!sa_addr->v4.sin_port)
+			sa_addr->v4.sin_port = htons(bp->port);
+
 		/* FIXME - There is probably a need to check if sk->sk_saddr and
 		 * sk->sk_rcv_addr are currently set to one of the addresses to
 		 * be removed. This is something which needs to be looked into
-- 
1.6.5.2



^ permalink raw reply related

* [PATCH net-next-2.6 8/8] sctp: Release all routes when processing acks ADD_IP or DEL_IP
From: Wei Yongjun @ 2011-04-19  5:15 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

From: Vlad Yasevich <vladislav.yasevich@hp.com>

When processing an ACK for ADD_IP parameter, we only release
the routes on non-active transports.  This can cause a wrong
source address to be used.  We can release the routes and
cause new route lookups and source address selection so that
new addresses can be used as source.  Additionally, we don't need
to lookup routes for all transports at the same time.  We can let
the transmit code path update the cached route when the transport
actually sends something.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/sm_make_chunk.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 844adfd..f87ccb1 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3193,11 +3193,8 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
 		local_bh_enable();
 		list_for_each_entry(transport, &asoc->peer.transport_addr_list,
 				transports) {
-			if (transport->state == SCTP_ACTIVE)
-				continue;
 			dst_release(transport->dst);
-			sctp_transport_route(transport, NULL,
-					     sctp_sk(asoc->base.sk));
+			transport->dst = NULL;
 		}
 		break;
 	case SCTP_PARAM_DEL_IP:
@@ -3207,8 +3204,7 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
 		list_for_each_entry(transport, &asoc->peer.transport_addr_list,
 				transports) {
 			dst_release(transport->dst);
-			sctp_transport_route(transport, NULL,
-					     sctp_sk(asoc->base.sk));
+			transport->dst = NULL;
 		}
 		break;
 	default:
-- 
1.6.5.2



^ permalink raw reply related

* [PATCH net-next-2.6 1/8 v2] sctp: delete unused macro definition of sctp_chunk_is_control
From: Wei Yongjun @ 2011-04-19  5:19 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD1915.70503@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>

The macro never be used.
And if needed, can use !sctp_chunk_is_data instead of.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
Sorry for missing 'From ...' in the first version
---
 include/net/sctp/constants.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index c70d8cc..deac13d 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -150,7 +150,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(OTHER,		sctp_event_other_t,	other)
 SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE,	sctp_event_primitive_t,	primitive)
 
 
-#define sctp_chunk_is_control(a) (a->chunk_hdr->type != SCTP_CID_DATA)
 #define sctp_chunk_is_data(a) (a->chunk_hdr->type == SCTP_CID_DATA)
 
 /* Calculate the actual data size in a data chunk */
-- 
1.6.5.2



^ permalink raw reply related

* Re: [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip
From: Shan Wei @ 2011-04-19  5:31 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: David Miller, netdev@vger.kernel.org, lksctp
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

Wei Yongjun wrote, at 04/19/2011 01:07 PM:
> Series of 8 patches against net-next-2.6, include some cleanup
> and tiny fix for add/del ip, which have been waiting on vlad's
> lksctp-dev tree for long times.

Thanks for your job, and expect others.

> 
> Shan Wei (5):
>       sctp: delete unused macro definition of sctp_chunk_is_control
>       sctp: fix the comment of sctp_sf_violation_paramlen()
>       sctp: use common head of addr parameter to access member in addr-unrelated code
>       sctp: kill abandoned SCTP_CMD_TRANSMIT command
>       sctp: use memdup_user to copy data from userspace
> 
> Vlad Yasevich (3):
>       sctp: teach CACC algorithm about removed transports
>       sctp: Allow bindx_del to accept 0 port.
>       sctp: Release all routes when processing acks ADD_IP or DEL_IP
> 
>  include/net/sctp/command.h   |    1 -
>  include/net/sctp/constants.h |    1 -
>  net/sctp/input.c             |    2 +-
>  net/sctp/outqueue.c          |   11 ++++++++---
>  net/sctp/sm_make_chunk.c     |   18 +++++++-----------
>  net/sctp/sm_sideeffect.c     |    6 ------
>  net/sctp/sm_statefuns.c      |    5 +++--
>  net/sctp/socket.c            |   28 +++++++++++-----------------
>  8 files changed, 30 insertions(+), 42 deletions(-)
> 
 
-- 
Best Regards
-----
Shan Wei

^ 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