* Re: [PATCH net-next] neighbour: Make neigh_table_init_no_netlink() static.
From: David Miller @ 2012-04-13 18:02 UTC (permalink / raw)
To: shimoda.hiroaki; +Cc: netdev
In-Reply-To: <20120414023444.b253e677.shimoda.hiroaki@gmail.com>
From: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Date: Sat, 14 Apr 2012 02:34:44 +0900
> neigh_table_init_no_netlink() is only used in net/core/neighbour.c file.
>
> Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] drivers/net/ethernet/xilinx/axi ethernet: Correct Copyright
From: David Miller @ 2012-04-13 17:59 UTC (permalink / raw)
To: monstr; +Cc: netdev, John.Linn, danborkmann, anirudh
In-Reply-To: <1334229072-8581-1-git-send-email-monstr@monstr.eu>
From: Michal Simek <monstr@monstr.eu>
Date: Thu, 12 Apr 2012 13:11:12 +0200
> Also fix MAINTAINERS file to reflect autorship.
>
> Daniel and Ariane changed coding style but not any functional changes in the driver
> itself.
>
> Signed-off-by: Michal Simek <monstr@monstr.eu>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] ks8851: Fix missing mutex_lock/unlock
From: Stephen Boyd @ 2012-04-13 17:46 UTC (permalink / raw)
To: mjr; +Cc: fbl, davem, Ben Dooks, bhutchings, netdev
In-Reply-To: <1334272530-11119-1-git-send-email-mjr@cs.wisc.edu>
On 04/12/12 16:15, mjr@cs.wisc.edu wrote:
> From: Matt Renzelmann <mjr@cs.wisc.edu>
>
> All calls to ks8851_rdreg* and ks8851_wrreg* should be protected with
> the driver's lock mutex. A spurious interrupt may otherwise cause a
> crash.
This doesn't make any sense anymore because you don't do any mutex things.
> Thanks to Stephen Boyd, Flavio Leitner, and Ben Hutchings for
> feedback.
>
> Signed-off-by: Matt Renzelmann <mjr@cs.wisc.edu>
> ---
>
> This modified version incorporates Ben Hutchings' bugfix by removing
> the incorrect call to CIDER_REV_GET.
>
> drivers/net/ethernet/micrel/ks8851.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
> index c722aa6..e5dc075 100644
> --- a/drivers/net/ethernet/micrel/ks8851.c
> +++ b/drivers/net/ethernet/micrel/ks8851.c
> @@ -1418,6 +1418,7 @@ static int __devinit ks8851_probe(struct spi_device *spi)
> struct net_device *ndev;
> struct ks8851_net *ks;
> int ret;
> + unsigned cider;
>
> ndev = alloc_etherdev(sizeof(struct ks8851_net));
> if (!ndev)
> @@ -1484,8 +1485,8 @@ static int __devinit ks8851_probe(struct spi_device *spi)
> ks8851_soft_reset(ks, GRR_GSR);
>
> /* simple check for a valid chip being connected to the bus */
> -
> - if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) {
> + cider = ks8851_rdreg16(ks, KS_CIDER);
> + if ((cider & ~CIDER_REV_MASK) != CIDER_ID) {
> dev_err(&spi->dev, "failed to read device ID\n");
> ret = -ENODEV;
> goto err_id;
> @@ -1516,8 +1517,7 @@ static int __devinit ks8851_probe(struct spi_device *spi)
> }
>
> netdev_info(ndev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n",
> - CIDER_REV_GET(ks8851_rdreg16(ks, KS_CIDER)),
> - ndev->dev_addr, ndev->irq,
> + CIDER_REV_GET(cider), ndev->dev_addr, ndev->irq,
> ks->rc_ccr & CCR_EEPROM ? "has" : "no");
>
> return 0;
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply
* Re: [PATCH net-next] udp: intoduce udp_encap_needed static_key
From: Benjamin LaHaise @ 2012-04-13 17:45 UTC (permalink / raw)
To: David Miller
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <20120413.134108.1844473866612154303.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Hi folks,
On Fri, Apr 13, 2012 at 01:41:08PM -0400, David Miller wrote:
> Ban, please incorporate this scheme when you respin your
> fixed ipv6 encap/l2tp patches.
>
> Thanks.
Okay, will do. Thanks for the feedback and heads up.
-ben
--
"Thought is the essence of where you are now."
^ permalink raw reply
* Re: [PATCH] 8139cp: set intr mask after its handler is registered
From: David Miller @ 2012-04-13 17:42 UTC (permalink / raw)
To: fbl; +Cc: jasowang, netdev, linux-kernel
In-Reply-To: <20120412104529.27ece685@asterix.rh>
From: Flavio Leitner <fbl@redhat.com>
Date: Thu, 12 Apr 2012 10:45:29 -0300
> On Thu, 12 Apr 2012 16:10:54 +0800
> Jason Wang <jasowang@redhat.com> wrote:
>
>> We set intr mask before its handler is registered, this does not work well when
>> 8139cp is sharing irq line with other devices. As the irq could be enabled by
>> the device before 8139cp's hander is registered which may lead unhandled
>> irq. Fix this by introducing an helper cp_irq_enable() and call it after
>> request_irq().
>>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>
> Reviewed-by: Flavio Leitner <fbl@redhat.com>
Applied, and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH net-next] udp: intoduce udp_encap_needed static_key
From: David Miller @ 2012-04-13 17:41 UTC (permalink / raw)
To: eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
bcrl-Bw31MaZKKs3YtjvyW6yDsg
In-Reply-To: <1334221528.5300.6008.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Thu, 12 Apr 2012 11:05:28 +0200
> Most machines dont use UDP encapsulation (L2TP)
>
> Adds a static_key so that udp_queue_rcv_skb() doesnt have to perform a
> test if L2TP never setup the encap_rcv on a socket.
>
> Idea of this patch came after Simon Horman proposal to add a hook on TCP
> as well.
>
> If static_key is not yet enabled, the fast path does a single JMP .
>
> When static_key is enabled, JMP destination is patched to reach the real
> encap_type/encap_rcv logic, possibly adding cache misses.
>
> Signed-off-by: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Applied to net-next, thanks Eric.
Ban, please incorporate this scheme when you respin your
fixed ipv6 encap/l2tp patches.
Thanks.
^ permalink raw reply
* Re: [net-next V7 PATCH] virtio-net: send gratuitous packets when needed
From: David Miller @ 2012-04-13 17:38 UTC (permalink / raw)
To: jasowang; +Cc: netdev, mst, linux-kernel, virtualization
In-Reply-To: <20120412064351.23243.84912.stgit@amd-6168-8-1.englab.nay.redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Thu, 12 Apr 2012 14:43:52 +0800
> As hypervior does not have the knowledge of guest network configuration, it's
> better to ask guest to send gratuitous packets when needed.
>
> This patch implements VIRTIO_NET_F_GUEST_ANNOUNCE feature: hypervisor would
> notice the guest when it thinks it's time for guest to announce the link
> presnece. Guest tests VIRTIO_NET_S_ANNOUNCE bit during config change interrupt
> and woule send gratuitous packets through netif_notify_peers() and ack the
> notification through ctrl vq.
>
> We need to make sure the atomicy of read and ack in guest otherwise we may ack
> more times than being notified. This is done through handling the whole config
> change interrupt in an non-reentrant workqueue.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Michael, Rusty, et al.?
^ permalink raw reply
* Re: [PATCH] atl1: fix kernel panic in case of DMA errors
From: David Miller @ 2012-04-13 17:35 UTC (permalink / raw)
To: antonz; +Cc: netdev
In-Reply-To: <1334160903-988902-1-git-send-email-antonz@parallels.com>
From: Tony Zelenoff <antonz@parallels.com>
Date: Wed, 11 Apr 2012 20:15:03 +0400
> Problem:
> There was two separate work_struct structures which share one
> handler. Unfortunately getting atl1_adapter structure from
> work_struct in case of DMA error was done from incorrect
> offset which cause kernel panics.
>
> Solution:
> The useless work_struct for DMA error removed and
> handler name changed to more generic one.
>
> Signed-off-by: Tony Zelenoff <antonz@parallels.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH] memcg/tcp: fix warning caused b res->usage go to negative.
From: Glauber Costa @ 2012-04-13 17:33 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki; +Cc: netdev, David Miller, Andrew Morton
In-Reply-To: <4F839CF1.5050104@jp.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 2209 bytes --]
On 04/09/2012 11:37 PM, KAMEZAWA Hiroyuki wrote:
> (2012/04/07 0:49), Glauber Costa wrote:
>
>> On 03/30/2012 05:44 AM, KAMEZAWA Hiroyuki wrote:
>>> Maybe what we can do before lsf/mm summit will be this (avoid warning.)
>>> This patch is onto linus's git tree. Patch description is updated.
>>>
>>> Thanks.
>>> -Kame
>>> ==
>>> From 4ab80f84bbcb02a790342426c1de84aeb17fcbe9 Mon Sep 17 00:00:00 2001
>>> From: KAMEZAWA Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com>
>>> Date: Thu, 29 Mar 2012 14:59:04 +0900
>>> Subject: [PATCH] memcg/tcp: fix warning caused b res->usage go to negative.
>>>
>>> tcp memcontrol starts accouting after res->limit is set. So, if a sockets
>>> starts before setting res->limit, there are already used resource.
>>> At setting res->limit, accounting starts. The resource will be uncharged
>>> and make res_counter below 0 because they are not charged.
>>> This causes warning.
>>>
>>
>> Kame,
>>
>> Please test the following patch and see if it fixes your problems (I
>> tested locally, and it triggers me no warnings running the test script
>> you provided + an inbound scp -r copy of an iso directory from a remote
>> machine)
>>
>> When you are reviewing, keep in mind that we're likely to have the same
>> problems with slab jump labels - since the slab pages will outlive the
>> cgroup as well, and it might be worthy to keep this in mind, and provide
>> a central point for the jump labels to be set of on cgroup destruction.
>>
>
>
> Hm. What happens in following sequence ?
>
> 1. a memcg is created
> 2. put a task into the memcg, start tcp steam
> 3. set tcp memory limit
>
> The resource used between 2 and 3 will cause the problem finally.
>
> Then, Dave's request
> ==
> You must either:
>
> 1) Integrate the socket's existing usage when the limit is set.
>
> 2) Avoid accounting completely for a socket that started before
> the limit was set.
> ==
> are not satisfied. So, we need to have a state per sockets, it's accounted
> or not. I'll look into this problem again, today.
>
Kame,
Let me know what you think of the attached fix.
I still need to compile test it in other configs to be sure it doesn't
break, etc. But let's agree on it first.
[-- Attachment #2: 0001-decrement-static-keys-on-real-destroy-time.patch --]
[-- Type: text/x-patch, Size: 5324 bytes --]
>From cdebff23dceeb9d35fd27e5988748a506bb47985 Mon Sep 17 00:00:00 2001
From: Glauber Costa <glommer@parallels.com>
Date: Wed, 4 Apr 2012 21:08:38 +0400
Subject: [PATCH] decrement static keys on real destroy time
We call the destroy function when a cgroup starts to be removed,
such as by a rmdir event.
However, because of our reference counters, some objects are still
inflight. Right now, we are decrementing the static_keys at destroy()
time, meaning that if we get rid of the last static_key reference,
some objects will still have charges, but the code to properly
uncharge them won't be run.
This becomes a problem specially if it is ever enabled again, because
now new charges will be added to the staled charges making keeping
it pretty much impossible.
We just need to be careful with the static branch activation:
since there is no particular preferred order of their activation,
we need to make sure that we only start using it after all
call sites are active. This is achieved by having a per-memcg
flag that is only updated after static_key_slow_inc() returns.
At this time, we are sure all sites are active.
This is made per-memcg, not global, for a reason:
it also has the effect of making socket accounting more
consistent. The first memcg to be limited will trigger static_key()
activation, therefore, accounting. But all the others will then be
accounted no matter what. After this patch, only limited memcgs
will have its sockets accounted.
[v2: changed a tcp limited flag for a generic proto limited flag ]
Signed-off-by: Glauber Costa <glommer@parallels.com>
---
include/net/sock.h | 1 +
mm/memcontrol.c | 20 ++++++++++++++++++--
net/ipv4/tcp_memcontrol.c | 12 ++++++------
3 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index b3ebe6b..f35ff7d 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -913,6 +913,7 @@ struct cg_proto {
struct percpu_counter *sockets_allocated; /* Current number of sockets. */
int *memory_pressure;
long *sysctl_mem;
+ bool limited;
/*
* memcg field is used to find which memcg we belong directly
* Each memcg struct can hold more than one cg_proto, so container_of
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 02b01d2..61f2d31 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -404,6 +404,7 @@ void sock_update_memcg(struct sock *sk)
{
if (mem_cgroup_sockets_enabled) {
struct mem_cgroup *memcg;
+ struct cg_proto *cg_proto;
BUG_ON(!sk->sk_prot->proto_cgroup);
@@ -423,9 +424,10 @@ void sock_update_memcg(struct sock *sk)
rcu_read_lock();
memcg = mem_cgroup_from_task(current);
- if (!mem_cgroup_is_root(memcg)) {
+ cg_proto = sk->sk_prot->proto_cgroup(memcg);
+ if (!mem_cgroup_is_root(memcg) && cg_proto->limited) {
mem_cgroup_get(memcg);
- sk->sk_cgrp = sk->sk_prot->proto_cgroup(memcg);
+ sk->sk_cgrp = cg_proto;
}
rcu_read_unlock();
}
@@ -442,6 +444,14 @@ void sock_release_memcg(struct sock *sk)
}
}
+static void disarm_static_keys(struct mem_cgroup *memcg)
+{
+#ifdef CONFIG_INET
+ if (memcg->tcp_mem.cg_proto.limited)
+ static_key_slow_dec(&memcg_socket_limit_enabled);
+#endif
+}
+
#ifdef CONFIG_INET
struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg)
{
@@ -452,6 +462,11 @@ struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg)
}
EXPORT_SYMBOL(tcp_proto_cgroup);
#endif /* CONFIG_INET */
+#else
+static inline void disarm_static_keys(struct mem_cgroup *memcg)
+{
+}
+
#endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */
static void drain_all_stock_async(struct mem_cgroup *memcg);
@@ -4883,6 +4898,7 @@ static void __mem_cgroup_put(struct mem_cgroup *memcg, int count)
{
if (atomic_sub_and_test(count, &memcg->refcnt)) {
struct mem_cgroup *parent = parent_mem_cgroup(memcg);
+ disarm_static_keys(memcg);
__mem_cgroup_free(memcg);
if (parent)
mem_cgroup_put(parent);
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c
index 1517037..8005667 100644
--- a/net/ipv4/tcp_memcontrol.c
+++ b/net/ipv4/tcp_memcontrol.c
@@ -54,6 +54,7 @@ int tcp_init_cgroup(struct mem_cgroup *memcg, struct cgroup_subsys *ss)
cg_proto->sysctl_mem = tcp->tcp_prot_mem;
cg_proto->memory_allocated = &tcp->tcp_memory_allocated;
cg_proto->sockets_allocated = &tcp->tcp_sockets_allocated;
+ cg_proto->limited = false;
cg_proto->memcg = memcg;
return 0;
@@ -74,9 +75,6 @@ void tcp_destroy_cgroup(struct mem_cgroup *memcg)
percpu_counter_destroy(&tcp->tcp_sockets_allocated);
val = res_counter_read_u64(&tcp->tcp_memory_allocated, RES_LIMIT);
-
- if (val != RESOURCE_MAX)
- static_key_slow_dec(&memcg_socket_limit_enabled);
}
EXPORT_SYMBOL(tcp_destroy_cgroup);
@@ -107,10 +105,12 @@ static int tcp_update_limit(struct mem_cgroup *memcg, u64 val)
tcp->tcp_prot_mem[i] = min_t(long, val >> PAGE_SHIFT,
net->ipv4.sysctl_tcp_mem[i]);
- if (val == RESOURCE_MAX && old_lim != RESOURCE_MAX)
- static_key_slow_dec(&memcg_socket_limit_enabled);
- else if (old_lim == RESOURCE_MAX && val != RESOURCE_MAX)
+ if (val == RESOURCE_MAX)
+ cg_proto->limited = false;
+ else if (val != RESOURCE_MAX && !cg_proto->limited) {
static_key_slow_inc(&memcg_socket_limit_enabled);
+ cg_proto->limited = true;
+ }
return 0;
}
--
1.7.7.6
^ permalink raw reply related
* Re: [PATCH] net: WIZnet drivers: fix possible NULL dereference
From: David Miller @ 2012-04-13 17:34 UTC (permalink / raw)
To: msink; +Cc: netdev, dan.carpenter
In-Reply-To: <1334123633-11833-1-git-send-email-msink@permonline.ru>
From: Mike Sinkovsky <msink@permonline.ru>
Date: Wed, 11 Apr 2012 11:53:53 +0600
> This fixes possible null dereference in probe() function: when both
> .mac_addr and .link_gpio are unknown, dev.platform_data may be NULL
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Mike Sinkovsky <msink@permonline.ru>
Applied.
^ permalink raw reply
* [PATCH net-next] neighbour: Make neigh_table_init_no_netlink() static.
From: Hiroaki SHIMODA @ 2012-04-13 17:34 UTC (permalink / raw)
To: davem; +Cc: netdev
neigh_table_init_no_netlink() is only used in net/core/neighbour.c file.
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
---
include/net/neighbour.h | 1 -
net/core/neighbour.c | 3 +--
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 34c996f..63ebd70 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -195,7 +195,6 @@ static inline void *neighbour_priv(const struct neighbour *n)
#define NEIGH_UPDATE_F_ADMIN 0x80000000
extern void neigh_table_init(struct neigh_table *tbl);
-extern void neigh_table_init_no_netlink(struct neigh_table *tbl);
extern int neigh_table_clear(struct neigh_table *tbl);
extern struct neighbour * neigh_lookup(struct neigh_table *tbl,
const void *pkey,
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index ac71765..2d3e6fc 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1500,7 +1500,7 @@ static void neigh_parms_destroy(struct neigh_parms *parms)
static struct lock_class_key neigh_table_proxy_queue_class;
-void neigh_table_init_no_netlink(struct neigh_table *tbl)
+static void neigh_table_init_no_netlink(struct neigh_table *tbl)
{
unsigned long now = jiffies;
unsigned long phsize;
@@ -1538,7 +1538,6 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
tbl->last_flush = now;
tbl->last_rand = now + tbl->parms.reachable_time * 20;
}
-EXPORT_SYMBOL(neigh_table_init_no_netlink);
void neigh_table_init(struct neigh_table *tbl)
{
--
1.7.8.5
^ permalink raw reply related
* Re: [PATCH] rtnetlink: fix comments
From: David Miller @ 2012-04-13 17:33 UTC (permalink / raw)
To: shemminger; +Cc: bhutchings, netdev
In-Reply-To: <20120410213259.10009908@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 10 Apr 2012 21:32:59 -0700
> Fix spelling and references in rtnetlink.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> ---
> v2 - fix bogus comment on get_link_af_size and add get_tx_queues
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net-next] rtnetlink & bonding: change args got get_tx_queues
From: David Miller @ 2012-04-13 17:31 UTC (permalink / raw)
To: shemminger; +Cc: bhutchings, fubar, andy, netdev
In-Reply-To: <20120410213443.31fc0784@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 10 Apr 2012 21:34:43 -0700
> Change get_tx_queues, drop unsused arg/return value real_tx_queues,
> and use return by value (with error) rather than call by reference.
>
> Probably bonding should just change to LLTX and the whole get_tx_queues
> API could disappear!
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied, thanks Stephen.
^ permalink raw reply
* Re: [PATCH] pppoatm: Fix excessive queue bloat
From: David Miller @ 2012-04-13 17:27 UTC (permalink / raw)
To: chas; +Cc: dwmw2, netdev, paulus, eric.dumazet
In-Reply-To: <20120413.130452.524616632667687350.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Fri, 13 Apr 2012 13:04:52 -0400 (EDT)
> From: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
> Date: Tue, 10 Apr 2012 10:26:12 -0400
>
>> On Sun, 08 Apr 2012 21:53:57 +0200
>> David Woodhouse <dwmw2@infradead.org> wrote:
>>
>>> Seriously, this gets *much* easier if we just ditch the checks against
>>> sk_sndbuf. We just wake up whenever decrementing ->inflight from zero.
>>> Can I?
>>
>> i dont know.
>
> Please do not take this discussion private, and off of the netdev list.
>
> Now nobody else on the list can see your response and and reply to it.
My bad, you didn't do this, my apologies.
But for some reason your replies didn't show up in the patchwork
entry for this patch, maybe your email client fumbled up the Message-Ids
because that's what patchwork uses to match things up.
^ permalink raw reply
* Re: [PATCH net-next 1/2] net/ipv6/udp: Add encap_rcv support to IPv6 UDP
From: David Miller @ 2012-04-13 17:24 UTC (permalink / raw)
To: bcrl; +Cc: jchapman, netdev
In-Reply-To: <20120411022047.GA19124@kvack.org>
From: Benjamin LaHaise <bcrl@kvack.org>
Date: Tue, 10 Apr 2012 22:20:47 -0400
> At present, UDP encapsulated protocols (like L2TP) are only able to use the
> encap_rcv hook with UDP over IPv4. This patch adds the same support for use
> with UDP over IPv6.
>
> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
This isn't right at all.
The return value of udpv6_queue_rcv_skb() ignorred at all
call sites except when it is invoked via ->backlog_rcv(), which
expects a different kind of return value, not an encap operation
indication.
So the whole "requeue as proto '-N'" logic isn't going to ever work.
You need to do what the ipv4 side does, split the routine into
two parts:
1) A __udpv6_queue_rcv_skb() which purely handles socket queueing
cases. It does not handle encap or anything like that.
This is what is what you hook into ->backlog_rcv for ipv6 udp.
2) A udpv6_queue_rcv_skb() which is invoked by the UDPv6 socket demux
on receive, and which will properly propagate the return values
back down into ipv6 input to do the "requeue as proto '-N'" stuff.
Please resubmit both of these patches once you've fixed this up (and
tested it).
^ permalink raw reply
* Re: sky2: in free_buffers() do proper checks before call of rx_clean()
From: Stephen Hemminger @ 2012-04-13 17:24 UTC (permalink / raw)
To: David Miller; +Cc: LinoSanfilippo, mlindner, netdev, linux-kernel
In-Reply-To: <20120413.125954.1123124134206162716.davem@davemloft.net>
How about this instead? It moves the rx_clean out of free_buffers and
into the proper place in the unwind code.
--- a/drivers/net/ethernet/marvell/sky2.c 2012-04-12 08:07:11.572640522 -0700
+++ b/drivers/net/ethernet/marvell/sky2.c 2012-04-13 10:19:39.466839378 -0700
@@ -1630,7 +1630,8 @@ static int sky2_alloc_buffers(struct sky
if (!sky2->rx_ring)
goto nomem;
- return sky2_alloc_rx_skbs(sky2);
+ return 0;
+
nomem:
return -ENOMEM;
}
@@ -1639,8 +1640,6 @@ static void sky2_free_buffers(struct sky
{
struct sky2_hw *hw = sky2->hw;
- sky2_rx_clean(sky2);
-
if (sky2->rx_le) {
pci_free_consistent(hw->pdev, RX_LE_BYTES,
sky2->rx_le, sky2->rx_le_map);
@@ -1761,9 +1760,13 @@ static int sky2_open(struct net_device *
if (err)
goto err_out;
+ err = sky2_alloc_rx_skbs(sky2);
+ if (err)
+ goto err_clean;
+
/* With single port, IRQ is setup when device is brought up */
if (hw->ports == 1 && (err = sky2_setup_irq(hw, dev->name)))
- goto err_out;
+ goto err_clean;
sky2_hw_up(sky2);
@@ -1783,6 +1786,8 @@ static int sky2_open(struct net_device *
return 0;
+err_clean:
+ sky2_rx_clean(sky2);
err_out:
sky2_free_buffers(sky2);
return err;
@@ -2158,6 +2163,7 @@ static int sky2_close(struct net_device
sky2_hw_down(sky2);
+ sky2_rx_clean(sky2);
sky2_free_buffers(sky2);
return 0;
^ permalink raw reply
* [PATCH linux-next 1/1] ath6k: Normalize use of FW_DIR
From: Tim Gardner @ 2012-04-13 17:17 UTC (permalink / raw)
To: kvalo, linux-kernel; +Cc: Tim Gardner, John W. Linville, linux-wireless, netdev
In-Reply-To: <1334337448-26270-1-git-send-email-tim.gardner@canonical.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
drivers/net/wireless/ath/ath6kl/core.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 9d67964..ba81dc8 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -126,9 +126,9 @@ struct ath6kl_fw_ie {
#define AR6003_HW_2_0_FIRMWARE_FILE "athwlan.bin.z77"
#define AR6003_HW_2_0_TCMD_FIRMWARE_FILE "athtcmd_ram.bin"
#define AR6003_HW_2_0_PATCH_FILE "data.patch.bin"
-#define AR6003_HW_2_0_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.bin"
+#define AR6003_HW_2_0_BOARD_DATA_FILE AR6003_HW_2_0_FW_DIR "/bdata.bin"
#define AR6003_HW_2_0_DEFAULT_BOARD_DATA_FILE \
- "ath6k/AR6003/hw2.0/bdata.SD31.bin"
+ AR6003_HW_2_0_FW_DIR "/bdata.SD31.bin"
/* AR6003 3.0 definitions */
#define AR6003_HW_2_1_1_VERSION 0x30000582
@@ -139,25 +139,25 @@ struct ath6kl_fw_ie {
#define AR6003_HW_2_1_1_UTF_FIRMWARE_FILE "utf.bin"
#define AR6003_HW_2_1_1_TESTSCRIPT_FILE "nullTestFlow.bin"
#define AR6003_HW_2_1_1_PATCH_FILE "data.patch.bin"
-#define AR6003_HW_2_1_1_BOARD_DATA_FILE "ath6k/AR6003/hw2.1.1/bdata.bin"
+#define AR6003_HW_2_1_1_BOARD_DATA_FILE AR6003_HW_2_1_1_FW_DIR "/bdata.bin"
#define AR6003_HW_2_1_1_DEFAULT_BOARD_DATA_FILE \
- "ath6k/AR6003/hw2.1.1/bdata.SD31.bin"
+ AR6003_HW_2_1_1_FW_DIR "/bdata.SD31.bin"
/* AR6004 1.0 definitions */
#define AR6004_HW_1_0_VERSION 0x30000623
#define AR6004_HW_1_0_FW_DIR "ath6k/AR6004/hw1.0"
#define AR6004_HW_1_0_FIRMWARE_FILE "fw.ram.bin"
-#define AR6004_HW_1_0_BOARD_DATA_FILE "ath6k/AR6004/hw1.0/bdata.bin"
+#define AR6004_HW_1_0_BOARD_DATA_FILE AR6004_HW_1_0_FW_DIR "/bdata.bin"
#define AR6004_HW_1_0_DEFAULT_BOARD_DATA_FILE \
- "ath6k/AR6004/hw1.0/bdata.DB132.bin"
+ AR6004_HW_1_0_FW_DIR "/bdata.DB132.bin"
/* AR6004 1.1 definitions */
#define AR6004_HW_1_1_VERSION 0x30000001
#define AR6004_HW_1_1_FW_DIR "ath6k/AR6004/hw1.1"
#define AR6004_HW_1_1_FIRMWARE_FILE "fw.ram.bin"
-#define AR6004_HW_1_1_BOARD_DATA_FILE "ath6k/AR6004/hw1.1/bdata.bin"
+#define AR6004_HW_1_1_BOARD_DATA_FILE AR6004_HW_1_1_FW_DIR "/bdata.bin"
#define AR6004_HW_1_1_DEFAULT_BOARD_DATA_FILE \
- "ath6k/AR6004/hw1.1/bdata.DB132.bin"
+ AR6004_HW_1_1_FW_DIR "/bdata.DB132.bin"
/* Per STA data, used in AP mode */
#define STA_PS_AWAKE BIT(0)
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 07/11] ethernet: replace open-coded ARRAY_SIZE with macro
From: David Miller @ 2012-04-13 17:15 UTC (permalink / raw)
To: jim.cromie; +Cc: netdev, jeffrey.t.kirsher, joe, florian, netdev, trivial
In-Reply-To: <1334105782-9286-1-git-send-email-jim.cromie@gmail.com>
From: Jim Cromie <jim.cromie@gmail.com>
Date: Tue, 10 Apr 2012 18:56:22 -0600
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH 06/11] enic: replace open-coded ARRAY_SIZE with macro
From: David Miller @ 2012-04-13 17:15 UTC (permalink / raw)
To: jim.cromie; +Cc: netdev, trivial
In-Reply-To: <1334105769-9235-1-git-send-email-jim.cromie@gmail.com>
From: Jim Cromie <jim.cromie@gmail.com>
Date: Tue, 10 Apr 2012 18:56:09 -0600
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH 05/11] broadcom: replace open-coded ARRAY_SIZE with macro
From: David Miller @ 2012-04-13 17:15 UTC (permalink / raw)
To: jim.cromie; +Cc: netdev, trivial
In-Reply-To: <1334105763-9198-1-git-send-email-jim.cromie@gmail.com>
From: Jim Cromie <jim.cromie@gmail.com>
Date: Tue, 10 Apr 2012 18:56:03 -0600
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/9] atl1: make driver napi compatible
From: Ben Hutchings @ 2012-04-13 17:15 UTC (permalink / raw)
To: Tony Zelenoff; +Cc: davem, netdev, jcliburn, csnook, khorenko
In-Reply-To: <1334333394-38404-3-git-send-email-antonz@parallels.com>
On Fri, 2012-04-13 at 20:09 +0400, Tony Zelenoff wrote:
> This is first step, here there is no fine interrupt
> disabling which cause TX/ERR interrupts stalling when
> RX scheduled ints processed.
>
> Signed-off-by: Tony Zelenoff <antonz@parallels.com>
> ---
> drivers/net/ethernet/atheros/atlx/atl1.c | 46 ++++++++++++++++++++++++++----
> drivers/net/ethernet/atheros/atlx/atl1.h | 1 +
> 2 files changed, 41 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
> index 6438239..d39c1b9 100644
> --- a/drivers/net/ethernet/atheros/atlx/atl1.c
> +++ b/drivers/net/ethernet/atheros/atlx/atl1.c
> @@ -1917,7 +1917,7 @@ next:
> return num_alloc;
> }
>
> -static void atl1_intr_rx(struct atl1_adapter *adapter)
> +static int atl1_intr_rx(struct atl1_adapter *adapter, int budget)
> {
> int i, count;
> u16 length;
> @@ -1933,7 +1933,7 @@ static void atl1_intr_rx(struct atl1_adapter *adapter)
>
> rrd_next_to_clean = atomic_read(&rrd_ring->next_to_clean);
>
> - while (1) {
> + while (count <= budget) {
[...]
Off by one; the test should be count < budget. Otherwise you can exit
with count == budget + 1 and net_rx_action() will WARN you about that.
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 4/4] net: Remove redundant spi driver bus initialization
From: David Miller @ 2012-04-13 17:13 UTC (permalink / raw)
To: lars; +Cc: linux-kernel, juhosg, frdrc66, netdev
In-Reply-To: <1334091089-10138-4-git-send-email-lars@metafoo.de>
From: Lars-Peter Clausen <lars@metafoo.de>
Date: Tue, 10 Apr 2012 22:51:29 +0200
> In ancient times it was necessary to manually initialize the bus field of an
> spi_driver to spi_bus_type. These days this is done in spi_driver_register() so
> we can drop the manual assignment.
>
> The patch was generated using the following coccinelle semantic patch:
> // <smpl>
> @@
> identifier _driver;
> @@
> struct spi_driver _driver = {
> .driver = {
> - .bus = &spi_bus_type,
> },
> };
> // </smpl>
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH] net/garp: fix GID rbtree ordering
From: David Miller @ 2012-04-13 17:10 UTC (permalink / raw)
To: david.ward; +Cc: netdev, jorge
In-Reply-To: <1333980833-12355-1-git-send-email-david.ward@ll.mit.edu>
From: David Ward <david.ward@ll.mit.edu>
Date: Mon, 9 Apr 2012 10:13:53 -0400
> The comparison operators were backwards in both garp_attr_lookup and
> garp_attr_create, so the entire GID rbtree was in reverse order.
> (There was no practical side effect to this though, except that PDUs
> were sent with attributes listed in reverse order, which is still
> valid by the protocol. This change is only for clarity.)
>
> Signed-off-by: David Ward <david.ward@ll.mit.edu>
Applied to net-next, thanks David.
^ permalink raw reply
* Re: sky2: in free_buffers() do proper checks before call of rx_clean()
From: Stephen Hemminger @ 2012-04-13 17:09 UTC (permalink / raw)
To: Lino Sanfilippo; +Cc: mlindner, davem, netdev, linux-kernel
In-Reply-To: <20120403001327.GB10227@Neptun>
On Tue, 3 Apr 2012 02:13:27 +0200
Lino Sanfilippo <LinoSanfilippo@gmx.de> wrote:
> In sky2_open() free_buffers() is called in case that alloc_buffers() failed.
> Here we do the check for sky2->rx_le too late, since we already called
> rx_clean() which accessed rx_le. Furthermore we lack a check for sky2->rx_ring
> which is also accessed by rx_clean().
>
> With this patch both sky2->rx_le and sky2->rx_ring are checked before
> alloc_buffers() is called.
>
> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Looking at sky2_alloc_buffers, it really needs to change to have
proper unwind instead. If some portion of the memory required isn't available
everything needs to be undone.
^ permalink raw reply
* Re: [PATCH] skbuff: struct ubuf_info callback type safety
From: David Miller @ 2012-04-13 17:09 UTC (permalink / raw)
To: mst
Cc: ian.campbell, eric.dumazet, netdev, linux-kernel, virtualization,
kvm, shemminger, xma
In-Reply-To: <20120409102402.GA5255@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 9 Apr 2012 13:24:02 +0300
> The skb struct ubuf_info callback gets passed struct ubuf_info
> itself, not the arg value as the field name and the function signature
> seem to imply. Rename the arg field to ctx to match usage,
> add documentation and change the callback argument type
> to make usage clear and to have compiler check correctness.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Applied, thanks for fixing this Michael.
^ 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