* Re: [PATCH v4 4/9] net: openvswitch: use this_cpu_ptr per-cpu helper
From: Jesse Gross @ 2012-11-16 21:53 UTC (permalink / raw)
To: Shan Wei
Cc: dev-yBygre7rU0TnMu66kgdUjQ, Tejun Heo,
cl-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, NetDev, Kernel-Maillist,
David Miller
In-Reply-To: <50A5FAEB.7090202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Fri, Nov 16, 2012 at 12:35 AM, Shan Wei <shanwei88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Shan Wei said, at 2012/11/13 9:52:
>> From: Shan Wei <davidshan-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
>>
>> just use more faster this_cpu_ptr instead of per_cpu_ptr(p, smp_processor_id());
>>
>>
>> Signed-off-by: Shan Wei <davidshan-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
>> Reviewed-by: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
>
> Jesse Gross, would you like to pick it up to your tree?
Applied, thanks.
^ permalink raw reply
* Re: linux-next: Tree for Nov 15 (pch_gbe)
From: Randy Dunlap @ 2012-11-16 21:48 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linux-next, linux-kernel, netdev@vger.kernel.org, Andrew Morton,
LAPIS SEMICONDUCTOR
In-Reply-To: <20121115181740.4fb08780f0b92149a5ed2ca4@canb.auug.org.au>
On 11/14/2012 11:17 PM, Stephen Rothwell wrote:
> Hi all,
>
> News: this one will be the last release until next-20121126 (which should
> be just be after -rc7, I guess - assuming that Linus does not release
> v3.7 before then).
>
> Changes since 20121114:
>
on x86_64:
drivers/built-in.o: In function `pch_tx_timestamp':
pch_gbe_main.c:(.text+0x5b9b08): undefined reference to `pch_ch_event_read'
pch_gbe_main.c:(.text+0x5b9b39): undefined reference to `pch_tx_snap_read'
pch_gbe_main.c:(.text+0x5b9b6c): undefined reference to `pch_ch_event_write'
drivers/built-in.o: In function `pch_rx_timestamp':
pch_gbe_main.c:(.text+0x5ba648): undefined reference to `pch_ch_event_read'
pch_gbe_main.c:(.text+0x5ba658): undefined reference to `pch_src_uuid_lo_read'
pch_gbe_main.c:(.text+0x5ba663): undefined reference to `pch_src_uuid_hi_read'
pch_gbe_main.c:(.text+0x5ba709): undefined reference to `pch_ch_event_write'
pch_gbe_main.c:(.text+0x5ba717): undefined reference to `pch_rx_snap_read'
drivers/built-in.o: In function `hwtstamp_ioctl.clone.13':
pch_gbe_main.c:(.text+0x5bb3b0): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5bb3c9): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5bb3e2): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5bb406): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5bb426): undefined reference to `pch_set_station_address'
pch_gbe_main.c:(.text+0x5bb433): undefined reference to `pch_ch_event_write'
when PTP_1588_CLOCK_PCH is not enabled.
Want to select PTP_1588_CLOCK_PCH for PCH_GBE?
--
~Randy
^ permalink raw reply
* Re: [PATCH v2 net-next] sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
From: Thomas Graf @ 2012-11-16 21:47 UTC (permalink / raw)
To: Neil Horman
Cc: Michele Baldessari, linux-sctp, Vlad Yasevich, netdev,
David S. Miller
In-Reply-To: <20121116163922.GA9722@hmsreliant.think-freely.org>
On 11/16/12 at 11:39am, Neil Horman wrote:
> Yes, I think this is good, I still don't like the idea of having to do these via
> an ioctl, but I suppose it fits well enough.
I'm with you on this. I have started scribbling notes on paper for
a netlink based stats retriever. We should discuss this at some
point making sure we get everyone on board with interests in this
and solve this nice and clean for everyone to enjoy.
I guess the ioctl is the best we can do as long as we don't have
the above.
^ permalink raw reply
* Re: Linux kernel handling of IPv6 temporary addresses
From: Ben Hutchings @ 2012-11-16 21:27 UTC (permalink / raw)
To: David Miller; +Cc: kargig, netdev
In-Reply-To: <20121114.180824.1930899985436392426.davem@davemloft.net>
On Wed, 2012-11-14 at 18:08 -0500, David Miller wrote:
> From: George Kargiotakis <kargig@void.gr>
> Date: Thu, 15 Nov 2012 01:03:24 +0200
>
> > I think it's an issue that a LAN root user can disable a
> > locally enabled kernel "feature" for good. The kernel could provide a
> > somewhat more informative message on such an occasion taking place,
> > since it knows that max_addresses limit has been reached and it's not a
> > DAD failure.
> >
> > My point is that I'd like the kernel to handle this situation a bit
> > differently than it currently does.
>
> Read my example again, it's the same thing for ipv4.
>
> The root LAN user can disable all IPV4 communications to arbitrary IP
> addresses on the local LAN by emitting bogus ARP requests and
> poisoning everyone's caches. What's the difference between that
> and this arbitrary ipv6 issue?
>
> There is none at all.
>
> If you have a root person on your local LAN you're subject to injection
> of bogus addressing and routing information. This issue is not specific
> to ipv4 or ipv6 and is fundamental in nature.
>
> So it is misleading to bring this up as an ipv6 specific problem, it's
> not.
You're quite right about this, but I think George's point may be that
it's harder to recover if and when the malicious traffic is stopped.
Poisoned ARP table entries will expire fairly quickly.
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
* [PATCH v2 net-next] sockopt: Change getsockopt() of SO_BINDTODEVICE to return an interface name
From: Brian Haley @ 2012-11-16 20:58 UTC (permalink / raw)
To: David Miller; +Cc: Pavel Emelyanov, Eric Dumazet, netdev@vger.kernel.org
Instead of having the getsockopt() of SO_BINDTODEVICE return an index, which
will then require another call like if_indextoname() to get the actual interface
name, have it return the name directly.
This also matches the existing man page description on socket(7) which mentions
the argument being an interface name.
If the value has not been set, zero is returned and optlen will be set to zero
to indicate there is no interface name present.
Added a seqlock to protect this code path, and dev_ifname(), from someone
changing the device name via dev_change_name().
v2: Added seqlock protection while copying device name.
Signed-off-by: Brian Haley <brian.haley@hp.com>
--
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index e46c830..e9929ab 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1567,6 +1567,8 @@ extern int call_netdevice_notifiers(unsigned long val,
struct net_device *dev);
extern rwlock_t dev_base_lock; /* Device list lock */
+extern seqlock_t devnet_rename_seq; /* Device rename lock */
+
#define for_each_netdev(net, d) \
list_for_each_entry(d, &(net)->dev_base_head, dev_list)
diff --git a/net/core/dev.c b/net/core/dev.c
index 2705a2a..3a576ed 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -203,6 +203,8 @@ static struct list_head offload_base __read_mostly;
DEFINE_RWLOCK(dev_base_lock);
EXPORT_SYMBOL(dev_base_lock);
+DEFINE_SEQLOCK(devnet_rename_seq);
+
static inline void dev_base_seq_inc(struct net *net)
{
while (++net->dev_base_seq == 0);
@@ -1091,22 +1093,31 @@ int dev_change_name(struct net_device *dev, const char
*newname)
if (dev->flags & IFF_UP)
return -EBUSY;
- if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
+ write_seqlock(&devnet_rename_seq);
+
+ if (strncmp(newname, dev->name, IFNAMSIZ) == 0) {
+ write_sequnlock(&devnet_rename_seq);
return 0;
+ }
memcpy(oldname, dev->name, IFNAMSIZ);
err = dev_get_valid_name(net, dev, newname);
- if (err < 0)
+ if (err < 0) {
+ write_sequnlock(&devnet_rename_seq);
return err;
+ }
rollback:
ret = device_rename(&dev->dev, dev->name);
if (ret) {
memcpy(dev->name, oldname, IFNAMSIZ);
+ write_sequnlock(&devnet_rename_seq);
return ret;
}
+ write_sequnlock(&devnet_rename_seq);
+
write_lock_bh(&dev_base_lock);
hlist_del_rcu(&dev->name_hlist);
write_unlock_bh(&dev_base_lock);
@@ -1124,6 +1135,7 @@ rollback:
/* err >= 0 after dev_alloc_name() or stores the first errno */
if (err >= 0) {
err = ret;
+ write_seqlock(&devnet_rename_seq);
memcpy(dev->name, oldname, IFNAMSIZ);
goto rollback;
} else {
@@ -4148,6 +4160,7 @@ static int dev_ifname(struct net *net, struct ifreq __user
*arg)
{
struct net_device *dev;
struct ifreq ifr;
+ unsigned seq;
/*
* Fetch the caller's info block.
@@ -4156,6 +4169,8 @@ static int dev_ifname(struct net *net, struct ifreq __user
*arg)
if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
return -EFAULT;
+retry:
+ seq = read_seqbegin(&devnet_rename_seq);
rcu_read_lock();
dev = dev_get_by_index_rcu(net, ifr.ifr_ifindex);
if (!dev) {
@@ -4165,6 +4180,8 @@ static int dev_ifname(struct net *net, struct ifreq __user
*arg)
strcpy(ifr.ifr_name, dev->name);
rcu_read_unlock();
+ if (read_seqretry(&devnet_rename_seq, seq))
+ goto retry;
if (copy_to_user(arg, &ifr, sizeof(struct ifreq)))
return -EFAULT;
diff --git a/net/core/sock.c b/net/core/sock.c
index 0628600..f2a42e3 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -505,7 +505,8 @@ struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie)
}
EXPORT_SYMBOL(sk_dst_check);
-static int sock_bindtodevice(struct sock *sk, char __user *optval, int optlen)
+static int sock_setbindtodevice(struct sock *sk, char __user *optval,
+ int optlen)
{
int ret = -ENOPROTOOPT;
#ifdef CONFIG_NETDEVICES
@@ -562,6 +563,59 @@ out:
return ret;
}
+static int sock_getbindtodevice(struct sock *sk, char __user *optval,
+ int __user *optlen, int len)
+{
+ int ret = -ENOPROTOOPT;
+#ifdef CONFIG_NETDEVICES
+ struct net *net = sock_net(sk);
+ struct net_device *dev;
+ char devname[IFNAMSIZ];
+ unsigned seq;
+
+ if (sk->sk_bound_dev_if == 0) {
+ len = 0;
+ goto zero;
+ }
+
+ ret = -EINVAL;
+ if (len < IFNAMSIZ)
+ goto out;
+
+retry:
+ seq = read_seqbegin(&devnet_rename_seq);
+ rcu_read_lock();
+ dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if);
+ ret = -ENODEV;
+ if (!dev) {
+ rcu_read_unlock();
+ goto out;
+ }
+
+ strcpy(devname, dev->name);
+ rcu_read_unlock();
+ if (read_seqretry(&devnet_rename_seq, seq))
+ goto retry;
+
+ len = strlen(devname) + 1;
+
+ ret = -EFAULT;
+ if (copy_to_user(optval, devname, len))
+ goto out;
+
+zero:
+ ret = -EFAULT;
+ if (put_user(len, optlen))
+ goto out;
+
+ ret = 0;
+
+out:
+#endif
+
+ return ret;
+}
+
static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool)
{
if (valbool)
@@ -589,7 +643,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
*/
if (optname == SO_BINDTODEVICE)
- return sock_bindtodevice(sk, optval, optlen);
+ return sock_setbindtodevice(sk, optval, optlen);
if (optlen < sizeof(int))
return -EINVAL;
@@ -1074,15 +1128,17 @@ int sock_getsockopt(struct socket *sock, int level, int
optname,
case SO_NOFCS:
v.val = sock_flag(sk, SOCK_NOFCS);
break;
+
case SO_BINDTODEVICE:
- v.val = sk->sk_bound_dev_if;
- break;
+ return sock_getbindtodevice(sk, optval, optlen, len);
+
case SO_GET_FILTER:
len = sk_get_filter(sk, (struct sock_filter __user *)optval, len);
if (len < 0)
return len;
goto lenout;
+
default:
return -ENOPROTOOPT;
}
^ permalink raw reply related
* [PATCH] net: remove unnecessary wireless includes
From: Johannes Berg @ 2012-11-16 20:59 UTC (permalink / raw)
To: linux-wireless; +Cc: netdev, Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
The wireless and wext includes in net-sysfs.c aren't
needed, so remove them.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/core/net-sysfs.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index bcf02f6..b407879 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -18,11 +18,9 @@
#include <net/sock.h>
#include <net/net_namespace.h>
#include <linux/rtnetlink.h>
-#include <linux/wireless.h>
#include <linux/vmalloc.h>
#include <linux/export.h>
#include <linux/jiffies.h>
-#include <net/wext.h>
#include "net-sysfs.h"
--
1.8.0
^ permalink raw reply related
* [PATCH net-next] gro: Handle inline VLAN tags
From: Ben Hutchings @ 2012-11-16 20:17 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-net-drivers, Eric Dumazet, Andrew Gallatin,
Herbert Xu
The receive paths for skbs with inline and out-of-line VLAN tags (VLAN
RX accleration) were made largely consistent in 2.6.37, with tags
pulled out by software as necessary. However GRO doesn't do this, so
it is not effective for VLAN-tagged packets received on devices
without VLAN RX acceleration.
napi_gro_frags() must not free the skb and does not advance the
skb->data pointer, so cannot use vlan_untag(). Extract the core of
vlan_untag() into a new function __vlan_untag() that allows the offset
to the VLAN tag to be specified and returns an error code. Add
kernel-doc comments for both those functions.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
Tested with sfc using both napi_gro_receive() and napi_gro_frags(). On
a Core i7 920 (Nehalem) system it increased TCP/IPv4 receive throughput
over a VLAN from ~8.0 to ~9.3 Gbit/s.
Ben.
include/linux/if_vlan.h | 6 ++++
net/8021q/vlan_core.c | 60 ++++++++++++++++++++++++++++++++---------------
net/core/dev.c | 27 ++++++++++++++++----
3 files changed, 68 insertions(+), 25 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index d06cc5c..a2167c3 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -91,6 +91,7 @@ extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
extern u16 vlan_dev_vlan_id(const struct net_device *dev);
extern bool vlan_do_receive(struct sk_buff **skb);
+extern int __vlan_untag(struct sk_buff *skb, int offset);
extern struct sk_buff *vlan_untag(struct sk_buff *skb);
extern int vlan_vid_add(struct net_device *dev, unsigned short vid);
@@ -126,6 +127,11 @@ static inline bool vlan_do_receive(struct sk_buff **skb)
return false;
}
+static inline int __vlan_untag(struct sk_buff *skb, int offset)
+{
+ return 0;
+}
+
static inline struct sk_buff *vlan_untag(struct sk_buff *skb)
{
return skb;
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 65e06ab..8486430 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -93,20 +93,53 @@ u16 vlan_dev_vlan_id(const struct net_device *dev)
}
EXPORT_SYMBOL(vlan_dev_vlan_id);
-static struct sk_buff *vlan_reorder_header(struct sk_buff *skb)
+/**
+ * __vlan_untag - pull VLAN tag out of 802.1q packet header
+ * @skb: sk_buff to edit; may be cloned but not shared.
+ * @offset: Offset from @skb->data to VLAN tag. Must be either
+ * 0 or %ETH_HLEN.
+ *
+ * This updates the @mac_header but no other header offset. The
+ * caller is expected to check the @protocol and that there is no
+ * out-of-line tag before calling this.
+ */
+int __vlan_untag(struct sk_buff *skb, int offset)
{
+ struct vlan_hdr *vhdr;
+ u16 vlan_tci;
+
+ if (unlikely(!pskb_may_pull(skb, offset + VLAN_HLEN)))
+ return -EINVAL;
+
+ vhdr = (struct vlan_hdr *) (skb->data + offset);
+ vlan_tci = ntohs(vhdr->h_vlan_TCI);
+ __vlan_hwaccel_put_tag(skb, vlan_tci);
+
+ skb->len -= VLAN_HLEN;
+ skb_postpull_rcsum(skb, skb->data + offset, VLAN_HLEN);
+ skb->data += VLAN_HLEN;
+ vlan_set_encap_proto(skb, vhdr);
+
if (skb_cow(skb, skb_headroom(skb)) < 0)
- return NULL;
- memmove(skb->data - ETH_HLEN, skb->data - VLAN_ETH_HLEN, 2 * ETH_ALEN);
+ return -ENOMEM;
+
+ memmove(skb->data + offset - ETH_HLEN,
+ skb->data + offset - VLAN_ETH_HLEN, 2 * ETH_ALEN);
skb->mac_header += VLAN_HLEN;
- return skb;
+ return 0;
}
+/**
+ * vlan_untag - pull VLAN tag out of packet header, if appropriate
+ * @skb: sk_buff to edit; may be cloned or shared.
+ *
+ * If @skb has an inline VLAN tag and no out-of-line VLAN tag,
+ * pull the tag out-of-line and reset all header offsets. Return
+ * the edited sk_buff. If allocation fails or the VLAN tag is
+ * invalid, free @skb and return NULL.
+ */
struct sk_buff *vlan_untag(struct sk_buff *skb)
{
- struct vlan_hdr *vhdr;
- u16 vlan_tci;
-
if (unlikely(vlan_tx_tag_present(skb))) {
/* vlan_tci is already set-up so leave this for another time */
return skb;
@@ -116,18 +149,7 @@ struct sk_buff *vlan_untag(struct sk_buff *skb)
if (unlikely(!skb))
goto err_free;
- if (unlikely(!pskb_may_pull(skb, VLAN_HLEN)))
- goto err_free;
-
- vhdr = (struct vlan_hdr *) skb->data;
- vlan_tci = ntohs(vhdr->h_vlan_TCI);
- __vlan_hwaccel_put_tag(skb, vlan_tci);
-
- skb_pull_rcsum(skb, VLAN_HLEN);
- vlan_set_encap_proto(skb, vhdr);
-
- skb = vlan_reorder_header(skb);
- if (unlikely(!skb))
+ if (unlikely(__vlan_untag(skb, 0)))
goto err_free;
skb_reset_network_header(skb);
diff --git a/net/core/dev.c b/net/core/dev.c
index b4978e2..9d658eb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3668,6 +3668,13 @@ static void skb_gro_reset_offset(struct sk_buff *skb)
gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
{
+ if (unlikely(skb->protocol == htons(ETH_P_8021Q)) &&
+ !vlan_tx_tag_present(skb)) {
+ skb = vlan_untag(skb);
+ if (unlikely(!skb))
+ return GRO_DROP;
+ }
+
skb_gro_reset_offset(skb);
return napi_skb_finish(__napi_gro_receive(napi, skb), skb);
@@ -3743,11 +3750,8 @@ static struct sk_buff *napi_frags_skb(struct napi_struct *napi)
eth = skb_gro_header_fast(skb, off);
if (skb_gro_header_hard(skb, hlen)) {
eth = skb_gro_header_slow(skb, hlen, off);
- if (unlikely(!eth)) {
- napi_reuse_skb(napi, skb);
- skb = NULL;
- goto out;
- }
+ if (unlikely(!eth))
+ goto fail;
}
skb_gro_pull(skb, sizeof(*eth));
@@ -3758,8 +3762,19 @@ static struct sk_buff *napi_frags_skb(struct napi_struct *napi)
*/
skb->protocol = eth->h_proto;
-out:
+ if (unlikely(skb->protocol == htons(ETH_P_8021Q)) &&
+ !vlan_tx_tag_present(skb)) {
+ if (unlikely(__vlan_untag(skb, sizeof(*eth))))
+ goto fail;
+ skb_gro_reset_offset(skb);
+ skb_gro_pull(skb, sizeof(*eth));
+ }
+
return skb;
+
+fail:
+ napi_reuse_skb(napi, skb);
+ return NULL;
}
gro_result_t napi_gro_frags(struct napi_struct *napi)
--
1.7.7.6
--
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 related
* Re: [PATCH] checkpatch: add double empty line check
From: Eilon Greenstein @ 2012-11-16 20:04 UTC (permalink / raw)
To: David Rientjes, Joe Perches; +Cc: Andy Whitcroft, linux-kernel, netdev
In-Reply-To: <alpine.DEB.2.00.1211161154280.2788@chino.kir.corp.google.com>
On Fri, 2012-11-16 at 11:55 -0800, David Rientjes wrote:
> On Fri, 16 Nov 2012, Eilon Greenstein wrote:
>
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 21a9f5d..7a9c153 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -3579,6 +3579,13 @@ sub process {
> > WARN("EXPORTED_WORLD_WRITABLE",
> > "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
> > }
> > +
> > +# check for double empty lines
> > + if ($line =~ /^\+\s*$/ &&
> > + ($prevline =~ /^\+?\s*$/ || $rawlines[$linenr] =~ /^\s*$/)) {
> > + WARN("DOUBLE_EMPTY_LINE",
> > + "One empty line should be sufficient. Consider removing this one.\n" . $herecurr);
> > + }
> > }
> >
> > # If we have no input at all, then there is nothing to report on
>
> This is fairly common in all the acpi code where variables declared in a
> function are separated from the code in a function.
>
Indeed, I see that you do use it in some functions.
Maybe we can limit it only to the networking tree (similar to the
networking comments style) or if the ACPI is the exception, we can apply
to all but ACPI.
^ permalink raw reply
* Re: [PATCH] checkpatch: add double empty line check
From: David Rientjes @ 2012-11-16 19:55 UTC (permalink / raw)
To: Eilon Greenstein; +Cc: Andy Whitcroft, linux-kernel, Joe Perches, netdev
In-Reply-To: <1353094919.14327.4.camel@lb-tlvb-eilong.il.broadcom.com>
On Fri, 16 Nov 2012, Eilon Greenstein wrote:
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 21a9f5d..7a9c153 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3579,6 +3579,13 @@ sub process {
> WARN("EXPORTED_WORLD_WRITABLE",
> "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
> }
> +
> +# check for double empty lines
> + if ($line =~ /^\+\s*$/ &&
> + ($prevline =~ /^\+?\s*$/ || $rawlines[$linenr] =~ /^\s*$/)) {
> + WARN("DOUBLE_EMPTY_LINE",
> + "One empty line should be sufficient. Consider removing this one.\n" . $herecurr);
> + }
> }
>
> # If we have no input at all, then there is nothing to report on
This is fairly common in all the acpi code where variables declared in a
function are separated from the code in a function.
^ permalink raw reply
* [PATCH] checkpatch: add double empty line check
From: Eilon Greenstein @ 2012-11-16 19:41 UTC (permalink / raw)
To: Andy Whitcroft, linux-kernel; +Cc: Joe Perches, netdev
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
scripts/checkpatch.pl | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 21a9f5d..7a9c153 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3579,6 +3579,13 @@ sub process {
WARN("EXPORTED_WORLD_WRITABLE",
"Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
}
+
+# check for double empty lines
+ if ($line =~ /^\+\s*$/ &&
+ ($prevline =~ /^\+?\s*$/ || $rawlines[$linenr] =~ /^\s*$/)) {
+ WARN("DOUBLE_EMPTY_LINE",
+ "One empty line should be sufficient. Consider removing this one.\n" . $herecurr);
+ }
}
# If we have no input at all, then there is nothing to report on
--
1.7.9.5
^ permalink raw reply related
* Re: pull request: wireless 2012-11-16
From: David Miller @ 2012-11-16 19:41 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20121116183011.GA29426@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 16 Nov 2012 13:30:11 -0500
> This batch of fixes is intended for the 3.7 stream...
Pulled, thanks John.
^ permalink raw reply
* Re: [PATCH] openvswitch: Make IPv6 packet parsing dependent on IPv6 config
From: Vlad Yasevich @ 2012-11-16 19:41 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
fengguang.wu-ral2JQCrhuEAvxtiuMwx3w
In-Reply-To: <20121116.135341.453792886356015492.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On 11/16/2012 01:53 PM, David Miller wrote:> From: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
> Date: Fri, 16 Nov 2012 10:46:17 -0800
>
>> I guess the simplest thing to do seems to just make Open vSwitch
>> depend on CONFIG_INET seeing as it is practically useless without
>> upper layer protocol support anyways.
>
> The reason we have the ipv6 extension header parsing in a seperate,
> always compiled statically into the kernel, module is exactly for
> situations like this.
>
> We need to think seriously if we want to go down this road of only
> using INET as protection for every module that has some kind of ipv6
> component to it.
Ok. How about this approach instead. This keeps core functions we need
still dependent on CONFIG_NET and makes new GSO stuff depend on CONFIG_INET
since its quite useless without CONFIG_INET anyway...
-vlad
-- >8 --
Subject: [PATCH] ipv6: Preserve ipv6 functionality needed by NET
Some pieces of network use core pieces of IPv6 stack. Keep
them available while letting new GSO offload pieces depend
on CONFIG_INET.
Signed-off-by: Vlad Yasevich <vyasevic-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
net/Makefile | 2 +-
net/ipv6/Makefile | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/Makefile b/net/Makefile
index e050d9d..4f4ee08 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -19,7 +19,7 @@ obj-$(CONFIG_NETFILTER) += netfilter/
obj-$(CONFIG_INET) += ipv4/
obj-$(CONFIG_XFRM) += xfrm/
obj-$(CONFIG_UNIX) += unix/
-obj-$(CONFIG_INET) += ipv6/
+obj-$(CONFIG_NET) += ipv6/
obj-$(CONFIG_PACKET) += packet/
obj-$(CONFIG_NET_KEY) += key/
obj-$(CONFIG_BRIDGE) += bridge/
diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
index 04a475d..2068ac4 100644
--- a/net/ipv6/Makefile
+++ b/net/ipv6/Makefile
@@ -40,7 +40,7 @@ obj-$(CONFIG_IPV6_SIT) += sit.o
obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o
obj-$(CONFIG_IPV6_GRE) += ip6_gre.o
-obj-y += addrconf_core.o exthdrs_core.o output_core.o protocol.o
-obj-y += $(ipv6-offload)
+obj-y += addrconf_core.o exthdrs_core.o
+obj-$(CONFIG_INET) += output_core.o protocol.o $(ipv6_offload)
obj-$(subst m,y,$(CONFIG_IPV6)) += inet6_hashtables.o
--
1.7.7.6
^ permalink raw reply related
* Re: Optics (SFP) monitoring on ixgbe and igbe
From: Ben Hutchings @ 2012-11-16 19:38 UTC (permalink / raw)
To: footplus; +Cc: netdev, jeffrey.t.kirsher
In-Reply-To: <CAPN4dA_ymo-Bx+GM+JLLKGHghq+qBYxR0zO7K6H6Nn0pqZsJRg@mail.gmail.com>
On Fri, 2012-11-16 at 03:23 +0100, Aurélien wrote:
> On Fri, Nov 16, 2012 at 12:30 AM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> >
> > Yes, Jeff's the one you should be talking to about these drivers. I
> > just look after the ethtool utility and API.
> >
>
> Ok, so I will discuss the ixgbe patch with Jeff :)
>
> Ben, on the ethtool side, attached is a patch to enable the following
> option and output; It's still missing externally calibrated optics
> support (my current one is internally calibrated, so that's difficult
> to test anything). What do you think ? Is there any other data that
> could be interesting to show with -O or -m options ?
[...]
> --- a/configure.ac
> +++ b/configure.ac
> @@ -13,9 +13,11 @@ AC_PROG_GCC_TRADITIONAL
> AM_PROG_CC_C_O
>
> dnl Checks for libraries.
> +AC_CHECK_LIB([m], [log10])
>
> dnl Checks for header files.
> AC_CHECK_HEADERS(sys/ioctl.h)
> +AC_CHECK_HEADERS(math.h)
This is silly; log10() and <math.h> are part of standard C and -lm is
standard on Unix. Just use <math.h> and -lm unconditionally.
> dnl Checks for typedefs, structures, and compiler characteristics.
> AC_MSG_CHECKING([whether <linux/types.h> defines big-endian types])
> diff --git a/ethtool.c b/ethtool.c
> index 3db7fec..e18fc85 100644
> --- a/ethtool.c
> +++ b/ethtool.c
> @@ -3549,6 +3549,47 @@ static int do_tsinfo(struct cmd_context *ctx)
> return 0;
> }
>
> +static int do_getmoduleoptics(struct cmd_context *ctx)
> +{
> + struct ethtool_modinfo modinfo;
> + struct ethtool_eeprom *eeprom;
> + int err;
> +
> + modinfo.cmd = ETHTOOL_GMODULEINFO;
> + err = send_ioctl(ctx, &modinfo);
> + if (err < 0) {
> + perror("Cannot get module information");
> + return 1;
> + }
> +
> + if (modinfo.type != ETH_MODULE_SFF_8472)
> + {
> + perror("Module is not SFF-8472 (DOM) compliant");
> + return 1;
> + }
> +
> + eeprom = calloc(1, sizeof(*eeprom) + modinfo.eeprom_len);
> + if (!eeprom) {
> + perror("Cannot allocate memory for module EEPROM data");
> + return 1;
> + }
> +
> + eeprom->cmd = ETHTOOL_GMODULEEEPROM;
> + eeprom->len = modinfo.eeprom_len;
> + eeprom->offset = 0;
> + err = send_ioctl(ctx, eeprom);
> + if (err < 0) {
> + perror("Cannot access module EEPROM");
> + free(eeprom);
> + return 1;
> + }
> +
> + printf("Physical interface: %s\n", ctx->devname);
> + sff8472_show_all(eeprom->data);
> + free(eeprom);
> + return 0;
> +}
Please merge this with the existing -m option and update the
documentation to say that this covers diagnostics where available. You
could add a long option alias like --dump-module or --module-info that
covers the two types of information.
> static int do_getmodule(struct cmd_context *ctx)
> {
> struct ethtool_modinfo modinfo;
> @@ -3832,11 +3873,13 @@ static const struct option {
> { "--set-priv-flags", 1, do_sprivflags, "Set private flags",
> " FLAG on|off ...\n" },
> { "-m|--dump-module-eeprom", 1, do_getmodule,
> - "Qeuery/Decode Module EEPROM information",
> + "Query/Decode Module EEPROM information",
> " [ raw on|off ]\n"
> " [ hex on|off ]\n"
> " [ offset N ]\n"
> " [ length N ]\n" },
> + { "-O|--module-optics", 1, do_getmoduleoptics,
> + "Show module optical diagnostics" },
> { "--show-eee", 1, do_geee, "Show EEE settings"},
> { "--set-eee", 1, do_seee, "Set EEE settings",
> " [ eee on|off ]\n"
> diff --git a/internal.h b/internal.h
> index 4f96fd5..e977a81 100644
> --- a/internal.h
> +++ b/internal.h
> @@ -253,4 +253,7 @@ int rxclass_rule_del(struct cmd_context *ctx, __u32 loc);
> /* Module EEPROM parsing code */
> void sff8079_show_all(const __u8 *id);
>
> +/* Optics diagnostics */
> +void sff8472_show_all(const __u8 *id);
> +
> #endif /* ETHTOOL_INTERNAL_H__ */
> diff --git a/sfpdiag.c b/sfpdiag.c
> new file mode 100644
> index 0000000..aa7c14c
> --- /dev/null
> +++ b/sfpdiag.c
[...]
> +#define SFF_A2_TEMP 0x100 + 96
> +#define SFF_A2_TEMP_HALRM 0x100 + 0
[...]
> +#define SFF_A2_ALRM_FLG 0x100 + 112
> +#define SFF_A2_WARN_FLG 0x100 + 116
All the above offsets need parentheses around their definitions.
> +struct sff8472_diags {
> +
> +#define MCURR 0
> +#define LWARN 1
> +#define HWARN 2
> +#define LALRM 3
> +#define HALRM 4
> +
> + /* [5] tables are current, low/high warn, low/high alarm */
> + __u8 supports_dom; /* Supports DOM */
> + __u8 supports_alarms; /* Supports alarm/warning thold */
> + __u8 calibrated_int; /* Is internally calibrated */
> + __u16 bias_cur[5]; /* Measured bias current in 2uA units (cur, l/h warn, l/h alarm) */
> + __u16 tx_power[5]; /* Measured TX Power in 0.1uW units (cur, warn, alarm) */
> + __u16 rx_power[5]; /* Measured RX Power (cur, warn, alarm) */
> + __u8 rx_power_type; /* 0 = OMA, 1 = Average power */
> + __s16 sfp_temp[5]; /* SFP Temp in 0.1 Celcius (cur, warn, alarm) */
> + __u16 sfp_voltage[5]; /* SFP voltage in 0.1mV units (cur, warn, alarm) */
> +
> +};
> +
> +static struct sff8472_aw_flags {
> + const char *str; /* Human-readable string, null at the end */
> + int offset; /* A2-relative adress offset */
This is commented as an offset in the A2 'EEPROM' but the offsets
actually used include the 0x100 offset from the start of the
concatenated 'EEPROM'.
> + __u8 value; /* 1-bit mask, alarm is on if offset & value != 0. */
> +} sff8472_aw_flags[] =
> +{
> + { "Laser bias current high alarm", SFF_A2_ALRM_FLG, (1 << 3) },
> + { "Laser bias current low alarm", SFF_A2_ALRM_FLG, (1 << 2) },
> + { "Laser bias current high warning", SFF_A2_WARN_FLG, (1 << 3) },
> + { "Laser bias current low warning", SFF_A2_WARN_FLG, (1 << 2) },
> +
> + { "Laser output power high alarm", SFF_A2_ALRM_FLG, (1 << 1) },
> + { "Laser output power low alarm", SFF_A2_ALRM_FLG, (1 << 0) },
> + { "Laser output power high warning", SFF_A2_WARN_FLG, (1 << 1) },
> + { "Laser output power low warning", SFF_A2_WARN_FLG, (1 << 0) },
> +
> + { "Module temperature high alarm", SFF_A2_ALRM_FLG, (1 << 7) },
> + { "Module temperature low alarm", SFF_A2_ALRM_FLG, (1 << 6) },
> + { "Module temperature high warning", SFF_A2_WARN_FLG, (1 << 7) },
> + { "Module temperature low warning", SFF_A2_WARN_FLG, (1 << 6) },
> +
> + { "Module voltage high alarm", SFF_A2_ALRM_FLG, (1 << 5) },
> + { "Module voltage low alarm", SFF_A2_ALRM_FLG, (1 << 4) },
> + { "Module voltage high warning", SFF_A2_WARN_FLG, (1 << 5) },
> + { "Module voltage low warning", SFF_A2_WARN_FLG, (1 << 4) },
> +
> + { "Laser rx power high alarm", SFF_A2_ALRM_FLG + 1, (1 << 7) },
> + { "Laser rx power low alarm", SFF_A2_ALRM_FLG + 1, (1 << 6) },
> + { "Laser rx power high warning", SFF_A2_WARN_FLG + 1, (1 << 7) },
> + { "Laser rx power low warning", SFF_A2_WARN_FLG + 1, (1 << 6) },
> +
> + { NULL, 0, 0 },
> +};
> +
> +#ifdef HAVE_LIBM
> +
> +static double convert_mw_to_dbm(double mw)
> +{
> + return (10.f * log10(mw / 1000.f)) + 30.f;
Why are all the literals explicitly float and not double?
> +}
> +
> +#endif
> +
> +/* Externally calibrated SFP calculations */
> +#define ECAL(v, s, o) (( ((double) (s>>8)) + (s & 0xFF)) * (double) v + o)
Please follow kernel coding style for spacing. checkpatch.pl will show
you what should be changed.
> +static void sff8472_parse_eeprom(const __u8 *id, struct sff8472_diags *sd)
> +{
> + sd->supports_dom = id[SFF_A0_DOM] & SFF_A0_DOM_IMPL;
> + sd->supports_alarms = id[SFF_A0_OPTIONS] & SFF_A0_OPTIONS_AW;
> + sd->calibrated_int = id[SFF_A0_DOM] & SFF_A0_DOM_INTCAL;
> + sd->rx_power_type = id[SFF_A0_DOM] & SFF_A0_DOM_PWRT;
> +
> +
> +#define OFFSET_TO_U16(offset) (id[(offset)] << 8 | id[(offset) + 1])
> +
> + sd->bias_cur[MCURR] = OFFSET_TO_U16(SFF_A2_BIAS);
> + sd->bias_cur[HALRM] = OFFSET_TO_U16(SFF_A2_BIAS_HALRM);
> + sd->bias_cur[LALRM] = OFFSET_TO_U16(SFF_A2_BIAS_LALRM);
> + sd->bias_cur[HWARN] = OFFSET_TO_U16(SFF_A2_BIAS_HWARN);
> + sd->bias_cur[LWARN] = OFFSET_TO_U16(SFF_A2_BIAS_LWARN);
> +
> + sd->sfp_voltage[MCURR] = OFFSET_TO_U16(SFF_A2_VCC);
> + sd->sfp_voltage[HALRM] = OFFSET_TO_U16(SFF_A2_VCC_HALRM);
> + sd->sfp_voltage[LALRM] = OFFSET_TO_U16(SFF_A2_VCC_LALRM);
> + sd->sfp_voltage[HWARN] = OFFSET_TO_U16(SFF_A2_VCC_HWARN);
> + sd->sfp_voltage[LWARN] = OFFSET_TO_U16(SFF_A2_VCC_LWARN);
> +
> + sd->tx_power[MCURR] = OFFSET_TO_U16(SFF_A2_TX_PWR);
> + sd->tx_power[HALRM] = OFFSET_TO_U16(SFF_A2_TX_PWR_HALRM);
> + sd->tx_power[LALRM] = OFFSET_TO_U16(SFF_A2_TX_PWR_LALRM);
> + sd->tx_power[HWARN] = OFFSET_TO_U16(SFF_A2_TX_PWR_HWARN);
> + sd->tx_power[LWARN] = OFFSET_TO_U16(SFF_A2_TX_PWR_LWARN);
> +
> + sd->rx_power[MCURR] = OFFSET_TO_U16(SFF_A2_RX_PWR);
> + sd->rx_power[HALRM] = OFFSET_TO_U16(SFF_A2_RX_PWR_HALRM);
> + sd->rx_power[LALRM] = OFFSET_TO_U16(SFF_A2_RX_PWR_LALRM);
> + sd->rx_power[HWARN] = OFFSET_TO_U16(SFF_A2_RX_PWR_HWARN);
> + sd->rx_power[LWARN] = OFFSET_TO_U16(SFF_A2_RX_PWR_LWARN);
> +
> + /* Temperature conversions */
> +#define OFFSET_TO_TEMP(offset) \
> + ((*(__s8 *)(&id[(offset)])) * 1000 + ((id[(offset) + 1] * 1000) / 256)) / 100;
This seems awfuly complicated; why not:
#define OFFSET_TO_TEMP(offset) (((s16)OFFSET_TO_U16(offset)) * 10 / 256)
But why round to tenths of a degree here and then round again to whole
degrees celsius/fahrenheit when printing?
[...]
> +#define PRINT_TEMP(string, index) \
> + printf(" %-41s : %.0f degrees C / %.0f degrees F\n", (string), \
> + (double)(sd.sfp_temp[(index)] / 10.f), \
> + (double)(sd.sfp_temp[(index)] / 10.f * 1.8f + 32.f));
[...]
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-rps: Fix brokeness causing OOO packets
From: David Miller @ 2012-11-16 19:36 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, bhutchings
In-Reply-To: <1353092655.10798.44.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 16 Nov 2012 11:04:15 -0800
> From: Tom Herbert <therbert@google.com>
>
> In commit c445477d74ab3779 which adds aRFS to the kernel, the CPU
> selected for RFS is not set correctly when CPU is changing.
> This is causing OOO packets and probably other issues.
>
> Signed-off-by: Tom Herbert <therbert@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Applied and queued up for -stable, thanks everyone.
^ permalink raw reply
* Re: [PATCH] tcp: handle tcp_net_metrics_init() order-5 memory allocation failures
From: Eric Dumazet @ 2012-11-16 19:08 UTC (permalink / raw)
To: Julien Tinnes; +Cc: David Miller, netdev
In-Reply-To: <CAKyRK=iKnoRZbjyEXSYbKoFq8=wtVKAJYTQYeE9y_84YevdagA@mail.gmail.com>
On Fri, 2012-11-16 at 10:51 -0800, Julien Tinnes wrote:
> It happens when users start Chrome. Chrome will create one new network
> NS (for the sandbox).
>
> This has been used for a few years now, but we had our first report in
> January of this year and we've been getting a few reports very
> recently at a rate that is starting to worry me (crbug.com/110756).
>
> Thanks a lot for helping with this!
Thanks for bringing this issue to our attention !
^ permalink raw reply
* [PATCH] net-rps: Fix brokeness causing OOO packets
From: Eric Dumazet @ 2012-11-16 19:04 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Ben Hutchings
From: Tom Herbert <therbert@google.com>
In commit c445477d74ab3779 which adds aRFS to the kernel, the CPU
selected for RFS is not set correctly when CPU is changing.
This is causing OOO packets and probably other issues.
Signed-off-by: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
---
net/core/dev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index bda6d00..c0946cb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2818,8 +2818,10 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,
if (unlikely(tcpu != next_cpu) &&
(tcpu == RPS_NO_CPU || !cpu_online(tcpu) ||
((int)(per_cpu(softnet_data, tcpu).input_queue_head -
- rflow->last_qtail)) >= 0))
+ rflow->last_qtail)) >= 0)) {
+ tcpu = next_cpu;
rflow = set_rps_cpu(dev, skb, rflow, next_cpu);
+ }
if (tcpu != RPS_NO_CPU && cpu_online(tcpu)) {
*rflowp = rflow;
^ permalink raw reply related
* Re: [PATCH] openvswitch: Make IPv6 packet parsing dependent on IPv6 config
From: David Miller @ 2012-11-16 18:53 UTC (permalink / raw)
To: jesse; +Cc: vyasevic, dev, netdev, fengguang.wu
In-Reply-To: <CAEP_g=80_P=sLkQCGXwdTLKOFN5FgqYYoDbVDXMTipbtM-GhbA@mail.gmail.com>
From: Jesse Gross <jesse@nicira.com>
Date: Fri, 16 Nov 2012 10:46:17 -0800
> I guess the simplest thing to do seems to just make Open vSwitch
> depend on CONFIG_INET seeing as it is practically useless without
> upper layer protocol support anyways.
The reason we have the ipv6 extension header parsing in a seperate,
always compiled statically into the kernel, module is exactly for
situations like this.
We need to think seriously if we want to go down this road of only
using INET as protection for every module that has some kind of ipv6
component to it.
^ permalink raw reply
* Re: [PATCH] tcp: handle tcp_net_metrics_init() order-5 memory allocation failures
From: Julien Tinnes @ 2012-11-16 18:51 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
In-Reply-To: <1353079913.10798.31.camel@edumazet-glaptop>
On Fri, Nov 16, 2012 at 7:31 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Fri, 2012-11-16 at 01:39 -0500, David Miller wrote:
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Thu, 15 Nov 2012 15:41:04 -0800
>>
>> > From: Eric Dumazet <edumazet@google.com>
>> >
>> > order-5 allocations can fail with current kernels, we should
>> > try to reduce allocation sizes to allow network namespace
>> > creation.
>> >
>> > Reported-by: Julien Tinnes <jln@google.com>
>> > Signed-off-by: Eric Dumazet <edumazet@google.com>
>>
>> Indeed, this has to be done better.
>>
>> But this kind of retry solution results in non-deterministic behavior.
>> Yes the tcp metrics cache is best effort, but it's size can influence
>> behavior in a substantial way depending upon the workload.
>>
>> I would suggest that we instead use different limits, ones which the
>> page allocator will satisfy for us always with GFP_KERNEL.
>>
>> 1) include linux/mmzone.h
>>
>> 2) Make the two limits based upon PAGE_ALLOC_COSTLY_ORDER.
>>
>> That is, make the larger table size PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER
>> and the smaller one PAGE_SIZE << (PAGE_ALLOC_COSTLY_ORDER - 1).
>
> Well, we dont really know what the size needs to be, and your proposal
> reduces the size by a 4 factor, even for the initial namespace.
>
> Julien report was about Chrome browser own netns, on a suspend/resume
> cycle (or something like that)
It happens when users start Chrome. Chrome will create one new network
NS (for the sandbox).
This has been used for a few years now, but we had our first report in
January of this year and we've been getting a few reports very
recently at a rate that is starting to worry me (crbug.com/110756).
Thanks a lot for helping with this!
Julien
^ permalink raw reply
* Re: [PATCH] openvswitch: Make IPv6 packet parsing dependent on IPv6 config
From: Jesse Gross @ 2012-11-16 18:46 UTC (permalink / raw)
To: vyasevic-H+wXaHxf7aLQT0dZR+AlfA
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
fengguang.wu-ral2JQCrhuEAvxtiuMwx3w, davem-fT/PcQaiUtIeIZ0/mPfg9Q
In-Reply-To: <50A67B44.9040508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Fri, Nov 16, 2012 at 9:43 AM, Vlad Yasevich <vyasevic-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> On 11/16/2012 12:26 PM, Jesse Gross wrote:
>>
>> On Fri, Nov 16, 2012 at 7:40 AM, Vlad Yasevich <vyasevic-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> wrote:
>>
>>> Openvswitch attempts to use IPv6 packet parsing functions without
>>> any dependency on IPv6 (unlike every other place in kernel). Pull
>>> the IPv6 code in openvswitch togeter and put a conditional that's
>>> dependent on CONFIG_IPV6.
>>>
>>> Resolves:
>>> net/built-in.o: In function `ovs_flow_extract':
>>> (.text+0xbf5d5): undefined reference to `ipv6_skip_exthdr'
>>>
>>> Signed-off-by: Vlad Yasevich <vyasevic-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>
>>
>>
>> Doesn't this move in the opposite direction of your patches to make IPv6
>> GSO/GRO always available? The packets being processed here
>> are generally created by the guest but with Open vSwitch running on the
>> host. Also, ipv6_skip_exthdr() is in exthdrs_core.c, so it actually is
>> always available. I suspect that the real problem is that the dependency
>> on the ipv6 directory changed to CONFIG_INET and Open vSwitch should now
>> depend on this.
>>
>
> Yes and no... :) IPv6 uses a bunch of IPv4 code all over. IPv4 is enabled
> with CONFIG_INET and IPv6 with CONFIG_NET. So creates a strange imbalance.
> By shifting IPv6 to CONFIG_INET (which is where it
> lives and what enables its selection during config process), we now have a
> dependency with openvswitch.
>
> All other users of ipv6_skip_exthdr have it either under the IS_ENABLED
> conditional or through some other means that don't build it when INET is
> completely turned off. This patch does the same for openvswitch.
>
> I see 2 alternatives to this:
> 1) Make openvswitch depend on CONFIG_INET.
> 2) Pull a ton of code out of CONFIG_INET (v4 and v6) and into CONFIG_NET.
> This could start with IPv6 header parsing and maybe even
> include GSO/TSO (but not sure how much sense that would be).
>
> What's your take?
I agree the IPv4 and IPv6 code is all tangled together and that IPv6
should use CONFIG_INET as well. I think in an ideal world we would
separate them out but it seems like a lot of work for not much
practical benefit.
I think if you took this to the logical extension and restricted all
the protocols based on the kernel config (i.e. IPv4, TCP, and UDP are
conditional on CONFIG_INET) then you end up with a confusing mess. On
the other hand, if you do it only for IPv6 it's also confusing because
the fact that the other protocols are simple enough to parse on their
own and IPv6 is more complicated is really an implementation detail
that shouldn't be exposed.
I guess the simplest thing to do seems to just make Open vSwitch
depend on CONFIG_INET seeing as it is practically useless without
upper layer protocol support anyways.
^ permalink raw reply
* Re: [RFC PATCH] tcp: introduce raw access to experimental options
From: David Miller @ 2012-11-16 18:44 UTC (permalink / raw)
To: elelueck; +Cc: netdev, frankbla, raspl, ubacher, samudrala
In-Reply-To: <1353084898-42264-1-git-send-email-elelueck@linux.vnet.ibm.com>
Unprivileged access to set and fetch these things? I don't think
that's a good idea.
Also, your code has a lot of coding style errors.
^ permalink raw reply
* Re: [PATCH net-next] net: use right lock in __dev_remove_offload
From: David Miller @ 2012-11-16 18:41 UTC (permalink / raw)
To: vyasevic; +Cc: eric.dumazet, netdev
In-Reply-To: <50A682DA.2060201@redhat.com>
From: Vlad Yasevich <vyasevic@redhat.com>
Date: Fri, 16 Nov 2012 13:15:54 -0500
> On 11/16/2012 01:08 PM, Eric Dumazet wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> offload_base is protected by offload_lock, not ptype_lock
>>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
...
> Acked-by: Vlad Yasevich <vyasevic@redhat.com>
Applied, thanks everyone.
^ permalink raw reply
* Re: pull request: batman-adv 2012-11-16
From: David Miller @ 2012-11-16 18:39 UTC (permalink / raw)
To: ordex; +Cc: netdev, simon.wunderlich, lindner_marek, sven
In-Reply-To: <1353055758-2901-1-git-send-email-ordex@autistici.org>
From: Antonio Quartulli <ordex@autistici.org>
Date: Fri, 16 Nov 2012 09:49:14 +0100
> here is small set of fixes intended for net/linux-3.7.
> These patches are fixing some interoperability problems due to the features we
> added in 3.7. Mainly we have two big issues: one is preventing clients connected
> to the mesh network to contact any other hosts, caused by a not proper
> translation table handling; the second one compromises the AP isolation feature
> causing it to be completely useless, no matter it was on or off.
Pulled, thanks.
^ permalink raw reply
* Re: [PATCH] tcp: handle tcp_net_metrics_init() order-5 memory allocation failures
From: David Miller @ 2012-11-16 18:37 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, jln
In-Reply-To: <1353079913.10798.31.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 16 Nov 2012 07:31:53 -0800
> Well, we dont really know what the size needs to be, and your proposal
> reduces the size by a 4 factor, even for the initial namespace.
>
> Julien report was about Chrome browser own netns, on a suspend/resume
> cycle (or something like that)
>
> If size can influence behavior, we could try a vmalloc() if kmalloc()
> fails...
Agreed.
> [PATCH v3] tcp: handle tcp_net_metrics_init() order-5 memory allocation failures
>
> order-5 allocations can fail with current kernels, we should
> try vmalloc() as well.
>
> Reported-by: Julien Tinnes <jln@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
This looks great, applied, thanks.
^ permalink raw reply
* pull request: wireless 2012-11-16
From: John W. Linville @ 2012-11-16 18:30 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 17964 bytes --]
commit 26c6e80892d8c160dffaba85889bd4e65b1dacf6
Dave,
This batch of fixes is intended for the 3.7 stream...
This includes a pull of the Bluetooth tree. Gustavo says:
"A few important fixes to go into 3.7. There is a new hw support by Marcos
Chaparro. Johan added a memory leak fix and hci device index list fix.
Also Marcel fixed a race condition in the device set up that was prevent the
bt monitor to work properly. Last, Paulo Sérgio added a fix to the error
status when pairing for LE fails. This was prevent userspace to work to handle
the failure properly."
Regarding the mac80211 pull, Johannes says:
"I have a locking fix for some SKB queues, a variable initialization to
avoid crashes in a certain failure case, another free_txskb fix from
Felix and another fix from him to avoid calling a stopped driver, a fix
for a (very unlikely) memory leak and a fix to not send null data
packets when resuming while not associated."
Regarding the iwlwifi pull, Johannes says:
"Two more fixes for iwlwifi ... one to use ieee80211_free_txskb(), and
one to check DMA mapping errors, please pull."
On top of that, Johannes also included a wireless regulatory fix
to allow 40 MHz on channels 12 and 13 in world roaming mode. Also,
Hauke Mehrtens fixes a #ifdef typo in brcmfmac.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 6fc4adca6ce3e1d57a42707019dddcb883578a91:
tilegx: request_irq with a non-null device name (2012-11-16 01:40:41 -0500)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git for-davem
for you to fetch changes up to 26c6e80892d8c160dffaba85889bd4e65b1dacf6:
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem (2012-11-16 12:59:13 -0500)
----------------------------------------------------------------
Arik Nemtsov (1):
mac80211: sync acccess to tx_filtered/ps_tx_buf queues
David Spinadel (1):
mac80211: init sched_scan_ies
Felix Fietkau (2):
mac80211: do not call ieee80211_configure_filter if no interfaces are up
mac80211: call skb_dequeue/ieee80211_free_txskb instead of __skb_queue_purge
Hauke Mehrtens (1):
brcmfmac: fix typo in CONFIG_BRCMISCAN
Johan Hedberg (2):
Bluetooth: Fix having bogus entries in mgmt_read_index_list reply
Bluetooth: Fix memory leak when removing a UUID
Johannes Berg (5):
iwlwifi: handle DMA mapping failures
iwlwifi: use ieee80211_free_txskb
mac80211: fix memory leak in device registration error path
mac80211: don't send null data packet when not associated
wireless: allow 40 MHz on world roaming channels 12/13
John W. Linville (4):
Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Merge branch 'master' of git://git.kernel.org/.../bluetooth/bluetooth
Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem
Marcel Holtmann (1):
Bluetooth: Notify about device registration before power on
Marcos Chaparro (1):
Bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027]
Paulo Sérgio (1):
Bluetooth: Fix error status when pairing fails
drivers/bluetooth/ath3k.c | 1 +
drivers/bluetooth/btusb.c | 1 +
.../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 +-
drivers/net/wireless/iwlwifi/dvm/mac80211.c | 2 +-
drivers/net/wireless/iwlwifi/dvm/main.c | 2 +-
drivers/net/wireless/iwlwifi/pcie/rx.c | 23 ++++++++++++++++++++--
net/bluetooth/hci_core.c | 4 ++--
net/bluetooth/mgmt.c | 12 ++++++-----
net/bluetooth/smp.c | 2 +-
net/mac80211/cfg.c | 3 +++
net/mac80211/ieee80211_i.h | 2 ++
net/mac80211/main.c | 6 ++++--
net/mac80211/scan.c | 2 +-
net/mac80211/sta_info.c | 11 ++++++++---
net/mac80211/status.c | 9 +++++++++
net/mac80211/tx.c | 9 ++++++---
net/mac80211/util.c | 2 ++
net/wireless/reg.c | 5 ++---
18 files changed, 73 insertions(+), 25 deletions(-)
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index fc2de55..b00000e 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -67,6 +67,7 @@ static struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x13d3, 0x3304) },
{ USB_DEVICE(0x0930, 0x0215) },
{ USB_DEVICE(0x0489, 0xE03D) },
+ { USB_DEVICE(0x0489, 0xE027) },
/* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03F0, 0x311D) },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index debda27..ee82f2f 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -124,6 +124,7 @@ static struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
{ USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
{ USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
+ { USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE },
/* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index a6f1e81..481345c 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -4401,7 +4401,7 @@ static s32 brcmf_mode_to_nl80211_iftype(s32 mode)
static void brcmf_wiphy_pno_params(struct wiphy *wiphy)
{
-#ifndef CONFIG_BRCMFISCAN
+#ifndef CONFIG_BRCMISCAN
/* scheduled scan settings */
wiphy->max_sched_scan_ssids = BRCMF_PNO_MAX_PFN_COUNT;
wiphy->max_match_sets = BRCMF_PNO_MAX_PFN_COUNT;
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index ff8162d..fa4d1b8 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -521,7 +521,7 @@ static void iwlagn_mac_tx(struct ieee80211_hw *hw,
ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
if (iwlagn_tx_skb(priv, control->sta, skb))
- dev_kfree_skb_any(skb);
+ ieee80211_free_txskb(hw, skb);
}
static void iwlagn_mac_update_tkip_key(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c
index 7ff3f14..408132c 100644
--- a/drivers/net/wireless/iwlwifi/dvm/main.c
+++ b/drivers/net/wireless/iwlwifi/dvm/main.c
@@ -2114,7 +2114,7 @@ static void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb)
info = IEEE80211_SKB_CB(skb);
iwl_trans_free_tx_cmd(priv->trans, info->driver_data[1]);
- dev_kfree_skb_any(skb);
+ ieee80211_free_txskb(priv->hw, skb);
}
static void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index 17c8e5d..bb69f8f 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -321,6 +321,14 @@ static void iwl_rx_allocate(struct iwl_trans *trans, gfp_t priority)
dma_map_page(trans->dev, page, 0,
PAGE_SIZE << trans_pcie->rx_page_order,
DMA_FROM_DEVICE);
+ if (dma_mapping_error(trans->dev, rxb->page_dma)) {
+ rxb->page = NULL;
+ spin_lock_irqsave(&rxq->lock, flags);
+ list_add(&rxb->list, &rxq->rx_used);
+ spin_unlock_irqrestore(&rxq->lock, flags);
+ __free_pages(page, trans_pcie->rx_page_order);
+ return;
+ }
/* dma address must be no more than 36 bits */
BUG_ON(rxb->page_dma & ~DMA_BIT_MASK(36));
/* and also 256 byte aligned! */
@@ -488,8 +496,19 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans,
dma_map_page(trans->dev, rxb->page, 0,
PAGE_SIZE << trans_pcie->rx_page_order,
DMA_FROM_DEVICE);
- list_add_tail(&rxb->list, &rxq->rx_free);
- rxq->free_count++;
+ if (dma_mapping_error(trans->dev, rxb->page_dma)) {
+ /*
+ * free the page(s) as well to not break
+ * the invariant that the items on the used
+ * list have no page(s)
+ */
+ __free_pages(rxb->page, trans_pcie->rx_page_order);
+ rxb->page = NULL;
+ list_add_tail(&rxb->list, &rxq->rx_used);
+ } else {
+ list_add_tail(&rxb->list, &rxq->rx_free);
+ rxq->free_count++;
+ }
} else
list_add_tail(&rxb->list, &rxq->rx_used);
spin_unlock_irqrestore(&rxq->lock, flags);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 8a0ce70..a0a2f97 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1754,11 +1754,11 @@ int hci_register_dev(struct hci_dev *hdev)
if (hdev->dev_type != HCI_AMP)
set_bit(HCI_AUTO_OFF, &hdev->dev_flags);
- schedule_work(&hdev->power_on);
-
hci_notify(hdev, HCI_DEV_REG);
hci_dev_hold(hdev);
+ schedule_work(&hdev->power_on);
+
return id;
err_wqueue:
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index aa2ea0a..91de423 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -326,7 +326,7 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data,
struct hci_dev *d;
size_t rp_len;
u16 count;
- int i, err;
+ int err;
BT_DBG("sock %p", sk);
@@ -347,9 +347,7 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data,
return -ENOMEM;
}
- rp->num_controllers = cpu_to_le16(count);
-
- i = 0;
+ count = 0;
list_for_each_entry(d, &hci_dev_list, list) {
if (test_bit(HCI_SETUP, &d->dev_flags))
continue;
@@ -357,10 +355,13 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data,
if (!mgmt_valid_hdev(d))
continue;
- rp->index[i++] = cpu_to_le16(d->id);
+ rp->index[count++] = cpu_to_le16(d->id);
BT_DBG("Added hci%u", d->id);
}
+ rp->num_controllers = cpu_to_le16(count);
+ rp_len = sizeof(*rp) + (2 * count);
+
read_unlock(&hci_dev_list_lock);
err = cmd_complete(sk, MGMT_INDEX_NONE, MGMT_OP_READ_INDEX_LIST, 0, rp,
@@ -1366,6 +1367,7 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data,
continue;
list_del(&match->list);
+ kfree(match);
found++;
}
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 2ac8d50..a592337 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -267,7 +267,7 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send)
clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags);
mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type,
- hcon->dst_type, reason);
+ hcon->dst_type, HCI_ERROR_AUTH_FAILURE);
cancel_delayed_work_sync(&conn->security_timer);
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 05f3a31..7371f67 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2594,6 +2594,9 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy,
else
local->probe_req_reg--;
+ if (!local->open_count)
+ break;
+
ieee80211_queue_work(&local->hw, &local->reconfig_filter);
break;
default:
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 8c80455..156e583 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1314,6 +1314,8 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
struct net_device *dev);
netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
struct net_device *dev);
+void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
+ struct sk_buff_head *skbs);
/* HT */
void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index c80c449..f57f597 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -871,8 +871,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
local->hw.wiphy->cipher_suites,
sizeof(u32) * local->hw.wiphy->n_cipher_suites,
GFP_KERNEL);
- if (!suites)
- return -ENOMEM;
+ if (!suites) {
+ result = -ENOMEM;
+ goto fail_wiphy_register;
+ }
for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) {
u32 suite = local->hw.wiphy->cipher_suites[r];
if (suite == WLAN_CIPHER_SUITE_WEP40 ||
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index c4cdbde..43e60b5 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -917,7 +917,7 @@ int ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
struct cfg80211_sched_scan_request *req)
{
struct ieee80211_local *local = sdata->local;
- struct ieee80211_sched_scan_ies sched_scan_ies;
+ struct ieee80211_sched_scan_ies sched_scan_ies = {};
int ret, i;
mutex_lock(&local->mtx);
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 0a4e4c0..d2eb64e 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -117,8 +117,8 @@ static void free_sta_work(struct work_struct *wk)
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]);
- __skb_queue_purge(&sta->ps_tx_buf[ac]);
- __skb_queue_purge(&sta->tx_filtered[ac]);
+ ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]);
+ ieee80211_purge_tx_queue(&local->hw, &sta->tx_filtered[ac]);
}
#ifdef CONFIG_MAC80211_MESH
@@ -141,7 +141,7 @@ static void free_sta_work(struct work_struct *wk)
tid_tx = rcu_dereference_raw(sta->ampdu_mlme.tid_tx[i]);
if (!tid_tx)
continue;
- __skb_queue_purge(&tid_tx->pending);
+ ieee80211_purge_tx_queue(&local->hw, &tid_tx->pending);
kfree(tid_tx);
}
@@ -961,6 +961,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
struct ieee80211_local *local = sdata->local;
struct sk_buff_head pending;
int filtered = 0, buffered = 0, ac;
+ unsigned long flags;
clear_sta_flag(sta, WLAN_STA_SP);
@@ -976,12 +977,16 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
int count = skb_queue_len(&pending), tmp;
+ spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags);
skb_queue_splice_tail_init(&sta->tx_filtered[ac], &pending);
+ spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags);
tmp = skb_queue_len(&pending);
filtered += tmp - count;
count = tmp;
+ spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags);
skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending);
+ spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags);
tmp = skb_queue_len(&pending);
buffered += tmp - count;
}
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 3af0cc4..101eb88 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -668,3 +668,12 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb)
dev_kfree_skb_any(skb);
}
EXPORT_SYMBOL(ieee80211_free_txskb);
+
+void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
+ struct sk_buff_head *skbs)
+{
+ struct sk_buff *skb;
+
+ while ((skb = __skb_dequeue(skbs)))
+ ieee80211_free_txskb(hw, skb);
+}
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c9bf83f..b858ebe 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1358,7 +1358,7 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx)
if (tx->skb)
ieee80211_free_txskb(&tx->local->hw, tx->skb);
else
- __skb_queue_purge(&tx->skbs);
+ ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs);
return -1;
} else if (unlikely(res == TX_QUEUED)) {
I802_DEBUG_INC(tx->local->tx_handlers_queued);
@@ -2120,10 +2120,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
*/
void ieee80211_clear_tx_pending(struct ieee80211_local *local)
{
+ struct sk_buff *skb;
int i;
- for (i = 0; i < local->hw.queues; i++)
- skb_queue_purge(&local->pending[i]);
+ for (i = 0; i < local->hw.queues; i++) {
+ while ((skb = skb_dequeue(&local->pending[i])) != NULL)
+ ieee80211_free_txskb(&local->hw, skb);
+ }
}
/*
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 2393918..0151ae3 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1491,6 +1491,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
list_for_each_entry(sdata, &local->interfaces, list) {
if (sdata->vif.type != NL80211_IFTYPE_STATION)
continue;
+ if (!sdata->u.mgd.associated)
+ continue;
ieee80211_send_nullfunc(local, sdata, 0);
}
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index bcc7d7e..b75756b 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -141,9 +141,8 @@ static const struct ieee80211_regdomain world_regdom = {
.reg_rules = {
/* IEEE 802.11b/g, channels 1..11 */
REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
- /* IEEE 802.11b/g, channels 12..13. No HT40
- * channel fits here. */
- REG_RULE(2467-10, 2472+10, 20, 6, 20,
+ /* IEEE 802.11b/g, channels 12..13. */
+ REG_RULE(2467-10, 2472+10, 40, 6, 20,
NL80211_RRF_PASSIVE_SCAN |
NL80211_RRF_NO_IBSS),
/* IEEE 802.11 channel 14 - Only JP enables
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related
* Re: [PATCH 14/14] wlcore: Remove redundant check on unsigned variable
From: Luciano Coelho @ 2012-11-16 18:24 UTC (permalink / raw)
To: Tushar Behera; +Cc: linux-kernel, patches, linux-wireless, netdev
In-Reply-To: <1353048646-10935-15-git-send-email-tushar.behera@linaro.org>
On Fri, 2012-11-16 at 12:20 +0530, Tushar Behera wrote:
> No need to check whether unsigned variable is less than 0.
>
> CC: Luciano Coelho <coelho@ti.com>
> CC: linux-wireless@vger.kernel.org
> CC: netdev@vger.kernel.org
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---
Applied in the wl12xx.git tree. Thanks!
--
Luca.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox