* [PATCH] NFC: hci/core.c: local variables should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:05 UTC (permalink / raw)
To: Linux Kernel
Cc: netdev, linux-wireless, lauro.venancio, aloisio.almeida, sameo,
davem
The variable 'hci_nfc_ops' is only referenced in this file and
should be marked static to prevent it from being exposed globally.
Quites the sparse warning:
warning: symbol 'hci_nfc_ops' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index 86fd00d..0ce5ee4 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -605,7 +605,7 @@ static int hci_data_exchange(struct nfc_dev *nfc_dev, u32 target_idx,
return 0;
}
-struct nfc_ops hci_nfc_ops = {
+static struct nfc_ops hci_nfc_ops = {
.dev_up = hci_dev_up,
.dev_down = hci_dev_down,
.start_poll = hci_start_poll,
^ permalink raw reply related
* [PATCH] NFC: netlink.c: local variables should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:09 UTC (permalink / raw)
To: Linux Kernel
Cc: netdev, linux-wireless, lauro.venancio, aloisio.almeida, sameo,
davem
The variable ''nfc_genl_family' is only referenced in this file and
should be marked static to prevent it from being exposed globally.
Quites the sparse warning:
warning: symbol 'nfc_genl_family' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index f1829f6..850485d 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -33,7 +33,7 @@ static struct genl_multicast_group nfc_genl_event_mcgrp = {
.name = NFC_GENL_MCAST_EVENT_NAME,
};
-struct genl_family nfc_genl_family = {
+static struct genl_family nfc_genl_family = {
.id = GENL_ID_GENERATE,
.hdrsize = 0,
.name = NFC_GENL_NAME,
^ permalink raw reply related
* [PATCH] IPVS: ip_vs_ftp.c: local functions should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:17 UTC (permalink / raw)
To: Linux Kernel; +Cc: netdev, davem
Functions not referenced outside of a source file should be marked
static to prevent it from being exposed globally.
This quiets the sparse warnings:
warning: symbol 'ip_vs_ftp_init' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index debb8c7..091bec9 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -483,7 +483,7 @@ static struct pernet_operations ip_vs_ftp_ops = {
.exit = __ip_vs_ftp_exit,
};
-int __init ip_vs_ftp_init(void)
+static int __init ip_vs_ftp_init(void)
{
int rv;
^ permalink raw reply related
* [PATCH] IPVS: ip_vs_proto.c: local functions should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:26 UTC (permalink / raw)
To: Linux Kernel; +Cc: netdev, davem
Functions not referenced outside of a source file should be marked
static to prevent it from being exposed globally.
This quiets the sparse warnings:
warning: symbol '__ipvs_proto_data_get' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index 6eda11d..d5d1d92 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -153,7 +153,7 @@ EXPORT_SYMBOL(ip_vs_proto_get);
/*
* get ip_vs_protocol object data by netns and proto
*/
-struct ip_vs_proto_data *
+static struct ip_vs_proto_data *
__ipvs_proto_data_get(struct netns_ipvs *ipvs, unsigned short proto)
{
struct ip_vs_proto_data *pd;
^ permalink raw reply related
* [PATCH] IPVS: ip_vs_sync.c: local functions should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:29 UTC (permalink / raw)
To: Linux Kernel; +Cc: netdev, davem
Functions not referenced outside of a source file should be marked
static to prevent it from being exposed globally.
This quiets the sparse warnings:
warning: symbol 'ip_vs_sync_conn_v0' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index bf5e538..49a1fe8 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -446,7 +446,7 @@ ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs)
* Version 0 , could be switched in by sys_ctl.
* Add an ip_vs_conn information into the current sync_buff.
*/
-void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
+static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
{
struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_sync_mesg_v0 *m;
^ permalink raw reply related
* Re: pull request: wireless-next 2012-04-25
From: John W. Linville @ 2012-04-26 18:41 UTC (permalink / raw)
To: David Miller
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120425.163926.2209040699696617525.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Wed, Apr 25, 2012 at 04:39:26PM -0400, David Miller wrote:
> From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
> Date: Wed, 25 Apr 2012 15:14:19 -0400
>
> > This is another batch of updates intended for 3.5...
> ...
> > Please let me know if there are problems!
>
> There are:
>
> From 792545c7bc5d6b922d3778dc602e557d64c83551 Mon Sep 17 00:00:00 2001
> From: "Luis R. Rodriguez" <mcgrof-3uybbJdB1yH774rrrx3eTA@public.gmane.org>
> Date: Mon, 23 Apr 2012 19:55:48 -0700
> Subject: [PATCH 88/88] libertas: include sched.h on firmware.c
>
> Do not assume we have our subsystem including this for us,
> at least for older kernels this is not true. Lets just be
> explicit about this requirement for the usage of wake_up().
>
> Signed-off-by: Luis R. Rodriguez <mcgrof-3uybbJdB1yH774rrrx3eTA@public.gmane.org>
> Signed-off-by: John W. Linville <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
>
> This is bogus, wake_up() is defined in linux/wait.h, the whole
> point of the linux/sched.h split up is so that linux/sched.h
> includes could be removed and replaced with actual dependencies.
This is completely my bad. Anyway, Felix already added that include
in that file a few lines later in order to pick-up the definitions
for TASK_NORMAL and TASK_UNINTERRUPTIBLE. I'll just drop Luis's patch.
> Also, please don't accept any patches from Luis that add those
> #undef pr_fmt things to the atheros drivers.
>
> He tried to add it an ethernet driver, and I asked him to explain
> exactly why he's doing and that if it's appropriate then it's
> appropriate everywhere not just in a few specific drivers. He failed
> to respond to me, and therefore failed to explain the situation and
> address my concerned. And then I saw just today that he's submitting
> the same patch to wireless drivers. That's not acceptable.
>
> Thanks.
OK. I think the compat-wireless guys have found a different solution
anyway.
John
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 0/2] drop_monitor: misc fixes for some recently reported bugs
From: Neil Horman @ 2012-04-26 18:47 UTC (permalink / raw)
To: netdev; +Cc: Neil Horman, Eric Dumazet, David Miller
Hey-
Eric was using dropwatch recently and reported a few bugs to me that he
had noted. This short series should fix them all up.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: David Miller <davem@davemloft.net>
^ permalink raw reply
* [PATCH 1/2] drop_monitor: fix sleeping in invalid context warning
From: Neil Horman @ 2012-04-26 18:47 UTC (permalink / raw)
To: netdev; +Cc: Neil Horman, David Miller
In-Reply-To: <1335466022-32661-1-git-send-email-nhorman@tuxdriver.com>
Eric Dumazet pointed out this warning in the drop_monitor protocol to me:
[ 38.352571] BUG: sleeping function called from invalid context at kernel/mutex.c:85
[ 38.352576] in_atomic(): 1, irqs_disabled(): 0, pid: 4415, name: dropwatch
[ 38.352580] Pid: 4415, comm: dropwatch Not tainted 3.4.0-rc2+ #71
[ 38.352582] Call Trace:
[ 38.352592] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
[ 38.352599] [<ffffffff81063f2a>] __might_sleep+0xca/0xf0
[ 38.352606] [<ffffffff81655b16>] mutex_lock+0x26/0x50
[ 38.352610] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
[ 38.352616] [<ffffffff810b72d9>] tracepoint_probe_register+0x29/0x90
[ 38.352621] [<ffffffff8153a585>] set_all_monitor_traces+0x105/0x170
[ 38.352625] [<ffffffff8153a8ca>] net_dm_cmd_trace+0x2a/0x40
[ 38.352630] [<ffffffff8154a81a>] genl_rcv_msg+0x21a/0x2b0
[ 38.352636] [<ffffffff810f8029>] ? zone_statistics+0x99/0xc0
[ 38.352640] [<ffffffff8154a600>] ? genl_rcv+0x30/0x30
[ 38.352645] [<ffffffff8154a059>] netlink_rcv_skb+0xa9/0xd0
[ 38.352649] [<ffffffff8154a5f0>] genl_rcv+0x20/0x30
[ 38.352653] [<ffffffff81549a7e>] netlink_unicast+0x1ae/0x1f0
[ 38.352658] [<ffffffff81549d76>] netlink_sendmsg+0x2b6/0x310
[ 38.352663] [<ffffffff8150824f>] sock_sendmsg+0x10f/0x130
[ 38.352668] [<ffffffff8150abe0>] ? move_addr_to_kernel+0x60/0xb0
[ 38.352673] [<ffffffff81515f04>] ? verify_iovec+0x64/0xe0
[ 38.352677] [<ffffffff81509c46>] __sys_sendmsg+0x386/0x390
[ 38.352682] [<ffffffff810ffaf9>] ? handle_mm_fault+0x139/0x210
[ 38.352687] [<ffffffff8165b5bc>] ? do_page_fault+0x1ec/0x4f0
[ 38.352693] [<ffffffff8106ba4d>] ? set_next_entity+0x9d/0xb0
[ 38.352699] [<ffffffff81310b49>] ? tty_ldisc_deref+0x9/0x10
[ 38.352703] [<ffffffff8106d363>] ? pick_next_task_fair+0x63/0x140
[ 38.352708] [<ffffffff8150b8d4>] sys_sendmsg+0x44/0x80
[ 38.352713] [<ffffffff8165f8e2>] system_call_fastpath+0x16/0x1b
It stems from holding a spinlock (trace_state_lock) while attempting to register
or unregister tracepoint hooks, making in_atomic() true in this context, leading
to the warning when the tracepoint calls might_sleep() while its taking a mutex.
Since we only use the trace_state_lock to prevent trace protocol state races, as
well as hardware stat list updates on an rcu write side, we can just convert the
spinlock to a mutex to avoid this problem.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: David Miller <davem@davemloft.net>
---
net/core/drop_monitor.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 5c3c81a..04ce1dd 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -42,7 +42,7 @@ static void send_dm_alert(struct work_struct *unused);
* netlink alerts
*/
static int trace_state = TRACE_OFF;
-static DEFINE_SPINLOCK(trace_state_lock);
+static DEFINE_MUTEX(trace_state_lock);
struct per_cpu_dm_data {
struct work_struct dm_alert_work;
@@ -214,7 +214,7 @@ static int set_all_monitor_traces(int state)
struct dm_hw_stat_delta *new_stat = NULL;
struct dm_hw_stat_delta *temp;
- spin_lock(&trace_state_lock);
+ mutex_lock(&trace_state_lock);
if (state == trace_state) {
rc = -EAGAIN;
@@ -253,7 +253,7 @@ static int set_all_monitor_traces(int state)
rc = -EINPROGRESS;
out_unlock:
- spin_unlock(&trace_state_lock);
+ mutex_unlock(&trace_state_lock);
return rc;
}
@@ -296,12 +296,12 @@ static int dropmon_net_event(struct notifier_block *ev_block,
new_stat->dev = dev;
new_stat->last_rx = jiffies;
- spin_lock(&trace_state_lock);
+ mutex_lock(&trace_state_lock);
list_add_rcu(&new_stat->list, &hw_stats_list);
- spin_unlock(&trace_state_lock);
+ mutex_unlock(&trace_state_lock);
break;
case NETDEV_UNREGISTER:
- spin_lock(&trace_state_lock);
+ mutex_lock(&trace_state_lock);
list_for_each_entry_safe(new_stat, tmp, &hw_stats_list, list) {
if (new_stat->dev == dev) {
new_stat->dev = NULL;
@@ -312,7 +312,7 @@ static int dropmon_net_event(struct notifier_block *ev_block,
}
}
}
- spin_unlock(&trace_state_lock);
+ mutex_unlock(&trace_state_lock);
break;
}
out:
--
1.7.7.6
^ permalink raw reply related
* [PATCH 2/2] drop_monitor: Make updating data->skb smp safe
From: Neil Horman @ 2012-04-26 18:47 UTC (permalink / raw)
To: netdev; +Cc: Neil Horman, David Miller
In-Reply-To: <1335466022-32661-1-git-send-email-nhorman@tuxdriver.com>
Eric Dumazet pointed out to me that the drop_monitor protocol has some holes in
its smp protections. Specifically, its possible to replace data->skb while its
being written. This patch corrects that by making data->skb and rcu protected
variable. That will prevent it from being overwritten while a tracepoint is
modifying it.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: David Miller <davem@davemloft.net>
---
net/core/drop_monitor.c | 43 ++++++++++++++++++++++++++++++++-----------
1 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 04ce1dd..852e36b 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -46,7 +46,7 @@ static DEFINE_MUTEX(trace_state_lock);
struct per_cpu_dm_data {
struct work_struct dm_alert_work;
- struct sk_buff *skb;
+ struct sk_buff __rcu *skb;
atomic_t dm_hit_count;
struct timer_list send_timer;
};
@@ -79,29 +79,41 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data)
size_t al;
struct net_dm_alert_msg *msg;
struct nlattr *nla;
+ struct sk_buff *skb;
al = sizeof(struct net_dm_alert_msg);
al += dm_hit_limit * sizeof(struct net_dm_drop_point);
al += sizeof(struct nlattr);
- data->skb = genlmsg_new(al, GFP_KERNEL);
- genlmsg_put(data->skb, 0, 0, &net_drop_monitor_family,
+ skb = genlmsg_new(al, GFP_KERNEL);
+ genlmsg_put(skb, 0, 0, &net_drop_monitor_family,
0, NET_DM_CMD_ALERT);
- nla = nla_reserve(data->skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
+ nla = nla_reserve(skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
msg = nla_data(nla);
memset(msg, 0, al);
+
+ /*
+ * Don't need to lock this, since we are guaranteed to only
+ * run this on a single cpu at a time
+ */
+ rcu_assign_pointer(data->skb, skb);
+
+ synchronize_rcu();
+
atomic_set(&data->dm_hit_count, dm_hit_limit);
}
static void send_dm_alert(struct work_struct *unused)
{
struct sk_buff *skb;
- struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
/*
* Grab the skb we're about to send
*/
- skb = data->skb;
+ rcu_read_lock();
+ skb = rcu_dereference(data->skb);
+ rcu_read_unlock();
/*
* Replace it with a new one
@@ -113,6 +125,7 @@ static void send_dm_alert(struct work_struct *unused)
*/
genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
+ put_cpu_var(dm_cpu_data);
}
/*
@@ -123,9 +136,11 @@ static void send_dm_alert(struct work_struct *unused)
*/
static void sched_send_work(unsigned long unused)
{
- struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
+
+ schedule_work_on(smp_processor_id(), &data->dm_alert_work);
- schedule_work(&data->dm_alert_work);
+ put_cpu_var(dm_cpu_data);
}
static void trace_drop_common(struct sk_buff *skb, void *location)
@@ -134,9 +149,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
struct nlmsghdr *nlh;
struct nlattr *nla;
int i;
- struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
+ struct sk_buff *dskb;
+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
+ rcu_read_lock();
+ dskb = rcu_dereference(data->skb);
+
if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
/*
* we're already at zero, discard this hit
@@ -144,7 +163,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
goto out;
}
- nlh = (struct nlmsghdr *)data->skb->data;
+ nlh = (struct nlmsghdr *)dskb->data;
nla = genlmsg_data(nlmsg_data(nlh));
msg = nla_data(nla);
for (i = 0; i < msg->entries; i++) {
@@ -158,7 +177,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
/*
* We need to create a new entry
*/
- __nla_reserve_nohdr(data->skb, sizeof(struct net_dm_drop_point));
+ __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
msg->points[msg->entries].count = 1;
@@ -170,6 +189,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
}
out:
+ rcu_read_unlock();
+ put_cpu_var(dm_cpu_data);
return;
}
--
1.7.7.6
^ permalink raw reply related
* Re: [PATCH 2/2] drop_monitor: Make updating data->skb smp safe
From: Eric Dumazet @ 2012-04-26 19:00 UTC (permalink / raw)
To: Neil Horman; +Cc: netdev, David Miller
In-Reply-To: <1335466022-32661-3-git-send-email-nhorman@tuxdriver.com>
On Thu, 2012-04-26 at 14:47 -0400, Neil Horman wrote:
> Eric Dumazet pointed out to me that the drop_monitor protocol has some holes in
> its smp protections. Specifically, its possible to replace data->skb while its
> being written. This patch corrects that by making data->skb and rcu protected
> variable. That will prevent it from being overwritten while a tracepoint is
> modifying it.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: David Miller <davem@davemloft.net>
> ---
> net/core/drop_monitor.c | 43 ++++++++++++++++++++++++++++++++-----------
> 1 files changed, 32 insertions(+), 11 deletions(-)
>
Hi Neil
I believe more work is needed on this patch
> diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> index 04ce1dd..852e36b 100644
> --- a/net/core/drop_monitor.c
> +++ b/net/core/drop_monitor.c
> @@ -46,7 +46,7 @@ static DEFINE_MUTEX(trace_state_lock);
>
> struct per_cpu_dm_data {
> struct work_struct dm_alert_work;
> - struct sk_buff *skb;
> + struct sk_buff __rcu *skb;
> atomic_t dm_hit_count;
> struct timer_list send_timer;
> };
> @@ -79,29 +79,41 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data)
> size_t al;
> struct net_dm_alert_msg *msg;
> struct nlattr *nla;
> + struct sk_buff *skb;
>
> al = sizeof(struct net_dm_alert_msg);
> al += dm_hit_limit * sizeof(struct net_dm_drop_point);
> al += sizeof(struct nlattr);
>
> - data->skb = genlmsg_new(al, GFP_KERNEL);
> - genlmsg_put(data->skb, 0, 0, &net_drop_monitor_family,
> + skb = genlmsg_new(al, GFP_KERNEL);
skb can be NULL here...
> + genlmsg_put(skb, 0, 0, &net_drop_monitor_family,
> 0, NET_DM_CMD_ALERT);
> - nla = nla_reserve(data->skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
> + nla = nla_reserve(skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
> msg = nla_data(nla);
> memset(msg, 0, al);
> +
> + /*
> + * Don't need to lock this, since we are guaranteed to only
> + * run this on a single cpu at a time
> + */
> + rcu_assign_pointer(data->skb, skb);
> +
> + synchronize_rcu();
> +
> atomic_set(&data->dm_hit_count, dm_hit_limit);
> }
>
> static void send_dm_alert(struct work_struct *unused)
> {
> struct sk_buff *skb;
> - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
>
> /*
> * Grab the skb we're about to send
> */
> - skb = data->skb;
> + rcu_read_lock();
> + skb = rcu_dereference(data->skb);
This protects nothing ...
> + rcu_read_unlock();
>
> /*
> * Replace it with a new one
> @@ -113,6 +125,7 @@ static void send_dm_alert(struct work_struct *unused)
> */
> genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
>
> + put_cpu_var(dm_cpu_data);
> }
>
> /*
> @@ -123,9 +136,11 @@ static void send_dm_alert(struct work_struct *unused)
> */
> static void sched_send_work(unsigned long unused)
> {
> - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
> +
> + schedule_work_on(smp_processor_id(), &data->dm_alert_work);
>
> - schedule_work(&data->dm_alert_work);
> + put_cpu_var(dm_cpu_data);
> }
>
> static void trace_drop_common(struct sk_buff *skb, void *location)
> @@ -134,9 +149,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> struct nlmsghdr *nlh;
> struct nlattr *nla;
> int i;
> - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> + struct sk_buff *dskb;
> + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
>
>
> + rcu_read_lock();
> + dskb = rcu_dereference(data->skb);
> +
dskb can be NULL here
> if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
> /*
> * we're already at zero, discard this hit
> @@ -144,7 +163,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> goto out;
> }
>
> - nlh = (struct nlmsghdr *)data->skb->data;
> + nlh = (struct nlmsghdr *)dskb->data;
> nla = genlmsg_data(nlmsg_data(nlh));
> msg = nla_data(nla);
> for (i = 0; i < msg->entries; i++) {
> @@ -158,7 +177,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> /*
> * We need to create a new entry
> */
> - __nla_reserve_nohdr(data->skb, sizeof(struct net_dm_drop_point));
> + __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
> nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
> memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
> msg->points[msg->entries].count = 1;
> @@ -170,6 +189,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> }
>
> out:
> + rcu_read_unlock();
> + put_cpu_var(dm_cpu_data);
> return;
> }
>
Thanks
^ permalink raw reply
* Re: [PATCH 1/2] drop_monitor: fix sleeping in invalid context warning
From: Eric Dumazet @ 2012-04-26 19:01 UTC (permalink / raw)
To: Neil Horman; +Cc: netdev, David Miller
In-Reply-To: <1335466022-32661-2-git-send-email-nhorman@tuxdriver.com>
On Thu, 2012-04-26 at 14:47 -0400, Neil Horman wrote:
> Eric Dumazet pointed out this warning in the drop_monitor protocol to me:
>
> [ 38.352571] BUG: sleeping function called from invalid context at kernel/mutex.c:85
> [ 38.352576] in_atomic(): 1, irqs_disabled(): 0, pid: 4415, name: dropwatch
> [ 38.352580] Pid: 4415, comm: dropwatch Not tainted 3.4.0-rc2+ #71
> [ 38.352582] Call Trace:
> [ 38.352592] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
> [ 38.352599] [<ffffffff81063f2a>] __might_sleep+0xca/0xf0
> [ 38.352606] [<ffffffff81655b16>] mutex_lock+0x26/0x50
> [ 38.352610] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
> [ 38.352616] [<ffffffff810b72d9>] tracepoint_probe_register+0x29/0x90
> [ 38.352621] [<ffffffff8153a585>] set_all_monitor_traces+0x105/0x170
> [ 38.352625] [<ffffffff8153a8ca>] net_dm_cmd_trace+0x2a/0x40
> [ 38.352630] [<ffffffff8154a81a>] genl_rcv_msg+0x21a/0x2b0
> [ 38.352636] [<ffffffff810f8029>] ? zone_statistics+0x99/0xc0
> [ 38.352640] [<ffffffff8154a600>] ? genl_rcv+0x30/0x30
> [ 38.352645] [<ffffffff8154a059>] netlink_rcv_skb+0xa9/0xd0
> [ 38.352649] [<ffffffff8154a5f0>] genl_rcv+0x20/0x30
> [ 38.352653] [<ffffffff81549a7e>] netlink_unicast+0x1ae/0x1f0
> [ 38.352658] [<ffffffff81549d76>] netlink_sendmsg+0x2b6/0x310
> [ 38.352663] [<ffffffff8150824f>] sock_sendmsg+0x10f/0x130
> [ 38.352668] [<ffffffff8150abe0>] ? move_addr_to_kernel+0x60/0xb0
> [ 38.352673] [<ffffffff81515f04>] ? verify_iovec+0x64/0xe0
> [ 38.352677] [<ffffffff81509c46>] __sys_sendmsg+0x386/0x390
> [ 38.352682] [<ffffffff810ffaf9>] ? handle_mm_fault+0x139/0x210
> [ 38.352687] [<ffffffff8165b5bc>] ? do_page_fault+0x1ec/0x4f0
> [ 38.352693] [<ffffffff8106ba4d>] ? set_next_entity+0x9d/0xb0
> [ 38.352699] [<ffffffff81310b49>] ? tty_ldisc_deref+0x9/0x10
> [ 38.352703] [<ffffffff8106d363>] ? pick_next_task_fair+0x63/0x140
> [ 38.352708] [<ffffffff8150b8d4>] sys_sendmsg+0x44/0x80
> [ 38.352713] [<ffffffff8165f8e2>] system_call_fastpath+0x16/0x1b
>
> It stems from holding a spinlock (trace_state_lock) while attempting to register
> or unregister tracepoint hooks, making in_atomic() true in this context, leading
> to the warning when the tracepoint calls might_sleep() while its taking a mutex.
> Since we only use the trace_state_lock to prevent trace protocol state races, as
> well as hardware stat list updates on an rcu write side, we can just convert the
> spinlock to a mutex to avoid this problem.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: David Miller <davem@davemloft.net>
> ---
> net/core/drop_monitor.c | 14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> index 5c3c81a..04ce1dd 100644
> --- a/net/core/drop_monitor.c
> +++ b/net/core/drop_monitor.c
> @@ -42,7 +42,7 @@ static void send_dm_alert(struct work_struct *unused);
> * netlink alerts
> */
> static int trace_state = TRACE_OFF;
> -static DEFINE_SPINLOCK(trace_state_lock);
> +static DEFINE_MUTEX(trace_state_lock);
Maybe rename it to trace_state_mutex ?
^ permalink raw reply
* Re: [PATCH 2/2] drop_monitor: Make updating data->skb smp safe
From: Neil Horman @ 2012-04-26 19:18 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, David Miller
In-Reply-To: <1335466809.2775.59.camel@edumazet-glaptop>
On Thu, Apr 26, 2012 at 09:00:09PM +0200, Eric Dumazet wrote:
> On Thu, 2012-04-26 at 14:47 -0400, Neil Horman wrote:
> > Eric Dumazet pointed out to me that the drop_monitor protocol has some holes in
> > its smp protections. Specifically, its possible to replace data->skb while its
> > being written. This patch corrects that by making data->skb and rcu protected
> > variable. That will prevent it from being overwritten while a tracepoint is
> > modifying it.
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> > CC: David Miller <davem@davemloft.net>
> > ---
> > net/core/drop_monitor.c | 43 ++++++++++++++++++++++++++++++++-----------
> > 1 files changed, 32 insertions(+), 11 deletions(-)
> >
>
> Hi Neil
>
> I believe more work is needed on this patch
>
> > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> > index 04ce1dd..852e36b 100644
> > --- a/net/core/drop_monitor.c
> > +++ b/net/core/drop_monitor.c
> > @@ -46,7 +46,7 @@ static DEFINE_MUTEX(trace_state_lock);
> >
> > struct per_cpu_dm_data {
> > struct work_struct dm_alert_work;
> > - struct sk_buff *skb;
> > + struct sk_buff __rcu *skb;
> > atomic_t dm_hit_count;
> > struct timer_list send_timer;
> > };
> > @@ -79,29 +79,41 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data)
> > size_t al;
> > struct net_dm_alert_msg *msg;
> > struct nlattr *nla;
> > + struct sk_buff *skb;
> >
> > al = sizeof(struct net_dm_alert_msg);
> > al += dm_hit_limit * sizeof(struct net_dm_drop_point);
> > al += sizeof(struct nlattr);
> >
> > - data->skb = genlmsg_new(al, GFP_KERNEL);
> > - genlmsg_put(data->skb, 0, 0, &net_drop_monitor_family,
> > + skb = genlmsg_new(al, GFP_KERNEL);
>
> skb can be NULL here...
>
Good point, I'll add NULL checks
> > + genlmsg_put(skb, 0, 0, &net_drop_monitor_family,
> > 0, NET_DM_CMD_ALERT);
> > - nla = nla_reserve(data->skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
> > + nla = nla_reserve(skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
> > msg = nla_data(nla);
> > memset(msg, 0, al);
> > +
> > + /*
> > + * Don't need to lock this, since we are guaranteed to only
> > + * run this on a single cpu at a time
> > + */
> > + rcu_assign_pointer(data->skb, skb);
> > +
> > + synchronize_rcu();
> > +
> > atomic_set(&data->dm_hit_count, dm_hit_limit);
> > }
> >
> > static void send_dm_alert(struct work_struct *unused)
> > {
> > struct sk_buff *skb;
> > - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> > + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
> >
> > /*
> > * Grab the skb we're about to send
> > */
> > - skb = data->skb;
> > + rcu_read_lock();
> > + skb = rcu_dereference(data->skb);
>
> This protects nothing ...
>
Hmm, it doesn't really need to be protected either, I just added the read_lock
to prevent any rcu_dereference from complaining about not holding the
rcu_read_lock, but as I'm typing this, it occurs to me that that would make
rcu_dereference_protected the call to use here. Thanks for kick starting me on
that.
> > + rcu_read_unlock();
> >
>
>
>
> > /*
> > * Replace it with a new one
> > @@ -113,6 +125,7 @@ static void send_dm_alert(struct work_struct *unused)
> > */
> > genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
> >
> > + put_cpu_var(dm_cpu_data);
> > }
> >
> > /*
> > @@ -123,9 +136,11 @@ static void send_dm_alert(struct work_struct *unused)
> > */
> > static void sched_send_work(unsigned long unused)
> > {
> > - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> > + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
> > +
> > + schedule_work_on(smp_processor_id(), &data->dm_alert_work);
> >
> > - schedule_work(&data->dm_alert_work);
> > + put_cpu_var(dm_cpu_data);
> > }
> >
> > static void trace_drop_common(struct sk_buff *skb, void *location)
> > @@ -134,9 +149,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> > struct nlmsghdr *nlh;
> > struct nlattr *nla;
> > int i;
> > - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> > + struct sk_buff *dskb;
> > + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
> >
> >
> > + rcu_read_lock();
> > + dskb = rcu_dereference(data->skb);
> > +
>
> dskb can be NULL here
>
ACK, I'll check that
> > if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
> > /*
> > * we're already at zero, discard this hit
> > @@ -144,7 +163,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> > goto out;
> > }
> >
> > - nlh = (struct nlmsghdr *)data->skb->data;
> > + nlh = (struct nlmsghdr *)dskb->data;
> > nla = genlmsg_data(nlmsg_data(nlh));
> > msg = nla_data(nla);
> > for (i = 0; i < msg->entries; i++) {
> > @@ -158,7 +177,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> > /*
> > * We need to create a new entry
> > */
> > - __nla_reserve_nohdr(data->skb, sizeof(struct net_dm_drop_point));
> > + __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
> > nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
> > memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
> > msg->points[msg->entries].count = 1;
> > @@ -170,6 +189,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> > }
> >
> > out:
> > + rcu_read_unlock();
> > + put_cpu_var(dm_cpu_data);
> > return;
> > }
> >
>
> Thanks
>
>
>
^ permalink raw reply
* Re: [PATCH 1/2] drop_monitor: fix sleeping in invalid context warning
From: Neil Horman @ 2012-04-26 19:21 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, David Miller
In-Reply-To: <1335466889.2775.60.camel@edumazet-glaptop>
On Thu, Apr 26, 2012 at 09:01:29PM +0200, Eric Dumazet wrote:
> On Thu, 2012-04-26 at 14:47 -0400, Neil Horman wrote:
> > Eric Dumazet pointed out this warning in the drop_monitor protocol to me:
> >
> > [ 38.352571] BUG: sleeping function called from invalid context at kernel/mutex.c:85
> > [ 38.352576] in_atomic(): 1, irqs_disabled(): 0, pid: 4415, name: dropwatch
> > [ 38.352580] Pid: 4415, comm: dropwatch Not tainted 3.4.0-rc2+ #71
> > [ 38.352582] Call Trace:
> > [ 38.352592] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
> > [ 38.352599] [<ffffffff81063f2a>] __might_sleep+0xca/0xf0
> > [ 38.352606] [<ffffffff81655b16>] mutex_lock+0x26/0x50
> > [ 38.352610] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
> > [ 38.352616] [<ffffffff810b72d9>] tracepoint_probe_register+0x29/0x90
> > [ 38.352621] [<ffffffff8153a585>] set_all_monitor_traces+0x105/0x170
> > [ 38.352625] [<ffffffff8153a8ca>] net_dm_cmd_trace+0x2a/0x40
> > [ 38.352630] [<ffffffff8154a81a>] genl_rcv_msg+0x21a/0x2b0
> > [ 38.352636] [<ffffffff810f8029>] ? zone_statistics+0x99/0xc0
> > [ 38.352640] [<ffffffff8154a600>] ? genl_rcv+0x30/0x30
> > [ 38.352645] [<ffffffff8154a059>] netlink_rcv_skb+0xa9/0xd0
> > [ 38.352649] [<ffffffff8154a5f0>] genl_rcv+0x20/0x30
> > [ 38.352653] [<ffffffff81549a7e>] netlink_unicast+0x1ae/0x1f0
> > [ 38.352658] [<ffffffff81549d76>] netlink_sendmsg+0x2b6/0x310
> > [ 38.352663] [<ffffffff8150824f>] sock_sendmsg+0x10f/0x130
> > [ 38.352668] [<ffffffff8150abe0>] ? move_addr_to_kernel+0x60/0xb0
> > [ 38.352673] [<ffffffff81515f04>] ? verify_iovec+0x64/0xe0
> > [ 38.352677] [<ffffffff81509c46>] __sys_sendmsg+0x386/0x390
> > [ 38.352682] [<ffffffff810ffaf9>] ? handle_mm_fault+0x139/0x210
> > [ 38.352687] [<ffffffff8165b5bc>] ? do_page_fault+0x1ec/0x4f0
> > [ 38.352693] [<ffffffff8106ba4d>] ? set_next_entity+0x9d/0xb0
> > [ 38.352699] [<ffffffff81310b49>] ? tty_ldisc_deref+0x9/0x10
> > [ 38.352703] [<ffffffff8106d363>] ? pick_next_task_fair+0x63/0x140
> > [ 38.352708] [<ffffffff8150b8d4>] sys_sendmsg+0x44/0x80
> > [ 38.352713] [<ffffffff8165f8e2>] system_call_fastpath+0x16/0x1b
> >
> > It stems from holding a spinlock (trace_state_lock) while attempting to register
> > or unregister tracepoint hooks, making in_atomic() true in this context, leading
> > to the warning when the tracepoint calls might_sleep() while its taking a mutex.
> > Since we only use the trace_state_lock to prevent trace protocol state races, as
> > well as hardware stat list updates on an rcu write side, we can just convert the
> > spinlock to a mutex to avoid this problem.
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> > CC: David Miller <davem@davemloft.net>
> > ---
> > net/core/drop_monitor.c | 14 +++++++-------
> > 1 files changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> > index 5c3c81a..04ce1dd 100644
> > --- a/net/core/drop_monitor.c
> > +++ b/net/core/drop_monitor.c
> > @@ -42,7 +42,7 @@ static void send_dm_alert(struct work_struct *unused);
> > * netlink alerts
> > */
> > static int trace_state = TRACE_OFF;
> > -static DEFINE_SPINLOCK(trace_state_lock);
> > +static DEFINE_MUTEX(trace_state_lock);
>
> Maybe rename it to trace_state_mutex ?
>
ACK, no problem
>
>
^ permalink raw reply
* Re: [PATCH 2/2] drop_monitor: Make updating data->skb smp safe
From: Eric Dumazet @ 2012-04-26 19:25 UTC (permalink / raw)
To: Neil Horman; +Cc: netdev, David Miller
In-Reply-To: <20120426191849.GA26072@hmsreliant.think-freely.org>
On Thu, 2012-04-26 at 15:18 -0400, Neil Horman wrote:
> On Thu, Apr 26, 2012 at 09:00:09PM +0200, Eric Dumazet wrote:
> > > * Grab the skb we're about to send
> > > */
> > > - skb = data->skb;
> > > + rcu_read_lock();
> > > + skb = rcu_dereference(data->skb);
> >
> > This protects nothing ...
> >
> Hmm, it doesn't really need to be protected either, I just added the read_lock
> to prevent any rcu_dereference from complaining about not holding the
> rcu_read_lock, but as I'm typing this, it occurs to me that that would make
> rcu_dereference_protected the call to use here. Thanks for kick starting me on
> that.
perfect ;)
^ permalink raw reply
* RE: wireless: mwifiex: initial commit for Marvell mwifiex driver
From: Bing Zhao @ 2012-04-26 19:25 UTC (permalink / raw)
To: Dan Carpenter; +Cc: netdev@vger.kernel.org
In-Reply-To: <20120426125102.GA14808@mwanda>
Hi Dan,
> On Wed, Apr 25, 2012 at 03:08:33PM -0700, Bing Zhao wrote:
> > > ->oui is only a 3 byte array so we're reading past the end for this
> > > comparison.
> >
> > I will fix the misuse of memcmp's.
> >
>
> So it wasn't really a bug right? Just a bit confusing.
That's right. I will submit a patch to fix the confusion.
>
> > By the way, could you please share with me how you check for this kind of errors?
> > Is it coccinelle? I tried with coccicheck but got "spatch.opt unknown option -D" error.
> >
>
> This was from a Smatch check that I haven't pushed yet.
Are you going to push it soon? I'm eager to use it checking my code.
Thanks,
Bing
>
> regards,
> dan carpenter
^ permalink raw reply
* pull request: wireless-next 2012-04-26
From: John W. Linville @ 2012-04-26 19:34 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120425191418.GC16900-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 14582 bytes --]
commit d9b8ae6bd8c3304569a25079fcdbebaa28a48ee4
(This is the same as yesterday's request, but with the libertas
sched.h patch from Luis dropped.)
Dave,
This is another batch of updates intended for 3.5...
Nothing too special this round -- highlights include some iwlwifi
refactoring, some ath9k refactoring, some rtlwifi refactoring, and
some mac80211 mesh refactoring. It must be Springtime! Along with
all the refactoring, there is the usual variety of random tweaks here
and there in the wireless stack.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 872f24dbc604ef585ea7eec73020dcdfaffd1956:
tipc: remove inline instances from C source files. (2012-04-24 00:41:03 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git for-davem
Amitkumar Karwar (1):
mwifiex: add support for Marvell USB8797 chipset
Andrei Emeltchenko (1):
mac80211: Adds clean sdata helper
Anisse Astier (2):
rt2800: debugfs register access: BBP is 256 bytes big
rt2800: add chipset revision RT5390R support
Bala Shanmugam (1):
cfg80211: Validate legacy rateset.
Ben Greear (2):
mac80211: Support on-channel scan option.
ath9k: Fix compile warnings when DEBUGFS is disabled.
Daniel Drake (1):
libertas CS: convert to asynchronous firmware loading
David Spinadel (4):
iwlwifi: Change disable calibration bit-set to enum
iwlwifi: Added foreward declaration for iwl_cfg in op_mode
iwlwifi: Remove inconsistent and redundant declaration
iwlwifi: Added debugfs calib disabled write
Don Fry (1):
iwlwifi: revert workaround to restore 1000 rx throughput
Emmanuel Grumbach (16):
iwlwifi: kill shrd->drv, driver points to transport
iwlwifi: op_mode holds its pointer to the transport
iwlwifi: op_mode holds its pointer to the config
iwlwifi: driver holds its pointer to the config
iwlwifi: transport holds its pointer to the config
iwlwifi: driver holds its pointer to the transport
iwlwifi: don't use shared for the logger any more
iwlwifi: remove the shared area
iwlwifi: remove unneeded includes
iwlwifi: split between AGG_ON and AGG_STARTING
iwlwifi: move iwl_rxon_context_id to user
iwlwifi: make a static inline to read the RF kill register
iwlwifi: first enable RF kill interrupt, then check register
iwlwifi: enable RF kill interrupt in start_hw
iwlwifi: check RF kill register when interrupts have been disabled
iwlwifi: provide proper API to disable all interrupts
Felix Fietkau (12):
ath9k: add possible wiphy interface combinations
libertas: add missing include
ath9k_hw: use standard SIFS time as reference for half/quarter channels
ath9k_hw: increase ACK timeout for half/quarter channels
ath9k_hw: set the PHY mode for half/quarter channels on AR9003
ath9k_hw: increase symbol overlap window for half/quarter channels
ath9k_hw: fix and clean up PHY activation delay
ath9k_hw: disable Tx IQ calibration on half/quarter channels
ath9k_hw: disable fast channel change when changing from/to half/quarter mode
ath9k_hw: increase tx abort timeout for half/quarter channels
mac80211: rename AP variable num_sta_authorized to num_mcast_sta
mac80211: fix num_mcast_sta counting issues
Gabor Juhos (1):
ath9k: fix TX power reporting on AR9003 chips
Helmut Schaa (1):
rt2x00: Use GFP_KERNEL for rx buffer allocation on USB devices
Javier Cardona (1):
mac80211: fixup for mesh TSF adjustment latency in Toffset setpoint
Johannes Berg (22):
iwlwifi: improve TX cache footprint
iwlwifi: properly set basic rates
iwlwifi: remove debugfs logspam
iwlwifi: move debugfs registration function declarations
iwlwifi: move iwl_have_debug_level
iwlwifi: clean up iwl-shared.h includes
iwlwifi: remove bt_siso_mode declaration
iwlwifi: move TIME_UNIT
iwlwifi: move iwl_cmd_echo_test
iwlwifi: remove traffic log
iwlwifi: remove TX/RX frame statistics
iwlwifi: remove duplicate iwlagn_mod_params declaration
iwlwifi: move driver defines to iwl-drv.h
iwlwifi: move PLCP defines to config
iwlwifi: move watchdog definitions to config
iwlwifi: move eeprom versions to HW files
iwlwifi: move antenna definitions to config
iwlwifi: move OTP defines
iwlwifi: clean up some hw file includes
iwlwifi: use direct calls for transport free
iwlwifi: clean up module parameters
iwlwifi: use new mac80211 queue scheme
John W. Linville (1):
Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem
Larry Finger (6):
rtlwifi: Move dig_t and ps_t structs
rtlwifi: Add dm structs to private structure
rtlwifi: rtl8192c: Convert driver to use private dm structs
rtlwifi: rtl8192c: Convert driver to use private ps_t struct
rtlwifi: rtl8192de: Convert driver to use private dm structs
rtlwifi: rtl8192se: Convert driver to use private dm struct
Michael Liang (1):
ath9k: don't strip mic on non-encrypted frames in tkip
Rajkumar Manoharan (2):
ath9k: simplify beacon configuration for beaconing vifs
ath9k_hw: remove ATH_BTCOEX_CFG_MCI
Sujith Manoharan (1):
ath9k: Fix IDLE Powersave
Thomas Pedersen (4):
mac80211: refactor mesh peer initialization
mac80211: refactor mesh peer rate handling
mac80211: don't set mesh peer ht caps if ht disabled
mac80211: fix STA channel width field
Wey-Yi Guy (3):
mac80211: declare ieee80211_ave_rssi as EXPORT
iwlwifi: include net/mac80211.h to avoid compiler error
mac80211: check for non-managed interface
Xose Vazquez Perez (2):
wireless: rt2x00: rt2800usb add more devices ids
wireless: rt2x00: rt2800usb more devices were identified
Zefir Kurtisi (2):
ath9k: make DFS detector pools SMP safe
ath9k: extend DFS detector stats in dfs_debugfs
drivers/net/wireless/ath/ath9k/ar5008_phy.c | 17 +-
drivers/net/wireless/ath/ath9k/ar9003_calib.c | 10 +-
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 64 +-
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 28 +-
drivers/net/wireless/ath/ath9k/ar9003_phy.h | 3 +
drivers/net/wireless/ath/ath9k/beacon.c | 4 +-
drivers/net/wireless/ath/ath9k/btcoex.c | 14 +-
drivers/net/wireless/ath/ath9k/btcoex.h | 1 -
drivers/net/wireless/ath/ath9k/dfs.c | 4 +
drivers/net/wireless/ath/ath9k/dfs_debug.c | 46 +
drivers/net/wireless/ath/ath9k/dfs_debug.h | 45 +-
drivers/net/wireless/ath/ath9k/dfs_pri_detector.c | 130 ++-
drivers/net/wireless/ath/ath9k/gpio.c | 21 +-
drivers/net/wireless/ath/ath9k/hw.c | 42 +-
drivers/net/wireless/ath/ath9k/hw.h | 5 +-
drivers/net/wireless/ath/ath9k/init.c | 21 +
drivers/net/wireless/ath/ath9k/mac.c | 10 +-
drivers/net/wireless/ath/ath9k/main.c | 105 +--
drivers/net/wireless/ath/ath9k/recv.c | 3 +-
drivers/net/wireless/iwlwifi/Makefile | 2 +-
drivers/net/wireless/iwlwifi/iwl-1000.c | 8 +-
drivers/net/wireless/iwlwifi/iwl-2000.c | 8 +-
drivers/net/wireless/iwlwifi/iwl-5000.c | 9 +-
drivers/net/wireless/iwlwifi/iwl-6000.c | 17 +-
drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 9 +-
drivers/net/wireless/iwlwifi/iwl-agn-calib.h | 1 -
drivers/net/wireless/iwlwifi/iwl-agn-devices.c | 25 +-
drivers/net/wireless/iwlwifi/iwl-agn-hw.h | 11 +
drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 42 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 12 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.h | 36 +-
drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 22 +-
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 128 ++-
drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 1 -
drivers/net/wireless/iwlwifi/iwl-agn-tt.c | 18 +-
drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 61 +-
drivers/net/wireless/iwlwifi/iwl-agn.c | 308 ++----
drivers/net/wireless/iwlwifi/iwl-agn.h | 26 +-
drivers/net/wireless/iwlwifi/iwl-config.h | 28 +
drivers/net/wireless/iwlwifi/iwl-core.c | 297 ------
drivers/net/wireless/iwlwifi/iwl-core.h | 133 ---
drivers/net/wireless/iwlwifi/iwl-debug.c | 1 +
drivers/net/wireless/iwlwifi/iwl-debug.h | 34 +-
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 309 ++-----
drivers/net/wireless/iwlwifi/iwl-dev.h | 99 +--
drivers/net/wireless/iwlwifi/iwl-drv.c | 151 +++-
drivers/net/wireless/iwlwifi/iwl-drv.h | 25 +-
drivers/net/wireless/iwlwifi/iwl-eeprom.c | 64 +-
drivers/net/wireless/iwlwifi/iwl-eeprom.h | 53 -
drivers/net/wireless/iwlwifi/iwl-fw.h | 1 +
drivers/net/wireless/iwlwifi/iwl-io.h | 1 -
drivers/net/wireless/iwlwifi/iwl-led.c | 21 +-
drivers/net/wireless/iwlwifi/iwl-mac80211.c | 88 +-
.../iwlwifi/{iwl-shared.h => iwl-modparams.h} | 78 +--
drivers/net/wireless/iwlwifi/iwl-op-mode.h | 2 +
drivers/net/wireless/iwlwifi/iwl-pci.c | 60 +-
drivers/net/wireless/iwlwifi/iwl-phy-db.c | 5 +-
drivers/net/wireless/iwlwifi/iwl-phy-db.h | 4 +-
drivers/net/wireless/iwlwifi/iwl-power.c | 19 +-
drivers/net/wireless/iwlwifi/iwl-power.h | 9 -
drivers/net/wireless/iwlwifi/iwl-scan.c | 13 +-
drivers/net/wireless/iwlwifi/iwl-testmode.c | 27 +-
drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | 43 +-
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 11 +-
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 35 +-
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 184 ++--
drivers/net/wireless/iwlwifi/iwl-trans.h | 49 +-
drivers/net/wireless/iwlwifi/iwl-ucode.c | 25 +-
drivers/net/wireless/libertas/firmware.c | 1 +
drivers/net/wireless/libertas/if_cs.c | 88 +-
drivers/net/wireless/mwifiex/11n_aggr.c | 36 +-
drivers/net/wireless/mwifiex/Kconfig | 11 +
drivers/net/wireless/mwifiex/Makefile | 3 +
drivers/net/wireless/mwifiex/cmdevt.c | 63 +-
drivers/net/wireless/mwifiex/decl.h | 1 +
drivers/net/wireless/mwifiex/fw.h | 5 +
drivers/net/wireless/mwifiex/init.c | 64 +-
drivers/net/wireless/mwifiex/main.c | 26 +-
drivers/net/wireless/mwifiex/main.h | 20 +-
drivers/net/wireless/mwifiex/sta_cmd.c | 2 +-
drivers/net/wireless/mwifiex/sta_rx.c | 15 +-
drivers/net/wireless/mwifiex/sta_tx.c | 12 +-
drivers/net/wireless/mwifiex/txrx.c | 21 +-
drivers/net/wireless/mwifiex/usb.c | 1052 ++++++++++++++++++++
drivers/net/wireless/mwifiex/usb.h | 99 ++
drivers/net/wireless/mwifiex/util.c | 22 +
drivers/net/wireless/mwifiex/wmm.c | 18 +-
drivers/net/wireless/rt2x00/rt2800.h | 3 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 12 +
drivers/net/wireless/rt2x00/rt2800usb.c | 25 +-
drivers/net/wireless/rt2x00/rt2x00.h | 2 +-
drivers/net/wireless/rt2x00/rt2x00dev.c | 4 +-
drivers/net/wireless/rt2x00/rt2x00lib.h | 2 +-
drivers/net/wireless/rt2x00/rt2x00pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2x00queue.c | 6 +-
drivers/net/wireless/rt2x00/rt2x00usb.c | 2 +-
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 290 +++---
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h | 35 -
drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192ce/dm.h | 35 -
drivers/net/wireless/rtlwifi/rtl8192de/dm.c | 185 ++--
drivers/net/wireless/rtlwifi/rtl8192de/dm.h | 51 -
drivers/net/wireless/rtlwifi/rtl8192de/phy.c | 7 +-
drivers/net/wireless/rtlwifi/rtl8192se/dm.c | 156 ++--
drivers/net/wireless/rtlwifi/rtl8192se/dm.h | 44 -
drivers/net/wireless/rtlwifi/rtl8192se/phy.c | 7 +-
drivers/net/wireless/rtlwifi/wifi.h | 63 ++
include/net/mac80211.h | 8 +
net/mac80211/cfg.c | 19 +
net/mac80211/debugfs_netdev.c | 4 +-
net/mac80211/ieee80211_i.h | 5 +-
net/mac80211/iface.c | 19 +-
net/mac80211/main.c | 4 +-
net/mac80211/mesh.c | 19 +-
net/mac80211/mesh.h | 14 +-
net/mac80211/mesh_plink.c | 138 ++--
net/mac80211/mesh_sync.c | 2 +-
net/mac80211/rx.c | 2 +
net/mac80211/scan.c | 95 ++-
net/mac80211/sta_info.c | 12 +-
net/mac80211/tx.c | 2 +-
net/mac80211/util.c | 9 +-
net/wireless/nl80211.c | 3 +
123 files changed, 3467 insertions(+), 2565 deletions(-)
delete mode 100644 drivers/net/wireless/iwlwifi/iwl-core.c
delete mode 100644 drivers/net/wireless/iwlwifi/iwl-core.h
rename drivers/net/wireless/iwlwifi/{iwl-shared.h => iwl-modparams.h} (66%)
create mode 100644 drivers/net/wireless/mwifiex/usb.c
create mode 100644 drivers/net/wireless/mwifiex/usb.h
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH] net: smsc75xx: fix MDIO access
From: Stephane Fillod @ 2012-04-26 19:55 UTC (permalink / raw)
To: netdev; +Cc: steve.glendinning
* make MDIO read/write to work, the MII_ACCESS_BUSY bit was missing
to actually trigger the I/O. Rem: the smsc75xx is different from
the smsc95xx in that regard.
* fix PHY interrupt acknowledge, which needs a mdio_write
to clear PHY_INT_SRC instead of a usual read like in smsc95xx.
* fix bug in phy_init loop that was ignoring BMCR reset bit,
akin to smsc95xx's d946092000698fd204d82a9d239103c656fb63bf
* mark link down on startup and let PHY interrupt deal with carrier
changes, akin to 07d69d4238418746a7b85c5d05ec17c658a2a390
* declare the smsc75xx's MII as GMII capable
Tested on ARM/Omap3 with LAN7500-CEB.
Signed-off-by: Stephane Fillod <fillods@users.sf.net>
Cc: Steve Glendinning <steve.glendinning@shawell.net>
---
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -32,7 +32,7 @@
#include "smsc75xx.h"
#define SMSC_CHIPNAME "smsc75xx"
-#define SMSC_DRIVER_VERSION "1.0.0"
+#define SMSC_DRIVER_VERSION "1.1.0"
#define HS_USB_PKT_SIZE (512)
#define FS_USB_PKT_SIZE (64)
#define DEFAULT_HS_BURST_CAP_SIZE (16 * 1024 + 5 * HS_USB_PKT_SIZE)
@@ -98,7 +98,7 @@ static int __must_check smsc75xx_read_re
if (unlikely(ret < 0))
netdev_warn(dev->net,
- "Failed to read register index 0x%08x", index);
+ "Failed to read register index 0x%08x: %d", index, ret);
le32_to_cpus(buf);
*data = *buf;
@@ -128,7 +128,7 @@ static int __must_check smsc75xx_write_r
if (unlikely(ret < 0))
netdev_warn(dev->net,
- "Failed to write register index 0x%08x", index);
+ "Failed to write register index 0x%08x: %d", index, ret);
kfree(buf);
@@ -171,7 +171,7 @@ static int smsc75xx_mdio_read(struct net
idx &= dev->mii.reg_num_mask;
addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
| ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
- | MII_ACCESS_READ;
+ | MII_ACCESS_READ | MII_ACCESS_BUSY;
ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
check_warn_goto_done(ret, "Error writing MII_ACCESS");
@@ -185,6 +185,8 @@ static int smsc75xx_mdio_read(struct net
done:
mutex_unlock(&dev->phy_mutex);
+ netif_dbg(dev, drv, dev->net, "%s: id %x, idx %d, val=%04x",
+ __func__, phy_id, idx, ret);
return ret;
}
@@ -195,6 +197,9 @@ static void smsc75xx_mdio_write(struct n
u32 val, addr;
int ret;
+ netif_dbg(dev, drv, dev->net, "%s: id %x, idx %d, val=%04x",
+ __func__, phy_id, idx, regval);
+
mutex_lock(&dev->phy_mutex);
/* confirm MII not busy */
@@ -210,7 +215,7 @@ static void smsc75xx_mdio_write(struct n
idx &= dev->mii.reg_num_mask;
addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
| ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
- | MII_ACCESS_WRITE;
+ | MII_ACCESS_WRITE | MII_ACCESS_BUSY;
ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
check_warn_goto_done(ret, "Error writing MII_ACCESS");
@@ -511,7 +516,11 @@ static int smsc75xx_link_reset(struct us
/* clear interrupt status */
ret = smsc75xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC);
check_warn_return(ret, "Error reading PHY_INT_SRC");
+ smsc75xx_mdio_write(dev->net, mii->phy_id, PHY_INT_SRC, 0xffff);
+ if (!ret)
+ netif_dbg(dev, link, dev->net, "%s: spurious interrupt", __func__);
+
ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL);
check_warn_return(ret, "Error writing INT_STS");
@@ -643,7 +643,8 @@ static int smsc75xx_phy_initialize(struc
static int smsc75xx_phy_initialize(struct usbnet *dev)
{
- int bmcr, timeout = 0;
+ int bmcr, ret, timeout = 0;
+ u32 buf;
/* Initialize MII structure */
dev->mii.dev = dev->net;
@@ -651,17 +662,19 @@ static int smsc75xx_phy_initialize(struc
dev->mii.mdio_write = smsc75xx_mdio_write;
dev->mii.phy_id_mask = 0x1f;
dev->mii.reg_num_mask = 0x1f;
+ dev->mii.supports_gmii = 1;
dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID;
/* reset phy and wait for reset to complete */
- smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
+ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR,
+ BMCR_RESET | BMCR_ANENABLE);
do {
msleep(10);
bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
check_warn_return(bmcr, "Error reading MII_BMCR");
timeout++;
- } while ((bmcr & MII_BMCR) && (timeout < 100));
+ } while ((bmcr & BMCR_RESET) && (timeout < 100));
if (timeout >= 100) {
netdev_warn(dev->net, "timeout on PHY Reset");
@@ -671,10 +684,17 @@ static int smsc75xx_phy_initialize(struc
smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
ADVERTISE_PAUSE_ASYM);
+ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
+ ADVERTISE_1000FULL);
+ /* write to clear */
+ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_SRC, 0xffff);
+ ret = smsc75xx_read_reg(dev, MAC_CR, &buf);
+ check_warn_return(ret, "Failed to read MAC_CR: %d", ret);
+
+ buf |= (MAC_CR_ADD | MAC_CR_ASD);
+ ret = smsc75xx_write_reg(dev, MAC_CR, buf);
+ check_warn_return(ret, "Failed to write MAC_CR: %d", ret);
- /* read to clear */
- smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
- check_warn_return(bmcr, "Error reading PHY_INT_SRC");
smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK,
PHY_INT_MASK_DEFAULT);
@@ -1211,7 +1211,7 @@ static const struct driver_info smsc75xx
.rx_fixup = smsc75xx_rx_fixup,
.tx_fixup = smsc75xx_tx_fixup,
.status = smsc75xx_status,
- .flags = FLAG_ETHER | FLAG_SEND_ZLP,
+ .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
};
static const struct usb_device_id products[] = {
^ permalink raw reply
* Re: pull request: wireless-next 2012-04-26
From: David Miller @ 2012-04-26 20:06 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20120426193444.GI16900@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Thu, 26 Apr 2012 15:34:44 -0400
> This is another batch of updates intended for 3.5...
>
> Nothing too special this round -- highlights include some iwlwifi
> refactoring, some ath9k refactoring, some rtlwifi refactoring, and
> some mac80211 mesh refactoring. It must be Springtime! Along with
> all the refactoring, there is the usual variety of random tweaks here
> and there in the wireless stack.
>
> Please let me know if there are problems!
Pulled, thanks John.
^ permalink raw reply
* Re: [PATCH] b44: properly use pr_fmt()
From: David Miller @ 2012-04-26 20:07 UTC (permalink / raw)
To: mcgrof; +Cc: zambrano, netdev, linux-wireless, linux-bluetooth, arend, joe
In-Reply-To: <CAB=NE6VR6hPqoUmRH=YVr+MKu+Sn8tq2asv957zfD+SVWzk75A@mail.gmail.com>
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Date: Thu, 26 Apr 2012 08:53:30 -0700
> OK I found no pr_fmt warnings at all for make allmodconfig ; make V=1
> ; on v3.4-rc4. For this and others reason stated then yes, this patch
> is simply bogus.
This is what I expected, thanks for sorting this out :-)
We're in the rally!
^ permalink raw reply
* Re: [PATCH] IPVS: ip_vs_sync.c: local functions should not be exposed globally
From: Julian Anastasov @ 2012-04-26 20:11 UTC (permalink / raw)
To: H Hartley Sweeten; +Cc: Linux Kernel, netdev, David S. Miller, Simon Horman
In-Reply-To: <201204261129.53927.hartleys@visionengravers.com>
Hello,
On Thu, 26 Apr 2012, H Hartley Sweeten wrote:
> Functions not referenced outside of a source file should be marked
> static to prevent it from being exposed globally.
>
> This quiets the sparse warnings:
>
> warning: symbol 'ip_vs_sync_conn_v0' was not declared. Should it be static?
>
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: "David S. Miller" <davem@davemloft.net>
>
> ---
>
> diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
> index bf5e538..49a1fe8 100644
> --- a/net/netfilter/ipvs/ip_vs_sync.c
> +++ b/net/netfilter/ipvs/ip_vs_sync.c
> @@ -446,7 +446,7 @@ ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs)
> * Version 0 , could be switched in by sys_ctl.
> * Add an ip_vs_conn information into the current sync_buff.
> */
> -void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
> +static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
The 3 patches for IPVS look correct but this change
is already not needed after one of our planned changes:
"ipvs: reduce sync rate with time thresholds"
Not sure how we will avoid the collision, may be
Simon will take only the other 2 changes? Or David will
take all changes and we have to rebase?
> {
> struct netns_ipvs *ipvs = net_ipvs(net);
> struct ip_vs_sync_mesg_v0 *m;
> --
Regards
--
Julian Anastasov <ja@ssi.bg>
^ permalink raw reply
* Re: [RFC] allow skb->head to point/alias to first skb frag
From: David Miller @ 2012-04-26 20:12 UTC (permalink / raw)
To: eric.dumazet
Cc: maze, ilpo.jarvinen, rick.jones2, netdev, therbert, ncardwell,
ycheng
In-Reply-To: <1335448252.2775.41.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 26 Apr 2012 15:50:52 +0200
> Here is the raw patch. (tg3 part is dirty and needs some helpers)
>
> I am working on the TCP coalesce part, the splice() helpers (to avoid a
> copy), and split in five different patches for further
> discussion/inclusion.
Ok, I like it.
I was confused into thinking that you were going to put this head page
into skb_shared_info()'s page vector. But you're not.
^ permalink raw reply
* Re: [RFC] allow skb->head to point/alias to first skb frag
From: Eric Dumazet @ 2012-04-26 20:18 UTC (permalink / raw)
To: David Miller
Cc: maze, ilpo.jarvinen, rick.jones2, netdev, therbert, ncardwell,
ycheng
In-Reply-To: <20120426.161221.923108657396544878.davem@davemloft.net>
On Thu, 2012-04-26 at 16:12 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thu, 26 Apr 2012 15:50:52 +0200
>
> > Here is the raw patch. (tg3 part is dirty and needs some helpers)
> >
> > I am working on the TCP coalesce part, the splice() helpers (to avoid a
> > copy), and split in five different patches for further
> > discussion/inclusion.
>
> Ok, I like it.
>
> I was confused into thinking that you were going to put this head page
> into skb_shared_info()'s page vector. But you're not.
>
Well, my first mail was confuse... it was just an idea without prior
thinking. Now the picture is clear.
Thanks
^ permalink raw reply
* Re: [PATCH][RFC] bonding: delete migrated IP addresses from the rlb hash table
From: Jay Vosburgh @ 2012-04-26 20:18 UTC (permalink / raw)
To: Jiri Bohac; +Cc: Andy Gospodarek, netdev
In-Reply-To: <20120420185609.GB16028@midget.suse.cz>
Jiri Bohac <jbohac@suse.cz> wrote:
>I finally got back to this, sorry for such a long delay ...
>Start of this thread is here:
>http://thread.gmane.org/gmane.linux.network/222233
>
>On Wed, Mar 07, 2012 at 05:02:16PM +0100, Jiri Bohac wrote:
>> On Wed, Feb 29, 2012 at 06:12:20PM -0800, Jay Vosburgh wrote:
>> > I've done some initial testing with this, and so far I'm seeing
>> > one problem: every time the local host (with bonding) sends a broadcast
>> > ARP, that ends up flushing the entire RLB table. Well, all entries that
>> > match the IP on the bond that's sending an ARP request, which is just
>> > one address in my testing.
>> >
>> > Anyway, this happens because the switch forwards the broadcast
>> > ARP back around to one of the other bond slaves, and then that
>> > "incoming" ARP bears an ip_src of our already-in-use IP address, and
>> > that matches everything in the table.
>>
>> Good catch! I did not notice this.
>>
>> > Perhaps a check that the ip_src being flushed is not actually in
>> > use locally is warranted?
>>
>> This would not work for the setups where the bonding master is
>> bridget to some other network. I think it would be better to also
>> store the source (server) MAC address in struct client_info and
>> only flush the hash table entries if the MAC address from the
>> incoming APR packet and the source MAC address stored in the hash
>> table differ.
Just to make sure I understand: the additional check you propose
(beyond a check that the IP source address is not locally in use) is for
the purpose of minimizing unnecessary flushes, by insuring that the
address really has moved. Correct?
>> Updated patch follows (compile-tested only) I also
>> fixed the coding style problems you pointed out. As for the
>> forward/reverse naming, it's your call. Should I change it to
>> src/dst?
>
>I now thoroughly tested this updated patch in a real setup. It
>works as intended - it does not purge the entries when receiving the
>looped-back ARP requests. It correctly purges the offending
>entries when an ARP packet arrives with a its SRC IP address
>matching a SRC IP address in the table and having differrent MAC
>address -- exactly the case that would cause the ARP cache
>poisoning if not purged from the table.
>
>Jay, would you please consider applying this? Or do you want me
>to somehow rename the RLB table forward/reverse elements?
I'm going to give this a spin this afternoon, but just skimming
through it, I'm still not that thrilled about the "forward" and
"reverse" terminology applying to "hash by dst" and "hash by src"; why
not just call 'em "dst_next" and "src_next", et al, and cut out the
middle man?
-J
>Re-sending the fixed patch with the original description:
>
>------
>
>
>Bonding in balance-alb mode records information from ARP packets
>passing through the bond in a hash table (rx_hashtbl).
>
>At certain situations (e.g. link change of a slave),
>rlb_update_rx_clients() will send out ARP packets to update ARP
>caches of other hosts on the network to achieve RX load balancing.
>
>The problem is that once an IP address is recorded in the hash
>table, it stays there indefinitely. If this IP address is
>migrated to a different host in the network, bonding still sends
>out ARP packets that poison other systems' ARP caches with
>invalid information.
>
>This patch solves this by looking at all incoming ARP packets,
>and checking if the source IP address is one of the source
>addresses stored in the rx_hashtbl. If it is, the corresponding
>hash table entries are removed. Thus, when an IP address is
>migrated, the first ARP broadcast by its new owner will purge the
>offending entries of rx_hashtbl.
>
>The hash table is hashed by ip_dst. To be able to do the above
>check efficiently (not walking the whole hash table), we need a
>reverse mapping (by ip_src).
>
>I added three new members in struct rlb_client_info:
> rx_hashtbl[x].reverse_first will point to the start of a list of
> entries for which hash(ip_src) == x.
> The list is linked with reverse_next and reverse_prev.
>
>When an incoming ARP packet arrives at rlb_arp_recv()
>rlb_purge_src_ip() can quickly walk only the entries on the
>corresponding lists, i.e. the entries that are likely to contain
>the offending IP address.
>
>Signed-off-by: Jiri Bohac <jbohac@suse.cz>
>
>diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
>index f820b26..a938ab6 100644
>--- a/drivers/net/bonding/bond_alb.c
>+++ b/drivers/net/bonding/bond_alb.c
>@@ -84,6 +84,9 @@ static inline struct arp_pkt *arp_pkt(const struct sk_buff *skb)
>
> /* Forward declaration */
> static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]);
>+static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp);
>+static void rlb_delete_table_entry_reverse(struct bonding *bond, u32 index);
>+static void rlb_set_reverse_entry(struct bonding *bond, u32 ip_src_hash, u32 ip_dst_hash);
>
> static inline u8 _simple_hash(const u8 *hash_start, int hash_size)
> {
>@@ -366,6 +369,17 @@ static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
> return;
> }
>
>+ /* We received an ARP from arp->ip_src.
>+ * We might have used this IP address previously (on the bonding host
>+ * itself or on a system that is bridged together with the bond).
>+ * However, if arp->mac_src is different than what is stored in
>+ * rx_hashtbl, some other host is now using the IP and we must prevent
>+ * sending out client updates with this IP address as the source.
>+ * Clean up all hash table entries that have this address as ip_src but
>+ * have a dirrerent mac_src.
>+ */
>+ rlb_purge_src_ip(bond, arp);
>+
> if (arp->op_code == htons(ARPOP_REPLY)) {
> /* update rx hash table for this ARP */
> rlb_update_entry_from_arp(bond, arp);
>@@ -635,6 +649,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
> /* update mac address from arp */
> memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN);
> }
>+ memcpy(client_info->mac_src, arp->mac_src, ETH_ALEN);
>
> assigned_slave = client_info->slave;
> if (assigned_slave) {
>@@ -657,6 +672,13 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
> assigned_slave = rlb_next_rx_slave(bond);
>
> if (assigned_slave) {
>+ if (!(client_info->assigned && client_info->ip_src == arp->ip_src)) {
>+ /* ip_src is going to be updated, fix the reverse hashing */
>+ u32 hash_src = _simple_hash((u8 *)&arp->ip_src, sizeof(arp->ip_src));
>+ rlb_delete_table_entry_reverse(bond, hash_index);
>+ rlb_set_reverse_entry(bond, hash_src, hash_index);
>+ }
>+
> client_info->ip_src = arp->ip_src;
> client_info->ip_dst = arp->ip_dst;
> /* arp->mac_dst is broadcast for arp reqeusts.
>@@ -664,6 +686,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
> * upon receiving an arp reply.
> */
> memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN);
>+ memcpy(client_info->mac_src, arp->mac_src, ETH_ALEN);
> client_info->slave = assigned_slave;
>
> if (compare_ether_addr_64bits(client_info->mac_dst, mac_bcast)) {
>@@ -769,11 +792,109 @@ static void rlb_rebalance(struct bonding *bond)
> }
>
> /* Caller must hold rx_hashtbl lock */
>-static void rlb_init_table_entry(struct rlb_client_info *entry)
>+static void rlb_init_table_entry_forward(struct rlb_client_info *entry)
> {
>- memset(entry, 0, sizeof(struct rlb_client_info));
> entry->next = RLB_NULL_INDEX;
> entry->prev = RLB_NULL_INDEX;
>+ entry->assigned = 0;
>+ entry->slave = NULL;
>+ entry->tag = 0;
>+}
>+static void rlb_init_table_entry_reverse(struct rlb_client_info *entry)
>+{
>+ entry->reverse_first = RLB_NULL_INDEX;
>+ entry->reverse_prev = RLB_NULL_INDEX;
>+ entry->reverse_next = RLB_NULL_INDEX;
>+}
>+
>+static void rlb_init_table_entry(struct rlb_client_info *entry)
>+{
>+ memset(entry, 0, sizeof(struct rlb_client_info));
>+ rlb_init_table_entry_forward(entry);
>+ rlb_init_table_entry_reverse(entry);
>+}
>+
>+static void rlb_delete_table_entry_forward(struct bonding *bond, u32 index)
>+{
>+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
>+ u32 next_index = bond_info->rx_hashtbl[index].next;
>+ u32 prev_index = bond_info->rx_hashtbl[index].prev;
>+
>+ if (index == bond_info->rx_hashtbl_head)
>+ bond_info->rx_hashtbl_head = next_index;
>+ if (prev_index != RLB_NULL_INDEX)
>+ bond_info->rx_hashtbl[prev_index].next = next_index;
>+ if (next_index != RLB_NULL_INDEX)
>+ bond_info->rx_hashtbl[next_index].prev = prev_index;
>+}
>+
>+static void rlb_delete_table_entry_reverse(struct bonding *bond, u32 index)
>+{
>+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
>+ u32 next_index = bond_info->rx_hashtbl[index].reverse_next;
>+ u32 prev_index = bond_info->rx_hashtbl[index].reverse_prev;
>+
>+ bond_info->rx_hashtbl[index].reverse_next = RLB_NULL_INDEX;
>+ bond_info->rx_hashtbl[index].reverse_prev = RLB_NULL_INDEX;
>+
>+ if (next_index != RLB_NULL_INDEX)
>+ bond_info->rx_hashtbl[next_index].reverse_prev = prev_index;
>+
>+ if (prev_index == RLB_NULL_INDEX)
>+ return;
>+
>+ /* is prev_index pointing to the head of this chain? */
>+ if (bond_info->rx_hashtbl[prev_index].reverse_first == index)
>+ bond_info->rx_hashtbl[prev_index].reverse_first = next_index;
>+ else
>+ bond_info->rx_hashtbl[prev_index].reverse_next = next_index;
>+
>+}
>+
>+static void rlb_delete_table_entry(struct bonding *bond, u32 index)
>+{
>+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
>+ struct rlb_client_info *entry = &(bond_info->rx_hashtbl[index]);
>+
>+ rlb_delete_table_entry_forward(bond, index);
>+ rlb_init_table_entry_forward(entry);
>+
>+ rlb_delete_table_entry_reverse(bond, index);
>+}
>+
>+static void rlb_set_reverse_entry(struct bonding *bond, u32 ip_src_hash, u32 ip_dst_hash)
>+{
>+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
>+ u32 next;
>+
>+ bond_info->rx_hashtbl[ip_dst_hash].reverse_prev = ip_src_hash;
>+ next = bond_info->rx_hashtbl[ip_src_hash].reverse_first;
>+ bond_info->rx_hashtbl[ip_dst_hash].reverse_next = next;
>+ if (next != RLB_NULL_INDEX)
>+ bond_info->rx_hashtbl[next].reverse_prev = ip_dst_hash;
>+ bond_info->rx_hashtbl[ip_src_hash].reverse_first = ip_dst_hash;
>+}
>+
>+/* deletes all rx_hashtbl entries with arp->ip_src if their mac_src does
>+ * not match arp->mac_src */
>+static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp)
>+{
>+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
>+ u32 ip_src_hash = _simple_hash((u8*)&(arp->ip_src), sizeof(arp->ip_src));
>+ u32 index;
>+
>+ _lock_rx_hashtbl_bh(bond);
>+
>+ index = bond_info->rx_hashtbl[ip_src_hash].reverse_first;
>+ while (index != RLB_NULL_INDEX) {
>+ struct rlb_client_info *entry = &(bond_info->rx_hashtbl[index]);
>+ u32 next_index = entry->reverse_next;
>+ if (entry->ip_src == arp->ip_src &&
>+ compare_ether_addr_64bits(arp->mac_src, entry->mac_src))
>+ rlb_delete_table_entry(bond, index);
>+ index = next_index;
>+ }
>+ _unlock_rx_hashtbl_bh(bond);
> }
>
> static int rlb_initialize(struct bonding *bond)
>@@ -831,21 +952,9 @@ static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
> while (curr_index != RLB_NULL_INDEX) {
> struct rlb_client_info *curr = &(bond_info->rx_hashtbl[curr_index]);
> u32 next_index = bond_info->rx_hashtbl[curr_index].next;
>- u32 prev_index = bond_info->rx_hashtbl[curr_index].prev;
>-
>- if (curr->tag && (curr->vlan_id == vlan_id)) {
>- if (curr_index == bond_info->rx_hashtbl_head) {
>- bond_info->rx_hashtbl_head = next_index;
>- }
>- if (prev_index != RLB_NULL_INDEX) {
>- bond_info->rx_hashtbl[prev_index].next = next_index;
>- }
>- if (next_index != RLB_NULL_INDEX) {
>- bond_info->rx_hashtbl[next_index].prev = prev_index;
>- }
>
>- rlb_init_table_entry(curr);
>- }
>+ if (curr->tag && (curr->vlan_id == vlan_id))
>+ rlb_delete_table_entry(bond, curr_index);
>
> curr_index = next_index;
> }
>diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h
>index 90f140a..8286df52 100644
>--- a/drivers/net/bonding/bond_alb.h
>+++ b/drivers/net/bonding/bond_alb.h
>@@ -100,6 +100,7 @@ struct tlb_client_info {
> struct rlb_client_info {
> __be32 ip_src; /* the server IP address */
> __be32 ip_dst; /* the client IP address */
>+ u8 mac_src[ETH_ALEN]; /* the server MAC address */
> u8 mac_dst[ETH_ALEN]; /* the client MAC address */
> u32 next; /* The next Hash table entry index */
> u32 prev; /* The previous Hash table entry index */
>@@ -108,6 +109,9 @@ struct rlb_client_info {
> struct slave *slave; /* the slave assigned to this client */
> u8 tag; /* flag - need to tag skb */
> unsigned short vlan_id; /* VLAN tag associated with IP address */
>+ u32 reverse_next; /* next entry with same hash(ip_src) */
>+ u32 reverse_prev; /* prev entry with same hash(ip_src) */
>+ u32 reverse_first; /* first entry with hash(ip_src) == this entry's index */
> };
>
> struct tlb_slave_info {
>
>
>
>--
>Jiri Bohac <jbohac@suse.cz>
>SUSE Labs, SUSE CZ
>
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
^ permalink raw reply
* [PATCH] MAINTAINERS: update sctp maintainer address
From: Vladislav Yasevich @ 2012-04-26 20:27 UTC (permalink / raw)
To: Linux Netdev List
Update my email address.
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
---
MAINTAINERS | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 962232d..e61dc12 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5885,11 +5885,11 @@ F: Documentation/scsi/st.txt
F: drivers/scsi/st*
SCTP PROTOCOL
-M: Vlad Yasevich <vladislav.yasevich@hp.com>
+M: Vlad Yasevich <vyasevich@gmail.com>
M: Sridhar Samudrala <sri@us.ibm.com>
L: linux-sctp@vger.kernel.org
W: http://lksctp.sourceforge.net
-S: Supported
+S: Maintained
F: Documentation/networking/sctp.txt
F: include/linux/sctp.h
F: include/net/sctp/
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] b44: properly use pr_fmt()
From: Luis R. Rodriguez @ 2012-04-26 20:30 UTC (permalink / raw)
To: David Miller
Cc: zambrano-dY08KVG/lbpWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
arend-dY08KVG/lbpWk0Htik3J/w, joe-6d6DIl74uiNBDgjK7y7TUQ
In-Reply-To: <20120426.160757.1741140873728970494.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Thu, Apr 26, 2012 at 1:07 PM, David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:
> From: "Luis R. Rodriguez" <mcgrof-3uybbJdB1yH774rrrx3eTA@public.gmane.org>
> Date: Thu, 26 Apr 2012 08:53:30 -0700
>
>> OK I found no pr_fmt warnings at all for make allmodconfig ; make V=1
>> ; on v3.4-rc4. For this and others reason stated then yes, this patch
>> is simply bogus.
>
> This is what I expected, thanks for sorting this out :-)
Thanks for kicking me in the balls.
> We're in the rally!
This is the highlight of my life (8:17) !
Luis
^ 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