Netdev List
 help / color / mirror / Atom feed
* [PATCH net 2/2] macvlan: disable LRO on lower device instead of macvlan
From: Michal Kubecek @ 2013-11-08 13:41 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Patrick McHardy
In-Reply-To: <cover.1383915401.git.mkubecek@suse.cz>

A macvlan device has always LRO disabled so that calling
dev_disable_lro() on it does nothing. If we need to disable LRO
e.g. because

  - the macvlan device is inserted into a bridge
  - IPv6 forwarding is enabled for it
  - it is in a different namespace than lowerdev and IPv4
    forwarding is enabled in it

we need to disable LRO on its underlying device instead (as we
do for 802.1q VLAN devices).

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 net/core/dev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index 3430b1e..4af02a9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -131,6 +131,7 @@
 #include <linux/static_key.h>
 #include <linux/hashtable.h>
 #include <linux/vmalloc.h>
+#include <linux/if_macvlan.h>
 
 #include "net-sysfs.h"
 
@@ -1425,6 +1426,10 @@ void dev_disable_lro(struct net_device *dev)
 	if (is_vlan_dev(dev))
 		dev = vlan_dev_real_dev(dev);
 
+	/* the same for macvlan devices */
+	if (is_macvlan_dev(dev))
+		dev = macvlan_dev_real_dev(dev);
+
 	dev->wanted_features &= ~NETIF_F_LRO;
 	netdev_update_features(dev);
 
-- 
1.8.1.4

^ permalink raw reply related

* Re: [RFC] tcp: randomize TCP source ports
From: Eric Dumazet @ 2013-11-08 14:03 UTC (permalink / raw)
  To: Hannes Frederic Sowa; +Cc: David Miller, netdev
In-Reply-To: <20131108130244.GE5876@order.stressinduktion.org>

On Fri, 2013-11-08 at 14:02 +0100, Hannes Frederic Sowa wrote:

> If I understand the code correctly the UDP ports are fully randomized? This
> is good as per-peer randomization and then incrementation seems to be
> theoretically broken:
> 
> <https://sites.google.com/site/hayashulman/files/NIC-derandomisation.pdf>
> 
> Looking at the code I somehow would like to check the use of net_random there.
> The prandom function is reseeded as late_initcall and then only seeded by some
> network addresses.
> 
> At the time the late_initcall reseeds the PRNG my tests have shown that
> the nonblockingpool was still not fully initialized where the PRNG gets
> reseeded from.
> 
> Hm, I propose a patch which does reseed the pool as soon as the nonblocking
> pool got credited enough entropy in credit_entropy_bits. This should help
> later binds().

Or even better have a reseed every XX seconds.

Something like :

diff --git a/lib/random32.c b/lib/random32.c
index 52280d5526be..4af2d72281e3 100644
--- a/lib/random32.c
+++ b/lib/random32.c
@@ -60,6 +60,8 @@ u32 prandom_u32_state(struct rnd_state *state)
 }
 EXPORT_SYMBOL(prandom_u32_state);
 
+static DEFINE_PER_CPU(unsigned long, net_rand_shuffle);
+
 /**
  *	prandom_u32 - pseudo random number generator
  *
@@ -71,6 +73,19 @@ u32 prandom_u32(void)
 {
 	unsigned long r;
 	struct rnd_state *state = &get_cpu_var(net_rand_state);
+
+	if (unlikely(time_after(jiffies, net_rand_shuffle))) {
+		unsigned long delay;
+		u32 entropy;
+
+		get_random_bytes_arch(&entropy, sizeof(entropy));
+
+		/* reseed every ~20 seconds, in [10 .. 30] interval */
+		delay = 10 * HZ + (entropy % (20 * HZ));
+		__this_cpu_write(net_rand_shuffle, jiffies + delay);
+
+		state->s1 = __seed(state->s1 ^ entropy, 1);
+	}
 	r = prandom_u32_state(state);
 	put_cpu_var(state);
 	return r;
@@ -169,6 +184,7 @@ static int __init prandom_init(void)
 		prandom_u32_state(state);
 		prandom_u32_state(state);
 		prandom_u32_state(state);
+		per_cpu(net_rand_shuffle, i) = jiffies;
 	}
 	return 0;
 }

^ permalink raw reply related

* Re: [PATCH 00/16] wl1251 patches from linux-n900 tree
From: Felipe Contreras @ 2013-11-08 14:20 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless Mailing List, netdev-u79uwXL29TY76Z2rM5mHXA,
	Linux Kernel Mailing List, freemangordon-uiMcrn6V0Vs,
	aaro.koskinen-X3B1VOXEql0, Pavel Machek, sre-GFxCN5SEZAc,
	joni.lapilainen-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <1382819655-30430-1-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Sat, Oct 26, 2013 at 3:33 PM, Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hello, I'm sending wl1251 patches from linux-n900 tree [1] for comments. More
> patches come from David's monitor & packet injection work. Patches are tested
> with 3.12 rc5 kernel on Nokia N900.
>
> [1] - https://gitorious.org/linux-n900/linux-n900

How did you test these patches? I get a panic loop immediately after I
bring the interface loop in monitor mode (v3.12).

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [RFC] tcp: randomize TCP source ports
From: Hannes Frederic Sowa @ 2013-11-08 14:28 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev
In-Reply-To: <1383919418.9412.234.camel@edumazet-glaptop2.roam.corp.google.com>

On Fri, Nov 08, 2013 at 06:03:38AM -0800, Eric Dumazet wrote:
> On Fri, 2013-11-08 at 14:02 +0100, Hannes Frederic Sowa wrote:
> 
> > If I understand the code correctly the UDP ports are fully randomized? This
> > is good as per-peer randomization and then incrementation seems to be
> > theoretically broken:
> > 
> > <https://sites.google.com/site/hayashulman/files/NIC-derandomisation.pdf>
> > 
> > Looking at the code I somehow would like to check the use of net_random there.
> > The prandom function is reseeded as late_initcall and then only seeded by some
> > network addresses.
> > 
> > At the time the late_initcall reseeds the PRNG my tests have shown that
> > the nonblockingpool was still not fully initialized where the PRNG gets
> > reseeded from.
> > 
> > Hm, I propose a patch which does reseed the pool as soon as the nonblocking
> > pool got credited enough entropy in credit_entropy_bits. This should help
> > later binds().
> 
> Or even better have a reseed every XX seconds.

Yes, that's even better.

> 
> Something like :
> 
> diff --git a/lib/random32.c b/lib/random32.c
> index 52280d5526be..4af2d72281e3 100644
> --- a/lib/random32.c
> +++ b/lib/random32.c
> @@ -60,6 +60,8 @@ u32 prandom_u32_state(struct rnd_state *state)
>  }
>  EXPORT_SYMBOL(prandom_u32_state);
>  
> +static DEFINE_PER_CPU(unsigned long, net_rand_shuffle);
> +
>  /**
>   *	prandom_u32 - pseudo random number generator
>   *
> @@ -71,6 +73,19 @@ u32 prandom_u32(void)
>  {
>  	unsigned long r;
>  	struct rnd_state *state = &get_cpu_var(net_rand_state);
> +
> +	if (unlikely(time_after(jiffies, net_rand_shuffle))) {
> +		unsigned long delay;
> +		u32 entropy;
> +
> +		get_random_bytes_arch(&entropy, sizeof(entropy));

What do you think about using a timer to keep the reseed out of fast-path
and switch to the non-arch get_random_bytes instead?

Thanks,

  Hannes

^ permalink raw reply

* [PATCH net] ipv4: fix wildcard search with inet_confirm_addr()
From: Nicolas Dichtel @ 2013-11-08 14:37 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

Help of this function says: "in_dev: only on this interface, 0=any interface",
but in fact the code supposes that it will never be NULL.

Note that this function was never called with in_dev == NULL, but it's exported
and may be used by an external module.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---

This bug was spotted by code review.

 drivers/net/bonding/bonding.h | 10 +++-------
 include/linux/inetdevice.h    |  3 ++-
 net/ipv4/arp.c                |  3 ++-
 net/ipv4/devinet.c            |  8 ++++----
 4 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 03cf3fd14490..448895e90ccb 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -407,15 +407,11 @@ static inline bool bond_is_slave_inactive(struct slave *slave)
 
 static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be32 local)
 {
-	struct in_device *in_dev;
-	__be32 addr = 0;
+	__be32 addr;
 
 	rcu_read_lock();
-	in_dev = __in_dev_get_rcu(dev);
-
-	if (in_dev)
-		addr = inet_confirm_addr(in_dev, dst, local, RT_SCOPE_HOST);
-
+	addr = inet_confirm_addr(dev_net(dev), __in_dev_get_rcu(dev), dst,
+				 local, RT_SCOPE_HOST);
 	rcu_read_unlock();
 	return addr;
 }
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 79640e015a86..5870f7060917 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -164,7 +164,8 @@ extern int		devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
 extern void		devinet_init(void);
 extern struct in_device	*inetdev_by_index(struct net *, int);
 extern __be32		inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
-extern __be32		inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, int scope);
+__be32 inet_confirm_addr(struct net *net, struct in_device *in_dev, __be32 dst,
+			 __be32 local, int scope);
 extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask);
 
 static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 7808093cede6..fc5ebc7e1962 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -408,7 +408,8 @@ static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip)
 	default:
 		return 0;
 	}
-	return !inet_confirm_addr(in_dev, sip, tip, scope);
+	return !inet_confirm_addr(dev_net(in_dev->dev), in_dev, sip, tip,
+				  scope);
 }
 
 static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index a1b5bcbd04ae..47cdb035f817 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1236,22 +1236,22 @@ static __be32 confirm_addr_indev(struct in_device *in_dev, __be32 dst,
 
 /*
  * Confirm that local IP address exists using wildcards:
+ * - net: netns to check, cannot be NULL
  * - in_dev: only on this interface, 0=any interface
  * - dst: only in the same subnet as dst, 0=any dst
  * - local: address, 0=autoselect the local address
  * - scope: maximum allowed scope value for the local address
  */
-__be32 inet_confirm_addr(struct in_device *in_dev,
+__be32 inet_confirm_addr(struct net *net, struct in_device *in_dev,
 			 __be32 dst, __be32 local, int scope)
 {
 	__be32 addr = 0;
 	struct net_device *dev;
-	struct net *net;
 
 	if (scope != RT_SCOPE_LINK)
-		return confirm_addr_indev(in_dev, dst, local, scope);
+		return in_dev ? confirm_addr_indev(in_dev, dst, local, scope) :
+				0;
 
-	net = dev_net(in_dev->dev);
 	rcu_read_lock();
 	for_each_netdev_rcu(net, dev) {
 		in_dev = __in_dev_get_rcu(dev);
-- 
1.8.4.1

^ permalink raw reply related

* Re: Using HTB over MultiQ
From: Anton 'EvilMan' Danilov @ 2013-11-08 14:53 UTC (permalink / raw)
  To: John Fastabend; +Cc: Eric Dumazet, netdev
In-Reply-To: <527BA63F.7040900@intel.com>

Hello.

On 11/7/2013 6:20 AM, Eric Dumazet wrote:
>
> So I think you need to change the device queue selection so that it only
> depends on your filters / htb classes.
>
> Otherwise flows for a particular 'customer' might be spread on the 8
> queues, so the rate could be 8 * 1Mbit, instead of 1Mbit.

2013/11/7 John Fastabend <john.r.fastabend@intel.com>:
>
> With the multiq qdisc you could attach filter to the root qdisc and use
> skbedit to set the queue_mapping field,
>
> #tc filter add dev eth0 parent 1: protocol ip prio 1 u32 \
>         match ip dst 192.168.0.3 \
>         action skbedit queue_mapping 3
>
> if you configure the filters to map to the correct classes this would
> work.
>

I did as you adviced to me. I'm using the skbedit action with classify
filters for map the packet to assigned queue.
But i've got the another unexpected issue. u32 classifier of the root
multiq qdisc isn't setting the skb->priority value, and result of the
classifying is lost. For avoid this behaviour i'm setting priority by
the skbedit action.
After this all works as expected.
Unfortunately performance aren't improved.

Over 60 percent of 'perf top' is _raw_spin_lock function.
Speed of traffic is near 6Gbit/s, packet rate ~ 1.3 Mpps. But this
speed are limited by shaper.

Thanks for help.

-- 
Anton.

^ permalink raw reply

* Re: [PATCH net 1/2] macvlan: introduce IFF_MACVLAN flag and helper functions
From: John Fastabend @ 2013-11-08 15:06 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: netdev, David S. Miller, Patrick McHardy
In-Reply-To: <7ca53d743ffa48f671c35335473798c66d908d56.1383915401.git.mkubecek@suse.cz>

On 11/8/2013 5:41 AM, Michal Kubecek wrote:
> Introduce IFF_MACVLAN flag to recognize macvlan devices and two
> helper functions, is_macvlan_dev() and macvlan_dev_real_dev().
> These work like similar functions for 802.1q VLAN devices.
>
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
> ---
>   drivers/net/macvlan.c      |  2 +-
>   include/linux/if_macvlan.h | 26 ++++++++++++++++++++++++++
>   include/uapi/linux/if.h    |  1 +
>   3 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> index 9bf46bd..3bdac0a 100644
> --- a/drivers/net/macvlan.c
> +++ b/drivers/net/macvlan.c
> @@ -685,7 +685,7 @@ void macvlan_common_setup(struct net_device *dev)
>   	ether_setup(dev);
>
>   	dev->priv_flags	       &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
> -	dev->priv_flags	       |= IFF_UNICAST_FLT;
> +	dev->priv_flags	       |= IFF_UNICAST_FLT | IFF_MACVLAN;
>   	dev->netdev_ops		= &macvlan_netdev_ops;
>   	dev->destructor		= free_netdev;
>   	dev->header_ops		= &macvlan_hard_header_ops;
> diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
> index ddd33fd..8f355f9 100644
> --- a/include/linux/if_macvlan.h
> +++ b/include/linux/if_macvlan.h
> @@ -118,4 +118,30 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops);
>   extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
>   				      struct net_device *dev);
>
> +#if IS_ENABLED(CONFIG_MACVLAN)
> +static inline bool is_macvlan_dev(struct net_device *dev)
> +{
> +	return dev->priv_flags & IFF_MACVLAN;
> +}
> +

I just added this to netdevice.h here,

+static inline bool netif_is_macvlan(struct net_device *dev)
+{
+	return dev->priv_flags & IFF_MACVLAN;
+}
+

although I didn't wrap it in the IS_ENABLED if/else, but a
bitmask in slow path probably doesn't matter. As a precedent
none of the other netif_is_* bitmasks are wrapped like this.

The patch is

commit 2a47fa45d4dfbc54659d28de311a1f764b296a3c
Author: John Fastabend <john.r.fastabend@intel.com>
Date:   Wed Nov 6 09:54:52 2013 -0800

     ixgbe: enable l2 forwarding acceleration for macvlans


I think you need to respin the patch with just the
macvlan_dev_real_dev() part.

Thanks,
John

^ permalink raw reply

* Re: Using HTB over MultiQ
From: Eric Dumazet @ 2013-11-08 15:07 UTC (permalink / raw)
  To: Anton 'EvilMan' Danilov; +Cc: John Fastabend, netdev
In-Reply-To: <CAEzD07JwrnqeB35BiTC2ztpyei2KNDtYO8zuewicKNBwyxmOtQ@mail.gmail.com>

On Fri, 2013-11-08 at 18:53 +0400, Anton 'EvilMan' Danilov wrote:

> Over 60 percent of 'perf top' is _raw_spin_lock function.
> Speed of traffic is near 6Gbit/s, packet rate ~ 1.3 Mpps. But this
> speed are limited by shaper.

Please post :

ethtool -S eth0  # or other nics

perf record -a -g sleep 10

perf report | tail -n 200

And possibly it would be nice if you send your tc script so that we can
check ;)

^ permalink raw reply

* Re: [RFC] tcp: randomize TCP source ports
From: Eric Dumazet @ 2013-11-08 15:11 UTC (permalink / raw)
  To: Hannes Frederic Sowa; +Cc: David Miller, netdev
In-Reply-To: <20131108142856.GA28330@order.stressinduktion.org>

On Fri, 2013-11-08 at 15:28 +0100, Hannes Frederic Sowa wrote:

> What do you think about using a timer to keep the reseed out of fast-path
> and switch to the non-arch get_random_bytes instead?

Well, the initial seed value is get_random_bytes(). I felt that using a
xor with the _arch() version would be safe enough.

For the timer, I do not think its worth the pain : Do you want a per cpu
timer, or a global one ?

The unlikely() clause makes the test very small and test is well
predicted.

^ permalink raw reply

* Re: Using HTB over MultiQ
From: John Fastabend @ 2013-11-08 15:11 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Anton 'EvilMan' Danilov, netdev
In-Reply-To: <1383923220.9412.236.camel@edumazet-glaptop2.roam.corp.google.com>

On 11/8/2013 7:07 AM, Eric Dumazet wrote:
> On Fri, 2013-11-08 at 18:53 +0400, Anton 'EvilMan' Danilov wrote:
>
>> Over 60 percent of 'perf top' is _raw_spin_lock function.
>> Speed of traffic is near 6Gbit/s, packet rate ~ 1.3 Mpps. But this
>> speed are limited by shaper.
>
> Please post :
>
> ethtool -S eth0  # or other nics
>
> perf record -a -g sleep 10
>
> perf report | tail -n 200
>
> And possibly it would be nice if you send your tc script so that we can
> check ;)
>

perf would be interesting but note that multiq still uses the root qdisc
lock which you original stated you were trying to avoid.

mq and mqprio are really the only two existing qdiscs that work well for
performance with small packet sizes and multiqueue nics at least in my
experience/setup with these kinds of micro-benchmarks.

.John

^ permalink raw reply

* Re: [PATCH net 1/2] macvlan: introduce IFF_MACVLAN flag and helper functions
From: Michal Kubecek @ 2013-11-08 15:23 UTC (permalink / raw)
  To: John Fastabend; +Cc: netdev, David S. Miller, Patrick McHardy
In-Reply-To: <527CFDE7.4040405@intel.com>

On Fri, Nov 08, 2013 at 07:06:15AM -0800, John Fastabend wrote:
> 
> I just added this to netdevice.h here,
> 
> +static inline bool netif_is_macvlan(struct net_device *dev)
> +{
> +	return dev->priv_flags & IFF_MACVLAN;
> +}
> +
> 
> although I didn't wrap it in the IS_ENABLED if/else, but a
> bitmask in slow path probably doesn't matter. As a precedent
> none of the other netif_is_* bitmasks are wrapped like this.
> 
> The patch is
> 
> commit 2a47fa45d4dfbc54659d28de311a1f764b296a3c
> Author: John Fastabend <john.r.fastabend@intel.com>
> Date:   Wed Nov 6 09:54:52 2013 -0800
> 
>     ixgbe: enable l2 forwarding acceleration for macvlans
> 
> 
> I think you need to respin the patch with just the
> macvlan_dev_real_dev() part.

My patch also conflicts with

  a6cc0cfa  net: Add layer 2 hardware acceleration operations for macvlan devices

which introduced the IFF_MACVLAN flags (but sets it in
macvlan_common_newlink()). Both of yours are in net-next while mine are
against net (as 2/2 is a bugfix) which is why I didn't notice them.
I'm not sure what to do in such case.

                                                         Michal Kubecek

^ permalink raw reply

* Re: [PATCH net-next v2 2/10] bonding: rebuild the lock use for bond_mii_monitor()
From: Nikolay Aleksandrov @ 2013-11-08 15:28 UTC (permalink / raw)
  To: Ding Tianhong
  Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller, Veaceslav Falico,
	Netdev
In-Reply-To: <527C4771.90207@huawei.com>

On 11/08/2013 03:07 AM, Ding Tianhong wrote:
> The bond_mii_monitor() still use bond lock to protect bond slave list,
> it is no effect, I have 2 way to fix the problem, move the RTNL to the
> top of the function, or add RCU to protect the bond_has_slaves() and
> bond_miimon_inspect(), according to the Jay Vosburgh's opinion, 10 times
> one second is a truely big performance loss if use RTNL to protect the
> whole function, so I would take the advice and use RCU to protect the
> two functions, of course it need to add more modify, the
> bond_has_slave_rcu() is add for RCU use, and the bond_for_each_slave
> need to replace with bond_for_each_slave_rcu in bond_miimon_inspect.
> 
> I move the peer notify before the queue_delayed_work(), and obviously
> it is no need to lock the RTNL twice if call bond_miimon_commit() and
> peer notify together, other path is no logic change, I think the
> performance is better than before.
> 
> Suggested-by: Jay Vosburgh <fubar@us.ibm.com>
> Suggested-by: Veaceslav Falico <vfalico@redhat.com>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> ---
>  drivers/net/bonding/bond_main.c | 40 ++++++++++++++++++++--------------------
>  drivers/net/bonding/bonding.h   |  6 ++++++
>  2 files changed, 26 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index ba18719..def489d 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1913,7 +1913,7 @@ static int bond_miimon_inspect(struct bonding *bond)
>  
>  	ignore_updelay = !bond->curr_active_slave ? true : false;
>  
> -	bond_for_each_slave(bond, slave, iter) {
> +	bond_for_each_slave_rcu(bond, slave, iter) {
>  		slave->new_link = BOND_LINK_NOCHANGE;
>  
>  		link_state = bond_check_dev_link(bond, slave->dev, 0);
> @@ -2111,47 +2111,47 @@ void bond_mii_monitor(struct work_struct *work)
>  	bool should_notify_peers = false;
>  	unsigned long delay;
>  
> -	read_lock(&bond->lock);
> -
>  	delay = msecs_to_jiffies(bond->params.miimon);
>  
> -	if (!bond_has_slaves(bond))
> +	rcu_read_lock();
> +
> +	if (!bond_has_slaves_rcu(bond)) {
> +		rcu_read_unlock();
In fact the bond cannot disappear while this function is running, so this test
should be able to run outside the RCU region if I'm not missing something :-)
It'll be just as useful as running inside the region, at most a free run may
happen if there's one slave and it disappears.

>  		goto re_arm;
> +	}
>  
>  	should_notify_peers = bond_should_notify_peers(bond);
bond_should_notify_peers() is not RCU-safe, it uses curr_active_slave directly.

>  
>  	if (bond_miimon_inspect(bond)) {
> -		read_unlock(&bond->lock);
> +		rcu_read_unlock();
>  
>  		/* Race avoidance with bond_close cancel of workqueue */
>  		if (!rtnl_trylock()) {
> -			read_lock(&bond->lock);
>  			delay = 1;
> -			should_notify_peers = false;
>  			goto re_arm;
>  		}
>  
> -		read_lock(&bond->lock);
> -
>  		bond_miimon_commit(bond);
>  
> -		read_unlock(&bond->lock);
> +		if (should_notify_peers)
> +			call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
> +					bond->dev);
> +
>  		rtnl_unlock();	/* might sleep, hold no other locks */
> -		read_lock(&bond->lock);
> +	} else {
> +		rcu_read_unlock();
> +		if (should_notify_peers) {
> +			if (!rtnl_trylock())
> +				goto re_arm;
> +			call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
> +					bond->dev);
> +			rtnl_unlock();
> +		}
>  	}
>  
>  re_arm:
>  	if (bond->params.miimon)
>  		queue_delayed_work(bond->wq, &bond->mii_work, delay);
> -
> -	read_unlock(&bond->lock);
> -
> -	if (should_notify_peers) {
> -		if (!rtnl_trylock())
> -			return;
> -		call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev);
> -		rtnl_unlock();
> -	}
>  }
>  
>  static bool bond_has_this_ip(struct bonding *bond, __be32 ip)
> diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
> index 046a605..deb9738 100644
> --- a/drivers/net/bonding/bonding.h
> +++ b/drivers/net/bonding/bonding.h
> @@ -81,6 +81,12 @@
>  
>  #define bond_has_slaves(bond) !list_empty(bond_slave_list(bond))
>  
> +#define bond_has_slaves_rcu(bond)	\
> +	({struct list_head *__ptr = (bond_slave_list(bond)); \
> +	 struct list_head *__next = ACCESS_ONCE(__ptr->next); \
> +	 __ptr != __next; \
> +	 })
> +
This is unnecessary, bond_has_slaves() should be enough. See bond_start_xmit()
and also the list_empty comment in include/linux/rculist.h for more information why.
My bond_has_slaves() comments apply to all the patches that use it.

>  /* IMPORTANT: bond_first/last_slave can return NULL in case of an empty list */
>  #define bond_first_slave(bond) \
>  	(bond_has_slaves(bond) ? \
> 

^ permalink raw reply

* Re: [PATCH net-next v2 7/10] bonding: rebuild the lock use for bond_3ad_state_machine_handler()
From: Nikolay Aleksandrov @ 2013-11-08 15:43 UTC (permalink / raw)
  To: Ding Tianhong
  Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller, Veaceslav Falico,
	Netdev
In-Reply-To: <527C4788.9090508@huawei.com>

On 11/08/2013 03:08 AM, Ding Tianhong wrote:
> The bond_3ad_state_machine_handler() use the bond lock to protect
> the bond slave list and slave port, so as the before patch said,
> I remove bond lock and replace with RCU.
> 
> The nots in the function is still too old, clean up the nots.
> 
> Suggested-by: Jay Vosburgh <fubar@us.ibm.com>
> Suggested-by: Veaceslav Falico <vfalico@redhat.com>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> ---
>  drivers/net/bonding/bond_3ad.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index 187b1b7..09edccf61 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
> @@ -2068,18 +2068,18 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
>  	struct slave *slave;
>  	struct port *port;
>  
> -	read_lock(&bond->lock);
> +	rcu_read_lock();
>  
> -	//check if there are any slaves
> -	if (!bond_has_slaves(bond))
> +	/* check if there are any slaves */
> +	if (!bond_has_slaves_rcu(bond))
>  		goto re_arm;
>  
> -	// check if agg_select_timer timer after initialize is timed out
> +	/* check if agg_select_timer timer after initialize is timed out */
>  	if (BOND_AD_INFO(bond).agg_select_timer && !(--BOND_AD_INFO(bond).agg_select_timer)) {
> -		slave = bond_first_slave(bond);
> +		slave = bond_first_slave_rcu(bond);
>  		port = slave ? &(SLAVE_AD_INFO(slave).port) : NULL;
>  
> -		// select the active aggregator for the bond
> +		/* select the active aggregator for the bond */
>  		if (port) {
>  			if (!port->slave) {
>  				pr_warning("%s: Warning: bond's first port is uninitialized\n",
This continues to execute:
aggregator = __get_first_agg(port);
ad_agg_selection_logic(aggregator)
And neither ad_agg_selection_logic nor __get_first_agg are RCU-safe.

> @@ -2093,8 +2093,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
>  		bond_3ad_set_carrier(bond);
>  	}
>  
> -	// for each port run the state machines
> -	bond_for_each_slave(bond, slave, iter) {
> +	/* for each port run the state machines */
> +	bond_for_each_slave_rcu(bond, slave, iter) {
>  		port = &(SLAVE_AD_INFO(slave).port);
>  		if (!port->slave) {
>  			pr_warning("%s: Warning: Found an uninitialized port\n",
> @@ -2114,7 +2114,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
>  		ad_mux_machine(port);
>  		ad_tx_machine(port);
>  
> -		// turn off the BEGIN bit, since we already handled it
> +		/* turn off the BEGIN bit, since we already handled it */
>  		if (port->sm_vars & AD_PORT_BEGIN)
>  			port->sm_vars &= ~AD_PORT_BEGIN;
>  
> @@ -2122,9 +2122,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
>  	}
>  
>  re_arm:
> +	rcu_read_unlock();
>  	queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks);
> -
> -	read_unlock(&bond->lock);
>  }
>  
>  /**
> 

^ permalink raw reply

* pull request: wireless-next 2013-11-08
From: John W. Linville @ 2013-11-08 15:48 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

Dave,

Here is one more pull request for the 3.13 window.  This is primarily
composed of downstream pull requests that were posted while I was
traveling during the last part of the 3.12 release.

For the mac80211 bits, Johannes says:

"I have two DFS fixes (ath9k already supports DFS) and a fix for a
pointer race."

And...

"In this round for mac80211-next I have:
 * mesh channel switch support
 * a CCM rewrite, using potential hardware offloads
 * SMPS for AP mode
 * RF-kill GPIO driver updates to make it usable as an ACPI driver
 * regulatory improvements
 * documentation fixes
 * DFS for IBSS mode
 * and a few small other fixes/improvements"

For the TI driver bits, Luca says:

"Some patches intended for 3.13.  Eliad continues upstreaming pending
patches from the internal tree."

For the iwlwifi bits, Emmanuel says:

"There are a few fixes from Johannes mostly clean up patches. We have
also a few other fixes that are relevant for the new firmware that has
not been released yet."

For the Bluetooth bits, Gustavo says:

"A last fix to the 3.12. I ended forgetting to send it before, I hope we can
still make the way to 3.12. It is a revert and it fixes an issue with bluetooth
suspend/hibernate that had many bug reports. Please pull or let me know of any
problems. Thanks!"  (Obviously, that one didn't make 3.12...)

Also...

"One more big pull request for 3.13. These are the patches we queued during
last week. Here you will find a lot of improvements to the HCI and L2CAP and
MGMT layers with the main ones being a better debugfs support and end of work
of splitting L2CAP into Core and Socket parts."

Additionally, there is one ath9k patch to enable DFS in IBSS mode for
that driver.

I appreciate your consideration for taking this extra pull request
this cycle.  Please let me know if there are problems!

Thanks,

John

---

The following changes since commit dcd607718385d02ce3741de225927a57f528f93b:

  inet: fix a UFO regression (2013-11-08 02:07:59 -0500)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git for-davem

for you to fetch changes up to c1f3bb6bd317994beb3af7bbec4bf54ed0035509:

  Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem (2013-11-08 09:03:10 -0500)

----------------------------------------------------------------

Alexander Bondar (1):
      iwlwifi: mvm: update UAPSD support TLV bits

Andrei Otcheretianski (1):
      nl80211: fix channel switch parsing

Ard Biesheuvel (1):
      mac80211: port CCMP to cryptoapi's CCM driver

Barak Bercovitz (3):
      wlcore: read fw panic log only in host mode
      wlcore: Allow stopping fw log in recovery
      wlcore: wakeup from ELP before starting recovery

Chun-Yeow Yeoh (5):
      mac80211: refactor the parsing of chan switch ie
      mac80211: process the CSA frame for mesh accordingly
      {nl,cfg,mac}80211: enable the triggering of CSA frame in mesh
      {nl,cfg,mac}80211: implement mesh channel switch userspace API
      mac80211: process mesh channel switching using beacon

Eliad Peller (3):
      wlcore: add ap_event_mask
      wlcore: fix started_vifs calculation
      wlcore: save last regdom configuration on stop

Emmanuel Grumbach (3):
      mac80211: implement SMPS for AP
      iwlwifi: mvm: BT Coex fix NULL pointer dereference
      iwlwifi: mvm: BT Coex - fix copy paste issue

Felix Fietkau (1):
      mac80211: add ieee80211_tx_prepare_skb() helper function

Gustavo Padovan (14):
      Bluetooth: Extend state_change() call to report errors too
      Bluetooth: Add l2cap_state_change_and_error()
      Bluetooth: Access sk_sndtimeo indirectly in l2cap_core.c
      Bluetooth: Add chan->ops->set_shutdown()
      Bluetooth: Move l2cap_wait_ack() to l2cap_sock.c
      Bluetooth: use l2cap_chan_ready() instead of duplicate code
      Bluetooth: Remove not used struct sock
      Bluetooth: Do not access chan->sk directly
      Bluetooth: Hold socket in defer callback in L2CAP socket
      Bluetooth: Remove socket lock from l2cap_state_change()
      Bluetooth: Remove parent socket usage from l2cap_core.c
      Bluetooth: Add L2CAP channel to skb private data
      Bluetooth: Use bt_cb(skb)->chan to send raw data back
      Bluetooth: Remove sk member from struct l2cap_chan

Hans de Goede (1):
      Bluetooth: revert: "Bluetooth: Add missing reset_resume dev_pm_ops"

Heikki Krogerus (5):
      net: rfkill: gpio: convert to resource managed allocation
      net: rfkill: gpio: clean up clock handling
      net: rfkill: gpio: spinlock-safe GPIO access
      net: rfkill: gpio: prepare for DT and ACPI support
      net: rfkill: gpio: add ACPI support

Ido Reis (2):
      wlcore: fwlog dynamic mem_block control
      wl12xx/wl18xx: update default fw logger's settings

Igal Chernobelsky (3):
      wl18xx: default config alignment with phy defaults
      wlcore: fix interrogate command length
      wlcore/wl18xx/wl12xx: FW log params per chip arch

Johan Hedberg (20):
      Bluetooth: Fix L2CAP "Command Reject: Invalid CID" response
      Bluetooth: Remove unused command reject mapping for EMSGSIZE
      Bluetooth: Remove useless l2cap_err_to_reason function
      Bluetooth: Ignore A2MP data on non-BR/EDR links
      Bluetooth: Ignore SMP data on non-LE links
      Bluetooth: Fix updating the right variable in update_scan_rsp_data()
      Bluetooth: Reintroduce socket restrictions for LE sockets
      Bluetooth: Convert auto accept timer to use delayed work
      Bluetooth: Convert idle timer to use delayed work
      Bluetooth: Fix ATT socket backwards compatibility with user space
      Bluetooth: Check for flag instead of features in update_scan_rsp_data()
      Bluetooth: Check for flag instead of features in update_adv_data()
      Bluetooth: Add missing check for BREDR_ENABLED flag in update_class()
      Bluetooth: Refactor set_connectable settings update to separate function
      Bluetooth: Fix updating settings when there are no HCI commands to send
      Bluetooth: Move mgmt_pending_find to avoid forward declarations
      Bluetooth: Fix sending write_scan_enable when BR/EDR is disabled
      Bluetooth: Move HCI_LIMITED_DISCOVERABLE changes to a general place
      Bluetooth: Update Set Discoverable to support LE
      Bluetooth: Fix enabling fast connectable on LE-only controllers

Johannes Berg (8):
      cfg80211: fix scheduled scan pointer access
      mac80211: add missing IEEE80211_HW_SUPPORTS_HT_CCK_RATES docs
      cfg80211: fix docbook references
      iwlwifi: transport config n_no_reclaim_cmds should be unsigned
      iwlwifi: pcie: move warning message into warning
      iwlwifi: mvm: capture the FCS in monitor mode
      iwlwifi: mvm: add missing break in debugfs
      iwlwifi: warn if firmware image doesn't exist

John W. Linville (7):
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
      Merge branch 'for-upstream' of git://git.kernel.org/.../bluetooth/bluetooth-next
      Merge branch 'for-linville' of git://git.kernel.org/.../luca/wl12xx
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge branch 'master' of git://git.kernel.org/.../bluetooth/bluetooth
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem

Jouni Malinen (1):
      mac80211_hwsim: Fix tracking of beaconing for multi-vif

Luis R. Rodriguez (5):
      cfg80211: fix nl80211.h documentation for DFS enum states
      cfg80211: rename regulatory_hint_11d() to regulatory_hint_country_ie()
      cfg80211: enable regulatory hints for strict custom settings
      cfg80211: simplify strict custom alpha2 regdomain check
      cfg80211: export reg_initiator_name()

Marcel Holtmann (71):
      Bluetooth: Fix minor coding style issue in set_connectable()
      Bluetooth: Use hci_request for discoverable timeout handling
      Bluetooth: Update advertising data based on management commands
      Bluetooth: Introduce flag for limited discoverable mode
      Bluetooth: Make mgmt_discoverable() return void
      Bluetooth: Make mgmt_connectable() return void
      Bluetooth: Make mgmt_write_scan_failed() return void
      Bluetooth: Update class of device after changing discoverable mode
      Bluetooth: Move arming of discoverable timeout to complete handler
      Bluetooth: Simplify the code for re-arming discoverable timeout
      Bluetooth: Add HCI command structure for writing current IAC LAP
      Bluetooth: Add support for entering limited discoverable mode
      Bluetooth: Make mgmt_new_link_key() return void
      Bluetooth: Move eir_append_data() function into mgmt.c
      Bluetooth: Move eir_get_length() function into hci_event.c
      Bluetooth: Update class of device on discoverable timeout
      Bluetooth: Add l2cap_chan_no_resume stub for A2MP
      Bluetooth: Make mgmt_pin_code_request() return void
      Bluetooth: Make mgmt_pin_code_reply_complete() return void
      Bluetooth: Make mgmt_pin_code_neg_reply_complete() return void
      Bluetooth: Make mgmt_auth_failed() return void
      Bluetooth: Make mgmt_auth_enable_complete() return void
      Bluetooth: Make mgmt_ssp_enable_complete() return void
      Bluetooth: Make mgmt_set_class_of_dev_complete() return void
      Bluetooth: Make mgmt_set_local_name_complete() return void
      Bluetooth: Make mgmt_read_local_oob_data_reply_complete() return void
      Bluetooth: Make mgmt_new_ltk() return void
      Bluetooth: Rename create_ad into create_adv_data
      Bluetooth: Store scan response data in HCI device
      Bluetooth: Set the scan response data when needed
      Bluetooth: Store device name in scan response data
      Bluetooth: Rename update_ad into update_adv_data
      Bluetooth: Remove duplicate definitions for advertising event types
      Bluetooth: Remove enable_hs declaration
      Bluetooth: Socket address parameter for CID is in little endian
      Bluetooth: Expose inquiry_cache debugfs only on BR/EDR controllers
      Bluetooth: Expose auto_accept_delay debugfs only when SSP is supported
      Bluetooth: Expose static address value for LE capable controllers
      Bluetooth: Expose current voice setting in debugfs
      Bluetooth: Add address type to device blacklist table
      Bluetooth: Move blacklist debugfs entry creation into hci_core.c
      Bluetooth: Move uuids debugfs entry creation into hci_core.c
      Bluetooth: Use IS_ERR_OR_NULL for checking bt_debugfs
      Bluetooth: Create HCI device debugfs directory in hci_register_dev
      Bluetooth: Create root debugfs directory during module init
      Bluetooth: Move device_add handling into hci_register_dev
      Bluetooth: Include address type in blacklist debugfs data
      Bluetooth: Move idle_timeout and sniff_{min,max}_interval to hci_core.c
      Bluetooth: Use BDADDR_BREDR type for old blacklist ioctl interface
      Bluetooth: Use hcon directly instead of conn->hcon where possible
      Bluetooth: Block ATT connection on LE when device is blocked
      Bluetooth: Move HCI device features into hci_core.c
      Bluetooth: Add workaround for buggy max_page features page value
      Bluetooth: Remove debug entry for connection features
      Bluetooth: Move manufacturer, hci_ver and hci_rev into hci_core.c
      Bluetooth: Store local version information only during setup phase
      Bluetooth: Move export of class of device information into hci_core.c
      Bluetooth: Expose current list of link keys via debugfs
      Bluetooth: Remove bus attribute in favor of hierarchy
      Bluetooth: Expose white list size information in debugfs
      Bluetooth: Expose current list of long term keys via debugfs
      Bluetooth: Select the own address type during initial setup phase
      Bluetooth: Expose debugfs entry read/write own address type
      Bluetooth: Expose setting if debug keys are used or not
      Bluetooth: Add LE features to debugfs if available
      Bluetooth: Remove interval parameter from HCI connection
      Bluetooth: Add support for setting SSP debug mode
      Bluetooth: Expose debugfs settings for LE connection interval
      Bluetooth: Add support for setting DUT mode
      Bluetooth: Fix UUID values in debugfs file
      Bluetooth: Fix minor coding style issue in hci_core.c

Marco Porsch (1):
      mac80211: fixes for mesh powersave logic

Michael Opdenacker (1):
      iwlwifi: remove duplicate includes

Michal Kazior (3):
      cfg80211: fix DFS channel recovery timeout
      cfg80211: update dfs_state_entered upon dfs_state change
      mac80211: fix uninitialized variable

Seth Forshee (1):
      mac80211: Remove check for offchannel state when waking netdev queues

Simon Wunderlich (3):
      nl80211/cfg80211: enable DFS for IBSS mode
      mac80211: enable DFS for IBSS mode
      ath9k: enable DFS for IBSS mode

Sunil Dutt (1):
      cfg80211: pass station supported channel and oper class info

Victor Goldenshtein (1):
      wlcore: print active channel in the driver_state

 Documentation/DocBook/80211.tmpl            |   4 +-
 drivers/bluetooth/btusb.c                   |   1 -
 drivers/net/wireless/ath/ath9k/init.c       |   3 +-
 drivers/net/wireless/iwlwifi/dvm/ucode.c    |   9 +-
 drivers/net/wireless/iwlwifi/iwl-fw.h       |   3 +-
 drivers/net/wireless/iwlwifi/iwl-io.c       |   1 -
 drivers/net/wireless/iwlwifi/iwl-trans.h    |   2 +-
 drivers/net/wireless/iwlwifi/mvm/bt-coex.c  |   8 +-
 drivers/net/wireless/iwlwifi/mvm/debugfs.c  |   1 +
 drivers/net/wireless/iwlwifi/mvm/fw.c       |   8 +-
 drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c |   8 +-
 drivers/net/wireless/iwlwifi/mvm/mac80211.c |  14 +-
 drivers/net/wireless/iwlwifi/mvm/mvm.h      |   1 -
 drivers/net/wireless/iwlwifi/mvm/ops.c      |   2 +-
 drivers/net/wireless/iwlwifi/mvm/rx.c       |   6 +-
 drivers/net/wireless/iwlwifi/pcie/tx.c      |   9 +-
 drivers/net/wireless/mac80211_hwsim.c       |  27 +-
 drivers/net/wireless/ti/wl12xx/main.c       |  16 +-
 drivers/net/wireless/ti/wl18xx/main.c       |  32 +-
 drivers/net/wireless/ti/wlcore/acx.c        |  10 +-
 drivers/net/wireless/ti/wlcore/cmd.c        |  12 +-
 drivers/net/wireless/ti/wlcore/cmd.h        |   3 +-
 drivers/net/wireless/ti/wlcore/conf.h       |   5 +-
 drivers/net/wireless/ti/wlcore/debugfs.c    |  18 +-
 drivers/net/wireless/ti/wlcore/event.c      |   1 +
 drivers/net/wireless/ti/wlcore/hw_ops.h     |   9 +
 drivers/net/wireless/ti/wlcore/init.c       |   6 +
 drivers/net/wireless/ti/wlcore/io.h         |   4 +-
 drivers/net/wireless/ti/wlcore/main.c       |  74 ++-
 drivers/net/wireless/ti/wlcore/scan.c       |  24 +-
 drivers/net/wireless/ti/wlcore/testmode.c   |   3 +-
 drivers/net/wireless/ti/wlcore/wlcore.h     |   9 +
 drivers/net/wireless/ti/wlcore/wlcore_i.h   |   2 -
 include/linux/ieee80211.h                   |  20 +
 include/net/bluetooth/bluetooth.h           |   1 +
 include/net/bluetooth/hci.h                 |  35 +-
 include/net/bluetooth/hci_core.h            |  89 ++-
 include/net/bluetooth/l2cap.h               |  20 +-
 include/net/cfg80211.h                      |  14 +
 include/net/mac80211.h                      |  18 +
 include/uapi/linux/nl80211.h                |  27 +-
 net/bluetooth/a2mp.c                        |   9 +-
 net/bluetooth/af_bluetooth.c                |   9 +-
 net/bluetooth/hci_conn.c                    |  48 +-
 net/bluetooth/hci_core.c                    | 803 ++++++++++++++++++++++++----
 net/bluetooth/hci_event.c                   |  59 +-
 net/bluetooth/hci_sock.c                    |   4 +-
 net/bluetooth/hci_sysfs.c                   | 373 -------------
 net/bluetooth/l2cap_core.c                  | 227 +++-----
 net/bluetooth/l2cap_sock.c                  | 120 ++++-
 net/bluetooth/mgmt.c                        | 637 +++++++++++++++-------
 net/bluetooth/rfcomm/core.c                 |  14 +-
 net/bluetooth/rfcomm/sock.c                 |  14 +-
 net/bluetooth/sco.c                         |  13 +-
 net/bluetooth/smp.c                         |   4 +-
 net/mac80211/Kconfig                        |  12 +
 net/mac80211/aes_ccm.c                      | 169 ++----
 net/mac80211/aes_ccm.h                      |  14 +-
 net/mac80211/cfg.c                          | 142 ++++-
 net/mac80211/debug.h                        |  10 +
 net/mac80211/debugfs_netdev.c               |  25 +-
 net/mac80211/ht.c                           |  41 +-
 net/mac80211/ibss.c                         | 116 ++--
 net/mac80211/ieee80211_i.h                  |  50 +-
 net/mac80211/iface.c                        |   3 +
 net/mac80211/key.h                          |   2 +-
 net/mac80211/mesh.c                         | 302 ++++++++++-
 net/mac80211/mesh_plink.c                   |   3 +-
 net/mac80211/mesh_ps.c                      |  33 +-
 net/mac80211/mlme.c                         |  32 +-
 net/mac80211/rx.c                           |   5 +-
 net/mac80211/spectmgmt.c                    |  33 +-
 net/mac80211/sta_info.c                     |  72 +++
 net/mac80211/sta_info.h                     |   5 +
 net/mac80211/status.c                       |  31 +-
 net/mac80211/tx.c                           |  45 ++
 net/mac80211/util.c                         | 124 ++++-
 net/mac80211/wpa.c                          |  44 +-
 net/rfkill/Kconfig                          |   2 +-
 net/rfkill/rfkill-gpio.c                    | 211 ++++----
 net/wireless/chan.c                         |   3 +-
 net/wireless/ibss.c                         |  24 +-
 net/wireless/mlme.c                         |   6 +-
 net/wireless/nl80211.c                      |  62 ++-
 net/wireless/reg.c                          |  14 +-
 net/wireless/reg.h                          |   4 +-
 net/wireless/scan.c                         |   4 +-
 net/wireless/sme.c                          |   4 +-
 net/wireless/util.c                         |  14 +-
 89 files changed, 3037 insertions(+), 1517 deletions(-)
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: Using HTB over MultiQ
From: Anton 'EvilMan' Danilov @ 2013-11-08 15:53 UTC (permalink / raw)
  To: John Fastabend; +Cc: Eric Dumazet, netdev
In-Reply-To: <527CFF2C.2020605@intel.com>

2013/11/8 John Fastabend <john.r.fastabend@intel.com>:

> perf would be interesting but note that multiq still uses the root qdisc
> lock which you original stated you were trying to avoid.
>
> mq and mqprio are really the only two existing qdiscs that work well for
> performance with small packet sizes and multiqueue nics at least in my
> experience/setup with these kinds of micro-benchmarks.
>
> .John
>

Hm.. I think I need another way to classify packets for using of mq
qdisc, because it don't support classify at root (not supported error
on try attach filter).
On next week i'll try to write ipset extension for setting of priority
and queue_mapping value through the IPSET netfilter target.


-- 
Anton.

^ permalink raw reply

* Re: [PATCH net-next v2 6/10] bonding: rebuild the lock use for bond_activebackup_arp_mon()
From: Nikolay Aleksandrov @ 2013-11-08 16:01 UTC (permalink / raw)
  To: Ding Tianhong
  Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller, Veaceslav Falico,
	Netdev
In-Reply-To: <527C4784.1030402@huawei.com>

On 11/08/2013 03:08 AM, Ding Tianhong wrote:
> The bond_activebackup_arp_mon() use the bond lock for read to
> protect the slave list, it is no effect, and the RTNL is only
> called for bond_ab_arp_commit() and peer notify, for the performance
> better, use RCU instead of the bond lock, because the bond slave
> list need to called in RCU, add a new bond_first_slave_rcu()
> to get the first slave in RCU protection.
> 
> When bond_ab_arp_inspect() and should_notify_peers is true, the
> RTNL will called twice, it is a loss of performance, so make the
> two RTNL together to avoid performance loss.
> 
> Suggested-by: Jay Vosburgh <fubar@us.ibm.com>
> Suggested-by: Veaceslav Falico <vfalico@redhat.com>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> ---
>  drivers/net/bonding/bond_main.c | 35 +++++++++++++++++++----------------
>  drivers/net/bonding/bonding.h   |  7 +++++++
>  2 files changed, 26 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 759dcd0..b48ca55 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -2524,7 +2524,7 @@ static int bond_ab_arp_inspect(struct bonding *bond)
>  	struct slave *slave;
>  	int commit = 0;
>  
> -	bond_for_each_slave(bond, slave, iter) {
> +	bond_for_each_slave_rcu(bond, slave, iter) {
>  		slave->new_link = BOND_LINK_NOCHANGE;
>  		last_rx = slave_last_rx(bond, slave);
>  
> @@ -2586,7 +2586,7 @@ static int bond_ab_arp_inspect(struct bonding *bond)
>   * Called to commit link state changes noted by inspection step of
>   * active-backup mode ARP monitor.
>   *
> - * Called with RTNL and bond->lock for read.
> + * Called with RTNL hold.
>   */
>  static void bond_ab_arp_commit(struct bonding *bond)
>  {
> @@ -2661,7 +2661,7 @@ do_failover:
>  /*
>   * Send ARP probes for active-backup mode ARP monitor.
>   *
> - * Called with bond->lock held for read.
> + * Called with rcu_read_lock hold.
>   */
>  static void bond_ab_arp_probe(struct bonding *bond)
>  {
> @@ -2690,14 +2690,14 @@ static void bond_ab_arp_probe(struct bonding *bond)
>  	 */
>  
>  	if (!bond->current_arp_slave) {
> -		bond->current_arp_slave = bond_first_slave(bond);
> +		bond->current_arp_slave = bond_first_slave_rcu(bond);
>  		if (!bond->current_arp_slave)
>  			return;
>  	}
>  
>  	bond_set_slave_inactive_flags(bond->current_arp_slave);
>  
> -	bond_for_each_slave(bond, slave, iter) {
> +	bond_for_each_slave_rcu(bond, slave, iter) {
>  		if (!found && !before && IS_UP(slave->dev))
>  			before = slave;
>  
> @@ -2745,43 +2745,46 @@ void bond_activebackup_arp_mon(struct work_struct *work)
>  	bool should_notify_peers = false;
>  	int delta_in_ticks;
>  
> -	read_lock(&bond->lock);
> -
>  	delta_in_ticks = msecs_to_jiffies(bond->params.arp_interval);
>  
> -	if (!bond_has_slaves(bond))
> +	rcu_read_lock();
> +
> +	if (!bond_has_slaves_rcu(bond)) {
> +		rcu_read_unlock();
>  		goto re_arm;
> +	}
>  
>  	should_notify_peers = bond_should_notify_peers(bond);
Again, bond_should_notify_peers() is not RCU-safe.

>  
>  	if (bond_ab_arp_inspect(bond)) {
> -		read_unlock(&bond->lock);
> +		rcu_read_unlock();
>  
>  		/* Race avoidance with bond_close flush of workqueue */
>  		if (!rtnl_trylock()) {
> -			read_lock(&bond->lock);
>  			delta_in_ticks = 1;
>  			should_notify_peers = false;
>  			goto re_arm;
>  		}
>  
> -		read_lock(&bond->lock);
> -
>  		bond_ab_arp_commit(bond);
>  
> -		read_unlock(&bond->lock);
> +		if (should_notify_peers) {
> +			call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
> +					bond->dev);
> +			should_notify_peers = false;
> +		}
> +
>  		rtnl_unlock();
> -		read_lock(&bond->lock);
> +		rcu_read_lock();
>  	}
>  
>  	bond_ab_arp_probe(bond);
Generally you might be safe in bond_ab_arp_probe() due to the synchronization
done by netdev_rx_handler_unregister(), but this code may run after that (and
after the unlinked slave) but before current_arp_slave is set to NULL and thus
use it. Now I don't see a direct problem with that, only a complication that can
bite us later. I vaguely remember that I re-worked the bond_ab_arp_probe() and
the way current_arp_slave works when doing this transition in my patches.

> +	rcu_read_unlock();
>  
>  re_arm:
>  	if (bond->params.arp_interval)
>  		queue_delayed_work(bond->wq, &bond->arp_work, delta_in_ticks);
>  
> -	read_unlock(&bond->lock);
> -
>  	if (should_notify_peers) {
>  		if (!rtnl_trylock())
>  			return;
> diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
> index deb9738..90b745c 100644
> --- a/drivers/net/bonding/bonding.h
> +++ b/drivers/net/bonding/bonding.h
> @@ -97,6 +97,13 @@
>  		netdev_adjacent_get_private(bond_slave_list(bond)->prev) : \
>  		NULL)
>  
> +#define bond_first_slave_rcu(bond) \
> +	({struct list_head *__ptr = (bond_slave_list(bond)); \
> +	 struct list_head *__next = ACCESS_ONCE(__ptr->next); \
> +	 likely(__ptr != __next) ? \
> +	 netdev_adjacent_get_private_rcu(__next) : NULL; \
> +	 })
> +
Honestly, I don't like this, it sure can be re-written in a more
straight-forward manner.

>  #define bond_is_first_slave(bond, pos) (pos == bond_first_slave(bond))
>  #define bond_is_last_slave(bond, pos) (pos == bond_last_slave(bond))
>  
> 

^ permalink raw reply

* Re: [PATCH net-next v2 3/10] bonding: rebuild the lock use for bond_alb_monitor()
From: Nikolay Aleksandrov @ 2013-11-08 16:07 UTC (permalink / raw)
  To: Ding Tianhong
  Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller, Veaceslav Falico,
	Netdev
In-Reply-To: <527C4778.5080209@huawei.com>

On 11/08/2013 03:07 AM, Ding Tianhong wrote:
> The bond_alb_monitor use bond lock to protect the bond slave list,
> it is no effect here, we need to use RTNL or RCU to replace bond lock,
> the bond_alb_monitor will called 10 times one second, RTNL may loss
> performance here, so the bond lock replace with RCU to protect the
> bond slave list, also the RTNL is preserved, the logic of the monitor
> did not changed.
> 
> Suggested-by: Jay Vosburgh <fubar@us.ibm.com>
> Suggested-by: Veaceslav Falico <vfalico@redhat.com>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> ---
>  drivers/net/bonding/bond_alb.c | 21 +++++++++------------
>  1 file changed, 9 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
> index 1fae915..ffdb91b 100644
> --- a/drivers/net/bonding/bond_alb.c
> +++ b/drivers/net/bonding/bond_alb.c
> @@ -816,7 +816,7 @@ static void rlb_rebalance(struct bonding *bond)
>  	for (; hash_index != RLB_NULL_INDEX;
>  	     hash_index = client_info->used_next) {
>  		client_info = &(bond_info->rx_hashtbl[hash_index]);
> -		assigned_slave = rlb_next_rx_slave(bond);
> +		assigned_slave = __rlb_next_rx_slave(bond);
>  		if (assigned_slave && (client_info->slave != assigned_slave)) {
>  			client_info->slave = assigned_slave;
>  			client_info->ntt = 1;
> @@ -1495,9 +1495,10 @@ void bond_alb_monitor(struct work_struct *work)
>  	struct list_head *iter;
>  	struct slave *slave;
>  
> -	read_lock(&bond->lock);
> +	rcu_read_lock();
>  
> -	if (!bond_has_slaves(bond)) {
> +	if (!bond_has_slaves_rcu(bond)) {
> +		rcu_read_unlock();
>  		bond_info->tx_rebalance_counter = 0;
>  		bond_info->lp_counter = 0;
>  		goto re_arm;
If I'm not mistaken there's one more bond_for_each_slave() inside this function
which should be converted to RCU.

> @@ -1528,7 +1529,7 @@ void bond_alb_monitor(struct work_struct *work)
>  
>  		read_lock(&bond->curr_slave_lock);
>  
> -		bond_for_each_slave(bond, slave, iter) {
> +		bond_for_each_slave_rcu(bond, slave, iter) {
>  			tlb_clear_slave(bond, slave, 1);
>  			if (slave == bond->curr_active_slave) {
>  				SLAVE_TLB_INFO(slave).load =
> @@ -1552,11 +1553,9 @@ void bond_alb_monitor(struct work_struct *work)
>  			 * dev_set_promiscuity requires rtnl and
>  			 * nothing else.  Avoid race with bond_close.
>  			 */
> -			read_unlock(&bond->lock);
> -			if (!rtnl_trylock()) {
> -				read_lock(&bond->lock);
> +			rcu_read_unlock();
> +			if (!rtnl_trylock())
>  				goto re_arm;
> -			}
>  
>  			bond_info->rlb_promisc_timeout_counter = 0;
>  
> @@ -1568,7 +1567,7 @@ void bond_alb_monitor(struct work_struct *work)
>  			bond_info->primary_is_promisc = 0;
>  
>  			rtnl_unlock();
> -			read_lock(&bond->lock);
> +			rcu_read_lock();
>  		}
>  
>  		if (bond_info->rlb_rebalance) {
> @@ -1590,11 +1589,9 @@ void bond_alb_monitor(struct work_struct *work)
>  			}
>  		}
>  	}
> -
> +	rcu_read_unlock();
>  re_arm:
>  	queue_delayed_work(bond->wq, &bond->alb_work, alb_delta_in_ticks);
> -
> -	read_unlock(&bond->lock);
>  }
>  
>  /* assumption: called before the slave is attached to the bond
> 

^ permalink raw reply

* Fwd: Using HTB over MultiQ
From: Anton 'EvilMan' Danilov @ 2013-11-08 16:11 UTC (permalink / raw)
  To: netdev, John Fastabend, Eric Dumazet
In-Reply-To: <CAEzD07LmzCtVWM4wnq57N+NfqDUK3bLWDisSceyPfg4MiWz5=Q@mail.gmail.com>

3/11/8 Eric Dumazet <eric.dumazet@gmail.com>:
> Please post :
>
> ethtool -S eth0  # or other nics
>
dau@diamond-b-new:~$ sudo ethtool -i eth0
driver: ixgbe
version: 3.18.7
firmware-version: 0x61c10001
bus-info: 0000:06:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

dau@diamond-b-new:~$ sudo ethtool -S eth0
NIC statistics:
     rx_packets: 27615733650
     tx_packets: 22631364386
     rx_bytes: 21970067159056
     tx_bytes: 10777613703708
     rx_errors: 970
     tx_errors: 0
     rx_dropped: 0
     tx_dropped: 0
     multicast: 0
     collisions: 0
     rx_over_errors: 0
     rx_crc_errors: 969
     rx_frame_errors: 0
     rx_fifo_errors: 0
     rx_missed_errors: 0
     tx_aborted_errors: 0
     tx_carrier_errors: 0
     tx_fifo_errors: 0
     tx_heartbeat_errors: 0
     rx_pkts_nic: 27615733771
     tx_pkts_nic: 22631364450
     rx_bytes_nic: 22080530126479
     tx_bytes_nic: 10903921708333
     lsc_int: 7
     tx_busy: 0
     non_eop_descs: 0
     broadcast: 1
     rx_no_buffer_count: 0
     tx_timeout_count: 0
     tx_restart_queue: 0
     rx_long_length_errors: 0
     rx_short_length_errors: 0
     tx_flow_control_xon: 6158021
     rx_flow_control_xon: 0
     tx_flow_control_xoff: 6492967
     rx_flow_control_xoff: 0
     rx_csum_offload_errors: 10963
     alloc_rx_page_failed: 0
     alloc_rx_buff_failed: 0
     rx_no_dma_resources: 0
     hw_rsc_aggregated: 0
     hw_rsc_flushed: 0
     fdir_match: 12699568207
     fdir_miss: 17278480118
     fdir_overflow: 105313
     os2bmc_rx_by_bmc: 0
     os2bmc_tx_by_bmc: 0
     os2bmc_tx_by_host: 0
     os2bmc_rx_by_host: 0
     tx_queue_0_packets: 3513849609
     tx_queue_0_bytes: 1713928985198
     tx_queue_1_packets: 2975756171
     tx_queue_1_bytes: 1482722458160
     tx_queue_2_packets: 2767637888
     tx_queue_2_bytes: 1193622863115
     tx_queue_3_packets: 2544906780
     tx_queue_3_bytes: 1135152930636
     tx_queue_4_packets: 2372537806
     tx_queue_4_bytes: 999288935581
     tx_queue_5_packets: 2440784133
     tx_queue_5_bytes: 1061348848250
     tx_queue_6_packets: 3649915131
     tx_queue_6_bytes: 2220031265880
     tx_queue_7_packets: 2365976873
     tx_queue_7_bytes: 971517421682
    ...skip empty queues..
     rx_queue_0_packets: 3833356046
     rx_queue_0_bytes: 2979383872046
     rx_queue_1_packets: 3468460501
     rx_queue_1_bytes: 2944894700402
     rx_queue_2_packets: 4490817931
     rx_queue_2_bytes: 3331801734194
     rx_queue_3_packets: 3040960354
     rx_queue_3_bytes: 2311877907901
     rx_queue_4_packets: 2825992742
     rx_queue_4_bytes: 2145413330911
     rx_queue_5_packets: 3032906907
     rx_queue_5_bytes: 2455554004223
     rx_queue_6_packets: 3675117297
     rx_queue_6_bytes: 3266611260920
     rx_queue_7_packets: 3248121993
     rx_queue_7_bytes: 2534530380798

> perf record -a -g sleep 10
>
> perf report | tail -n 200
>
# Samples: 299K of event 'cycles'
# Event count (approx.): 274090453333
#
# Overhead          Command             Shared Object
                     Symbol
# ........  ...............  ........................
...........................................
#
    11.36%          swapper  [kernel.kallsyms]         [k]
_raw_spin_lock
                    |
                    --- _raw_spin_lock
                       |
                       |--92.83%-- dev_queue_xmit
                       |          ip_finish_output
                       |          ip_output
                       |          ip_forward_finish
                       |          ip_forward
                       |          ip_rcv_finish
                       |          ip_rcv
                       |          __netif_receive_skb_core
                       |          __netif_receive_skb
                       |          netif_receive_skb
                       |          napi_gro_receive
                       |          ixgbe_poll
                       |          net_rx_action
                       |          __do_softirq
                       |          call_softirq
                       |          do_softirq
                       |          irq_exit
                       |          |
                       |          |--96.12%-- do_IRQ
                       |          |          common_interrupt
                       |          |          |
                       |          |          |--86.81%-- cpuidle_idle_call
                       |          |          |          arch_cpu_idle
                       |          |          |          cpu_startup_entry
                       |          |          |          |
                       |          |          |          |--78.31%--
start_secondary
                       |          |          |          |
                       |          |          |           --21.69%-- rest_init
                       |          |          |                     start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |
x86_64_start_kernel
                       |          |          |
                       |          |          |--12.90%-- cpuidle_enter_state
                       |          |          |          cpuidle_idle_call
                       |          |          |          arch_cpu_idle
                       |          |          |          cpu_startup_entry
                       |          |          |          |
                       |          |          |          |--80.50%--
start_secondary
                       |          |          |          |
                       |          |          |           --19.50%-- rest_init
                       |          |          |                     start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |
x86_64_start_kernel
                       |          |           --0.30%-- [...]
                       |          |
                       |          |--3.87%-- smp_apic_timer_interrupt
                       |          |          apic_timer_interrupt
                       |          |          |
                       |          |          |--44.35%-- cpu_startup_entry
                       |          |          |          |
                       |          |          |          |--72.25%--
start_secondary
                       |          |          |          |
                       |          |          |           --27.75%-- rest_init
                       |          |          |                     start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |
x86_64_start_kernel
                       |          |          |
                       |          |          |--37.26%-- cpuidle_idle_call
                       |          |          |          arch_cpu_idle
                       |          |          |          cpu_startup_entry
                       |          |          |          |
                       |          |          |          |--80.34%--
start_secondary
                       |          |          |          |
                       |          |          |           --19.66%-- rest_init
                       |          |          |                     start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |
x86_64_start_kernel
                       |          |          |
                       |          |          |--8.83%-- cpuidle_enter_state
                       |          |          |          cpuidle_idle_call
                       |          |          |          arch_cpu_idle
                       |          |          |          cpu_startup_entry
                       |          |          |          |
                       |          |          |          |--76.66%--
start_secondary
                       |          |          |          |
                       |          |          |           --23.34%-- rest_init
                       |          |          |                     start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |
x86_64_start_kernel
                       |          |          |
                       |          |          |--3.54%-- arch_cpu_idle
                       |          |          |          cpu_startup_entry
                       |          |          |          |
                       |          |          |          |--55.28%--
start_secondary
                       |          |          |          |
                       |          |          |           --44.72%-- rest_init
                       |          |          |                     start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |
x86_64_start_kernel
                       |          |          |
                       |          |          |--2.10%-- start_secondary
                       |          |          |
                       |          |          |--2.02%-- __schedule
                       |          |          |          schedule
                       |          |          |
schedule_preempt_disabled
                       |          |          |          cpu_startup_entry
                       |          |          |          |
                       |          |          |          |--75.10%--
start_secondary
                       |          |          |          |
                       |          |          |           --24.90%-- rest_init
                       |          |          |                     start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |
x86_64_start_kernel
                       |          |          |
                       |          |          |--0.92%-- rest_init
                       |          |          |          start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |          x86_64_start_kernel
                       |          |          |
                       |          |          |--0.55%-- ns_to_timeval
                       |          |          |          cpuidle_enter_state
                       |          |          |          cpuidle_idle_call
                       |          |          |          arch_cpu_idle
                       |          |          |          cpu_startup_entry
                       |          |          |          rest_init
                       |          |          |          start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |          x86_64_start_kernel
                       |          |           --0.43%-- [...]
                       |           --0.01%-- [...]
                       |
                       |--5.76%-- sch_direct_xmit
                       |          __qdisc_run
                       |          |
                       |          |--99.95%-- dev_queue_xmit
                       |          |          ip_finish_output
                       |          |          ip_output
                       |          |          ip_forward_finish
                       |          |          ip_forward
                       |          |          ip_rcv_finish
                       |          |          ip_rcv
                       |          |          __netif_receive_skb_core
                       |          |          __netif_receive_skb
                       |          |          netif_receive_skb
                       |          |          napi_gro_receive
                       |          |          ixgbe_poll
                       |          |          net_rx_action
                       |          |          __do_softirq
                       |          |          call_softirq
                       |          |          do_softirq
                       |          |          irq_exit
                       |          |          |
                       |          |          |--99.10%-- do_IRQ
                       |          |          |          common_interrupt
                       |          |          |          |
                       |          |          |          |--86.84%--
cpuidle_idle_call
                       |          |          |          |          arch_cpu_idle
                       |          |          |          |
cpu_startup_entry
                       |          |          |          |          |
                       |          |          |          |
|--79.93%-- start_secondary
                       |          |          |          |          |
                       |          |          |          |
--20.07%-- rest_init
                       |          |          |          |
       start_kernel
                       |          |          |          |
       x86_64_start_reservations
                       |          |          |          |
       x86_64_start_kernel
                       |          |          |          |
                       |          |          |          |--12.81%--
cpuidle_enter_state
                       |          |          |          |
cpuidle_idle_call
                       |          |          |          |          arch_cpu_idle
                       |          |          |          |
cpu_startup_entry
                       |          |          |          |          |
                       |          |          |          |
|--78.16%-- start_secondary
                       |          |          |          |          |
                       |          |          |          |
--21.84%-- rest_init
                       |          |          |          |
       start_kernel
                       |          |          |          |
       x86_64_start_reservations
                       |          |          |          |
       x86_64_start_kernel
                       |          |          |           --0.34%-- [...]
                       |          |          |
                       |          |           --0.90%-- smp_apic_timer_interrupt
                       |          |                     apic_timer_interrupt
                       |          |                     |
                       |          |                     |--49.13%--
cpuidle_idle_call
                       |          |                     |          arch_cpu_idle
                       |          |                     |
cpu_startup_entry
                       |          |                     |          |
                       |          |                     |
|--67.34%-- start_secondary
                       |          |                     |          |
                       |          |                     |
--32.66%-- rest_init
                       |          |                     |
       start_kernel
                       |          |                     |
       x86_64_start_reservations
                       |          |                     |
       x86_64_start_kernel
                       |          |                     |
                       |          |                     |--28.97%--
cpu_startup_entry
                       |          |                     |          |
                       |          |                     |
|--55.35%-- rest_init
                       |          |                     |          |
       start_kernel
                       |          |                     |          |
       x86_64_start_reservations
                       |          |                     |          |
       x86_64_start_kernel
                       |          |                     |          |
                       |          |                     |
--44.65%-- start_secondary
                       |          |                     |
                       |          |                     |--5.56%--
cpuidle_enter_state
                       |          |                     |
cpuidle_idle_call
                       |          |                     |          arch_cpu_idle
                       |          |                     |
cpu_startup_entry
                       |          |                     |
start_secondary
                       |          |                     |
                       |          |                     |--5.54%-- __schedule
                       |          |                     |          schedule
                       |          |                     |
schedule_preempt_disabled
                       |          |                     |
cpu_startup_entry
                       |          |                     |
start_secondary
                       |          |                     |
                       |          |                     |--5.45%--
start_secondary
                       |          |                     |
                       |          |                      --5.35%-- arch_cpu_idle
                       |          |
cpu_startup_entry
                       |          |
start_secondary
                       |           --0.05%-- [...]
                       |
                       |--0.70%-- __hrtimer_start_range_ns
                       |          hrtimer_start
                       |          htb_dequeue
                       |          0xffffffffa02e5089
                       |          __qdisc_run
                       |          dev_queue_xmit
                       |          ip_finish_output
                       |          ip_output
                       |          ip_forward_finish
                       |          ip_forward
                       |          ip_rcv_finish
                       |          ip_rcv
                       |          __netif_receive_skb_core
                       |          __netif_receive_skb
                       |          netif_receive_skb
                       |          napi_gro_receive
                       |          ixgbe_poll
                       |          net_rx_action
                       |          __do_softirq
                       |          call_softirq
                       |          do_softirq
                       |          irq_exit
                       |          |
                       |          |--98.36%-- do_IRQ
                       |          |          common_interrupt
                       |          |          |
                       |          |          |--83.48%-- cpuidle_idle_call
                       |          |          |          arch_cpu_idle
                       |          |          |          cpu_startup_entry
                       |          |          |          |
                       |          |          |          |--79.48%--
start_secondary
                       |          |          |          |
                       |          |          |           --20.52%-- rest_init
                       |          |          |                     start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |
x86_64_start_kernel
                       |          |          |
                       |          |          |--15.24%-- cpuidle_enter_state
                       |          |          |          cpuidle_idle_call
                       |          |          |          arch_cpu_idle
                       |          |          |          cpu_startup_entry
                       |          |          |          |
                       |          |          |          |--91.68%--
start_secondary
                       |          |          |          |
                       |          |          |           --8.32%-- rest_init
                       |          |          |                     start_kernel
                       |          |          |
x86_64_start_reservations
                       |          |          |
x86_64_start_kernel
                       |          |           --1.28%-- [...]
                       |          |
                       |           --1.64%-- smp_apic_timer_interrupt
                       |                     apic_timer_interrupt
                       |                     |
                       |                     |--75.50%-- cpuidle_idle_call
                       |                     |          arch_cpu_idle
                       |                     |          cpu_startup_entry
                       |                     |          start_secondary
                       |                     |
                       |                      --24.50%-- cpu_startup_entry
                       |                                rest_init
                       |                                start_kernel



> And possibly it would be nice if you send your tc script so that we can
> check ;)
>
>

#!/sbin/tc -b
 #generated by script

 #internal networks iface (customers) - eth0
 #external iface - eth1

 qdisc add dev eth0 root handle 10: multiq

 #htb qdisc with root and default classes per hw-queue

 qdisc add dev eth0 parent 10:1 handle 11: htb default 2
 class add dev eth0 parent 11: classid 11:1 htb rate 1250Mbit
 class add dev eth0 parent 11:1 classid 11:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth0 parent 10:2 handle 12: htb default 2
 class add dev eth0 parent 12: classid 12:1 htb rate 1250Mbit
 class add dev eth0 parent 12:1 classid 12:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth0 parent 10:3 handle 13: htb default 2
 class add dev eth0 parent 13: classid 13:1 htb rate 1250Mbit
 class add dev eth0 parent 13:1 classid 13:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth0 parent 10:4 handle 14: htb default 2
 class add dev eth0 parent 14: classid 14:1 htb rate 1250Mbit
 class add dev eth0 parent 14:1 classid 14:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth0 parent 10:5 handle 15: htb default 2
 class add dev eth0 parent 15: classid 15:1 htb rate 1250Mbit
 class add dev eth0 parent 15:1 classid 15:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth0 parent 10:6 handle 16: htb default 2
 class add dev eth0 parent 16: classid 16:1 htb rate 1250Mbit
 class add dev eth0 parent 16:1 classid 16:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth0 parent 10:7 handle 17: htb default 2
 class add dev eth0 parent 17: classid 17:1 htb rate 1250Mbit
 class add dev eth0 parent 17:1 classid 17:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth0 parent 10:8 handle 18: htb default 2
 class add dev eth0 parent 18: classid 18:1 htb rate 1250Mbit
 class add dev eth0 parent 18:1 classid 18:2 htb rate 125Mbit ceil 1250Mbit

 qdisc add dev eth1 root handle 10: multiq
 qdisc add dev eth1 parent 10:1 handle 11: htb default 2
 class add dev eth1 parent 11: classid 11:1 htb rate 1250Mbit
 class add dev eth1 parent 11:1 classid 11:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth1 parent 10:2 handle 12: htb default 2
 class add dev eth1 parent 12: classid 12:1 htb rate 1250Mbit
 class add dev eth1 parent 12:1 classid 12:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth1 parent 10:3 handle 13: htb default 2
 class add dev eth1 parent 13: classid 13:1 htb rate 1250Mbit
 class add dev eth1 parent 13:1 classid 13:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth1 parent 10:4 handle 14: htb default 2
 class add dev eth1 parent 14: classid 14:1 htb rate 1250Mbit
 class add dev eth1 parent 14:1 classid 14:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth1 parent 10:5 handle 15: htb default 2
 class add dev eth1 parent 15: classid 15:1 htb rate 1250Mbit
 class add dev eth1 parent 15:1 classid 15:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth1 parent 10:6 handle 16: htb default 2
 class add dev eth1 parent 16: classid 16:1 htb rate 1250Mbit
 class add dev eth1 parent 16:1 classid 16:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth1 parent 10:7 handle 17: htb default 2
 class add dev eth1 parent 17: classid 17:1 htb rate 1250Mbit
 class add dev eth1 parent 17:1 classid 17:2 htb rate 125Mbit ceil 1250Mbit
 qdisc add dev eth1 parent 10:8 handle 18: htb default 2
 class add dev eth1 parent 18: classid 18:1 htb rate 1250Mbit
 class add dev eth1 parent 18:1 classid 18:2 htb rate 125Mbit ceil 1250Mbit

 #one leaf class with pfifo qdisc per customer
 class add dev eth0 parent 16:1 classid 16:1237 htb rate 1024kbit
 qdisc add dev eth0 parent 16:1237 handle 1237 pfifo limit 50
 class add dev eth1 parent 16:1 classid 16:1237 htb rate 1024kbit
 qdisc add dev eth1 parent 16:1237 handle 1237 pfifo limit 50
 class add dev eth0 parent 15:1 classid 15:1244 htb rate 512kbit
 qdisc add dev eth0 parent 15:1244 handle 1244 pfifo limit 50
 class add dev eth1 parent 15:1 classid 15:1244 htb rate 512kbit
 qdisc add dev eth1 parent 15:1244 handle 1244 pfifo limit 50
 class add dev eth0 parent 18:1 classid 18:1191 htb rate 4096kbit
 qdisc add dev eth0 parent 18:1191 handle 1191 pfifo limit 50
 class add dev eth1 parent 18:1 classid 18:1191 htb rate 4096kbit
 qdisc add dev eth1 parent 18:1191 handle 1191 pfifo limit 50
 class add dev eth0 parent 12:1 classid 12:1193 htb rate 40960kbit
 qdisc add dev eth0 parent 12:1193 handle 1193 pfifo limit 50
 class add dev eth1 parent 12:1 classid 12:1193 htb rate 40960kbit
 qdisc add dev eth1 parent 12:1193 handle 1193 pfifo limit 50
 class add dev eth0 parent 13:1 classid 13:1194 htb rate 2048kbit
 qdisc add dev eth0 parent 13:1194 handle 1194 pfifo limit 50
 ...skip several hundreds line...

#classifier on u32 filter with hashing.

#my own network
 filter add dev eth0 protocol ip prio 5 parent 10:0 handle ::1 u32
match ip src 87.244.0.0/24 classid 11:3 action skbedit queue_mapping 1
priority 11:2
 filter add dev eth1 protocol ip prio 5 parent 10:0 handle ::1 u32
match ip dst 87.244.0.0/24 classid 11:3 action skbedit queue_mapping 1
priority 11:2

#hash table per subnet
# 217
 filter add dev eth0 protocol ip prio 5 parent 10:0 handle 100: u32 divisor 256
 filter add dev eth1 protocol ip prio 5 parent 10:0 handle 100: u32 divisor 256
# 10.
 filter add dev eth0 protocol ip prio 5 parent 10:0 handle 200: u32 divisor 256
 filter add dev eth1 protocol ip prio 5 parent 10:0 handle 200: u32 divisor 256
# 87.244
 filter add dev eth0 protocol ip prio 5 parent 10:0 handle 400: u32 divisor 256
 filter add dev eth1 protocol ip prio 5 parent 10:0 handle 400: u32 divisor 256
# 195.208.174
 filter add dev eth0 protocol ip prio 5 parent 10:0 handle 500: u32 divisor 256
 filter add dev eth1 protocol ip prio 5 parent 10:0 handle 500: u32 divisor 256

 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 800:: match
ip dst 217.170.112.0/20 hashkey mask 0x0000ff00 at 16 link 100:
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 800:: match
ip src 217.170.112.0/20 hashkey mask 0x0000ff00 at 12 link 100:
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 800:: match
ip dst 87.244.0.0/18 hashkey mask 0x0000ff00 at 16 link 400:
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 800:: match
ip src 87.244.0.0/18 hashkey mask 0x0000ff00 at 12 link 400:
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 800:: match
ip dst 10.245.0.0/22 hashkey mask 0x0000ff00 at 16 link 200:
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 800:: match
ip src 10.245.0.0/22 hashkey mask 0x0000ff00 at 12 link 200:
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 800:: match
ip dst 195.208.174.0/24 hashkey mask 0x0000ff00 at 16 link 500:
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 800:: match
ip src 195.208.174.0/24 hashkey mask 0x0000ff00 at 12 link 500:

 filter add dev eth0 protocol ip prio 5 parent 10:0 handle 1: u32 divisor 256
 filter add dev eth1 protocol ip prio 5 parent 10:0 handle 1: u32 divisor 256
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 400:0:
match ip dst 87.244.0.0/24 hashkey mask 0x000000ff at 16 link 1:
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 400:0:
match ip src 87.244.0.0/24 hashkey mask 0x000000ff at 12 link 1:
 filter add dev eth0 protocol ip prio 5 parent 10:0 handle 2: u32 divisor 256
 filter add dev eth1 protocol ip prio 5 parent 10:0 handle 2: u32 divisor 256
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 400:1:
match ip dst 87.244.1.0/24 hashkey mask 0x000000ff at 16 link 2:
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 400:1:
match ip src 87.244.1.0/24 hashkey mask 0x000000ff at 12 link 2:

#fill the list of filters. one filter per ip (need to optimize! should
be filter per customer's subnet!)
#set priority! otherwise classifying is lost on enter to HTB qdisc!
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 2:4: match
ip dst 87.244.1.4 classid 18:2911 action skbedit queue_mapping 7
priority 18:2911
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 2:4: match
ip src 87.244.1.4 classid 18:2911 action skbedit queue_mapping 7
priority 18:2911
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 2:5: match
ip dst 87.244.1.5 classid 18:2911 action skbedit queue_mapping 7
priority 18:2911
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 2:5: match
ip src 87.244.1.5 classid 18:2911 action skbedit queue_mapping 7
priority 18:2911
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 2:6: match
ip dst 87.244.1.6 classid 18:2911 action skbedit queue_mapping 7
priority 18:2911
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 2:6: match
ip src 87.244.1.6 classid 18:2911 action skbedit queue_mapping 7
priority 18:2911
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 2:7: match
ip dst 87.244.1.7 classid 18:2911 action skbedit queue_mapping 7
priority 18:2911
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 2:7: match
ip src 87.244.1.7 classid 18:2911 action skbedit queue_mapping 7
priority 18:2911
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 2:c: match
ip dst 87.244.1.12 classid 13:3306 action skbedit queue_mapping 2
priority 13:3306
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 2:c: match
ip src 87.244.1.12 classid 13:3306 action skbedit queue_mapping 2
priority 13:3306
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 2:d: match
ip dst 87.244.1.13 classid 13:3306 action skbedit queue_mapping 2
priority 13:3306
 filter add dev eth1 protocol ip prio 5 parent 10:0 u32 ht 2:d: match
ip src 87.244.1.13 classid 13:3306 action skbedit queue_mapping 2
priority 13:3306
 filter add dev eth0 protocol ip prio 5 parent 10:0 u32 ht 2:e: match
ip dst 87.244.1.14 classid 13:3306 action skbedit queue_mapping 2
priority 13:3306
...skip...


--
Anton.


-- 
Anton.

^ permalink raw reply

* Re: [PATCH net-next v2 0/10] bonding: rebuild the lock use for bond monitor
From: Nikolay Aleksandrov @ 2013-11-08 16:32 UTC (permalink / raw)
  To: Ding Tianhong
  Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller, Veaceslav Falico,
	Netdev
In-Reply-To: <527C4768.3010909@huawei.com>

On 11/08/2013 03:07 AM, Ding Tianhong wrote:
> Now the bond slave list is not protected by bond lock, only by RTNL,
> but the monitor still use the bond lock to protect the slave list,
> it is useless, according to the Veaceslav's opinion, there were
> three way to fix the protect problem:
> 
> 1. add bond_master_upper_dev_link() and bond_upper_dev_unlink()
>    in bond->lock, but it is unsafe to call call_netdevice_notifiers()
>    in write lock.
> 2. remove unused bond->lock for monitor function, only use the exist
>    rtnl lock(), it will take performance loss in fast path.
> 3. use RCU to protect the slave list, of course, performance is better,
>    but in slow path, it is ignored.
> 
> obviously the solution 1 is not fit here, I will consider the 2 and 3
> solution. My principle is simple, if in fast path, RCU is better,
> otherwise in slow path, both is well, but according to the Jay Vosburgh's
> opinion, the monitor will loss performace if use RTNL to protect the all
> slave list, so remove the bond lock and replace with RCU.
> 
> The second problem is the curr_slave_lock for bond, it is too old and
> unwanted in many place, because the curr_active_slave would only be
> changed in 3 place:
> 
> 1. enslave slave.
> 2. release slave.
> 3. change active slave.
> 
> all above were already holding bond lock, RTNL and curr_slave_lock
> together, it is tedious and no need to add so mach lock, when change
> the curr_active_slave, you have to hold the RTNL and curr_slave_lock
> together, and when you read the curr_active_slave, RTNL or curr_slave_lock,
> any one of them is no problem.
> 
> for the stability, I did not change the logic for the monitor,
> all change is clear and simple, I have test the patch set for lockdep,
> it work well and stability.
> 
> v2. accept the Jay Vosburgh's opinion, remove the RTNL and replace with RCU,
>     also add some rcu function for bond use, so the patch set reach 10.
> 
> Best Regards
> Ding Tianhong
> 

Hi,
I've left my comments from a quick overview of the patches, my opinion on the
patchset is that it wasn't tested thoroughly enough (or at all). There're
multiple places that use a weaker compiler barrier instead of directly using
rcu_dereference() or rcu_access_pointer(), also there're multiple places which
can directly use macros already present in the RCU API.

Cheers,
 Nik

^ permalink raw reply

* Re: [PATCH] usb: xhci: Link TRB must not occur with a USB payload burst.
From: Alan Stern @ 2013-11-08 16:45 UTC (permalink / raw)
  To: Sarah Sharp
  Cc: David Laight, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20131108001838.GB11529@xanatos>

On Thu, 7 Nov 2013, Sarah Sharp wrote:

> On Thu, Nov 07, 2013 at 05:20:49PM -0000, David Laight wrote:
> > 
> > Section 4.11.7.1 of rev 1.0 of the xhci specification states that a link TRB
> > can only occur at a boundary between underlying USB frames (512 bytes for 480M).
> 
> Which version of the spec are you looking at?  I'm looking at the
> updated version from 08/2012 and I don't see any such requirement.
> 
> I do see that section says "A TD Fragment shall not span Transfer Ring
> Segments" where a TD fragment is defined as exact multiples of Max Burst
> Size * Max Packet Size bytes for the endpoint.  Is that what you mean
> about USB frames?

...

> The driver would also have to make sure that TD fragments didn't have
> link TRBs in them.  That's an issue, since the spec decidedly unclear
> about what exactly comprises a TD fragment.  Is the xHC host greedy, and
> will lump all multiples into one TD fragment?  Or will it assume the TD
> fragment has ended once it consumes one multiple of Max Burst Size * Max
> Packet Size bytes?
> 
> This ambiguity means it's basically impossible to figure out whether a
> TD with a link TRB in the middle is constructed properly.  The xHCI spec
> architect didn't have a good solution to this problem, so I punted and
> never implemented TD fragments.  If this is really an issue, it's going
> to be pretty complex to solve.

This is something I wanted to ask you about also.

The whole idea of TD fragments is exceedingly cloudy.  The definition
doesn't make sense, and the spec doesn't say what the actual hardware
restrictions are, i.e., what is the underlying reality that the TD
fragment concept wants to express.

Even if you do your best to ignore the whole idea, there still appear
to be certain restrictions you need to obey.  In addition to the
question of where Link TRBs are allowed, you also have to worry about
TDs whose size isn't a multiple of the Max Burst Payload (MBP) size =
MaxBurstSize * MaxPacketSize.

According to my version of the spec (Rev 1.0, dated 5/21/2010), if a TD
is larger than the MBP and its length isn't a multiple of the MBP, then
the last MBP boundary in the TD must also be a TRB boundary.  This 
follows from two statements in section 4.11.7.1:

	If the TD Transfer Size is an even multiple of the MBP then all 
	TD Fragments shall define exact multiples of MBP data bytes.  
	If not, then only the last TD Fragment shall define less than 
	MBP data (or the Residue) bytes.

So if a TD is longer than MBP then it must contain at least two TD
fragments, and the last fragment must consist of the last Residue
bytes (i.e., the bytes beyond the last MBP boundary).

	Each TD Fragment is comprised of one or more TRBs.

Hence the last MBP boundary in the TD, which marks the beginning of the 
last TD fragment, must also be a TRB boundary.

I have no idea whether violating this restriction will cause trouble
for real hardware.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [ethtool] ethtool: ixgbe DCB registers dump for 82599 and x540
From: Ben Hutchings @ 2013-11-08 16:46 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Leonardo Potenza, netdev, gospo, sassmann, Maryam Tahhan
In-Reply-To: <1383912090.2365.27.camel@jtkirshe-mobl>

On Fri, 2013-11-08 at 04:01 -0800, Jeff Kirsher wrote:
> On Thu, 2013-10-03 at 01:11 -0700, Jeff Kirsher wrote:
> > From: Leonardo Potenza <leonardo.potenza@intel.com>
> > 
> > Added support for DCB registers dump using ethtool -d option both for
> > 82599 and x540 ethernet controllers
> > 
> > Signed-off-by: Leonardo Potenza <leonardo.potenza@intel.com>
> > Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
> > Acked-by: John Fastabend <john.r.fastabend@intel.com>
> > Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
> > Tested-by: Jack Morgan <jack.morgan@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > ---
> >  ixgbe.c | 154
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++------------
> >  1 file changed, 125 insertions(+), 29 deletions(-)
> 
> Ben-
> I see you released 3.12 and I do not see this patch in your tree.  I
> sent it originally on October 3rd, do need me to resend it?

Sorry, I overlooked that and will reply in a moment.

Ben.

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

^ permalink raw reply

* Re: [PATCH ethtool] Fix iteration count in sff8472_calibration()
From: Ben Hutchings @ 2013-11-08 16:54 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, Aurelien Guillaume
In-Reply-To: <1379813802.21174.36.camel@deadeye.wl.decadent.org.uk>

On Sun, 2013-09-22 at 02:36 +0100, Ben Hutchings wrote:
> We want to iterate over all elements of the various arrays of readings
> (which all have the same dimensions - and maybe ought to be a single
> array).  Unfortunately the iteration count is sizeof(sd->bias_cur) and
> bias_cur has 2-byte elements, so we iterate over twice as many
> elements as are really there.
> 
> Compiler-detected, and compile-tested only.
> 
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---

Applied.  Thanks, me.

Ben.

>  sfpdiag.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sfpdiag.c b/sfpdiag.c
> index f67e491..04fd880 100644
> --- a/sfpdiag.c
> +++ b/sfpdiag.c
> @@ -224,7 +224,7 @@ static void sff8472_calibration(const __u8 *id, struct sff8472_diags *sd)
>  	__u16 rx_reading;
>  
>  	/* Calibration should occur for all values (threshold and current) */
> -	for (i = 0; i < sizeof(sd->bias_cur); ++i) {
> +	for (i = 0; i < ARRAY_SIZE(sd->bias_cur); ++i) {
>  		/*
>  		 * Apply calibration formula 1 (Temp., Voltage, Bias, Tx Power)
>  		 */
> 

-- 
Ben Hutchings, Staff 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: [ethtool] ethtool: ixgbe DCB registers dump for 82599 and x540
From: Ben Hutchings @ 2013-11-08 16:55 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Leonardo Potenza, netdev, gospo, sassmann, Maryam Tahhan
In-Reply-To: <1380787887-6878-1-git-send-email-jeffrey.t.kirsher@intel.com>

On Thu, 2013-10-03 at 01:11 -0700, Jeff Kirsher wrote:
> From: Leonardo Potenza <leonardo.potenza@intel.com>
> 
> Added support for DCB registers dump using ethtool -d option both for
> 82599 and x540 ethernet controllers
> 
> Signed-off-by: Leonardo Potenza <leonardo.potenza@intel.com>
> Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
> Acked-by: John Fastabend <john.r.fastabend@intel.com>
> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
> Tested-by: Jack Morgan <jack.morgan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
[...]

Applied, thanks.

Ben.

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

^ permalink raw reply

* Re: [PATCH net-next v2 9/10] bonding: remvoe unwanted lock for bond enslave and release
From: Nikolay Aleksandrov @ 2013-11-08 17:15 UTC (permalink / raw)
  To: Ding Tianhong
  Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller, Veaceslav Falico,
	Netdev
In-Reply-To: <527C4793.5060306@huawei.com>

On 11/08/2013 03:08 AM, Ding Tianhong wrote:
> The bond_change_active_slave() and bond_select_active_slave()
> do't need bond lock anymore, so remove the unwanted bond lock
> for these two functions.
> 
> The bond_select_active_slave() will release and acquire
> curr_slave_lock, so the curr_slave_lock need to protect
> the function.
> 
> In bond enslave and bond release, the bond slave list is also
> protected by RTNL, so bond lock is no need to exist, remove
> the lock and clean the functions.
> 
> Suggested-by: Jay Vosburgh <fubar@us.ibm.com>
> Suggested-by: Veaceslav Falico <vfalico@redhat.com>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> ---
Small nitpick about the subject:
"remvoe" -> "remove"

^ permalink raw reply

* ethtool 3.12 released
From: Ben Hutchings @ 2013-11-08 17:21 UTC (permalink / raw)
  To: netdev; +Cc: Jeff Kirsher, Leonardo Potenza

ethtool version 3.12.1 has been released.

This includes a couple of changes that should have gone into 3.12.

Home page: https://ftp.kernel.org/pub/software/network/ethtool/
Download link:
https://ftp.kernel.org/pub/software/network/ethtool/ethtool-3.12.1.tar.xz

Release notes:

	* Fix: Memory corruption when applying external calibration to
	  SFF-8472 module diagnostics (-m option)
	* Feature: Add Intel 82599 and x540 DCB registers to dump
	  (-d option)

Ben.

-- 
Ben Hutchings, Staff 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


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