* Re: [Patch]r8169: remove unnecessary cast of readl()'s return value
From: David Miller @ 2010-05-31 7:33 UTC (permalink / raw)
To: junchangwang; +Cc: romieu, netdev
In-Reply-To: <20100530122606.GC1146@host-a-55.ustcsz.edu.cn>
From: Junchang Wang <junchangwang@gmail.com>
Date: Sun, 30 May 2010 20:26:07 +0800
> readl() returns a 32-bit integer on all platforms.
> There is no need to cast its return value.
>
> Signed-off-by: Junchang Wang <junchangwang@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] drivers/net/arcnet/capmode.c: clean up code
From: David Miller @ 2010-05-31 7:35 UTC (permalink / raw)
To: daniel; +Cc: linux-kernel, tj, jkosina, cl, joe, netdev
In-Reply-To: <1275291070-23062-1-git-send-email-daniel@caiaq.de>
From: Daniel Mack <daniel@caiaq.de>
Date: Mon, 31 May 2010 09:31:10 +0200
> - shuffle around functions to get rid of forward declarations
> - fix some CodingStyle and indentation issues
> - last but not least, get rid of the following CONFIG_MODULE=n warning:
>
> drivers/net/arcnet/capmode.c:52: warning: ‘capmode_proto’ defined but not used
>
> Signed-off-by: Daniel Mack <daniel@caiaq.de>
Applied, but:
> +MODULE_LICENSE("GPL");
> +
> --
> 1.7.1
>
Extraneous empty line at end of file, which GIT warned about.
I fixed it up before applying your patch.
Thanks.
^ permalink raw reply
* Re: [PATCH UPDATED 3/3] vhost: apply cpumask and cgroup to vhost pollers
From: Li Zefan @ 2010-05-31 7:48 UTC (permalink / raw)
To: Tejun Heo
Cc: Michael S. Tsirkin, Oleg Nesterov, Sridhar Samudrala, netdev,
lkml, kvm@vger.kernel.org, Andrew Morton, Dmitri Vorobiev,
Jiri Kosina, Thomas Gleixner, Ingo Molnar, Andi Kleen
In-Reply-To: <4C035E22.9010001@kernel.org>
> poller = kthread_create(vhost_poller, dev, "vhost-%d", current->pid);
> - if (IS_ERR(poller))
> - return PTR_ERR(poller);
> + if (IS_ERR(poller)) {
> + ret = PTR_ERR(poller);
> + goto out;
here...
> + }
> +
> + ret = sched_getaffinity(current->pid, mask);
> + if (ret)
> + goto out;
> +
> + ret = sched_setaffinity(poller->pid, mask);
> + if (ret)
> + goto out;
> +
> + ret = cgroup_attach_task_current_cg(poller);
> + if (ret)
> + goto out;
>
> dev->vqs = vqs;
> dev->nvqs = nvqs;
> @@ -202,7 +221,14 @@ long vhost_dev_init(struct vhost_dev *de
> vhost_poll_init(&dev->vqs[i].poll,
> dev->vqs[i].handle_kick, POLLIN, dev);
> }
> - return 0;
> +
> + wake_up_process(poller); /* avoid contributing to loadavg */
> + ret = 0;
> +out:
> + if (ret && poller)
It's still buggy..
> + kthread_stop(poller);
> + free_cpumask_var(mask);
> + return ret;
> }
>
> /* Caller should have device mutex */
>
>
^ permalink raw reply
* RE: [PATCH 1/2] Export firmware assigned labels of network devices to sysfs
From: Narendra_K @ 2010-05-31 7:55 UTC (permalink / raw)
To: Matt_Domsch, greg
Cc: netdev, linux-hotplug, linux-pci, Jordan_Hargrave, Charles_Rose,
Vijay_Nijhawan
In-Reply-To: <20100528181100.GA12806@auslistsprd01.us.dell.com>
> -----Original Message-----
> From: Matt Domsch [mailto:Matt_Domsch@dell.com]
> Sent: Friday, May 28, 2010 11:41 PM
> To: Greg KH
> Cc: K, Narendra; netdev@vger.kernel.org;
linux-hotplug@vger.kernel.org;
> linux-pci@vger.kernel.org; Hargrave, Jordan; Rose, Charles; Nijhawan,
> Vijay
> Subject: Re: [PATCH 1/2] Export firmware assigned labels of network
> devices to sysfs
>
> On Fri, May 28, 2010 at 08:40:41AM -0700, Greg KH wrote:
> > On Fri, May 28, 2010 at 06:55:21AM -0500, K, Narendra wrote:
> > > +static const char dell_dsm_uuid[] = {
> >
> > Um, a dell specific uuid in a generic file? What happens when we
> need
> > to support another manufacturer?
> >
> > > + 0xD0, 0x37, 0xC9, 0xE5, 0x53, 0x35, 0x7A, 0x4D,
> > > + 0x91, 0x17, 0xEA, 0x4D, 0x19, 0xC3, 0x43, 0x4D
> > > +};
>
> This simply needs to be renamed. It's defined in the ECN, so will be
> part of the spec, and is not vendor-unique, but defined once for all
> implementations. It separates this _DSM function from others.
>
> Thanks for the quick feedback.
Matt,
Thanks for the clarification. My understanding of the uuid was
incorrect. Would address this in the next version of the patch.
With regards,
Narendra K
^ permalink raw reply
* Fore 200 firmware
From: Meelis Roos @ 2010-05-31 8:06 UTC (permalink / raw)
To: Chas Williams; +Cc: netdev
Hello,
commit 9c54004ea717116a10886e254e26502ffb1136e9 (atm: [fore200e]
convert to use request_firmware()) made the fore driver user
request_firmware() but also removed the building of firmware image.
So the current state is that drivers/atm contains the C dump of fore 200
firmware in drivers/atm/fore200e_pca_fw.c but this firmware is not built
and not installed by make install. It's also not present in
linux-firware tree/packages so the fore driver can not load its firmware
from anywhere. I guess this is not the intended outcome.
Should we move the firmware to linux-firmware repository and remove
drivers/atm/fore200e_pca_fw.c or should we convert and install the
firmware in kernel build system?
--
Meelis Roos (mroos@linux.ee)
^ permalink raw reply
* Re: [PATCH] IPv6: fix Mobile IPv6 regression
From: Jiri Olsa @ 2010-05-31 8:46 UTC (permalink / raw)
To: Brian Haley
Cc: David Miller, Arnaud Ebalard, Scott C Otto,
YOSHIFUJI Hideaki / 吉藤英明, netdev
In-Reply-To: <4C0008C7.7020302@hp.com>
On Fri, May 28, 2010 at 02:17:43PM -0400, Brian Haley wrote:
> Commit f4f914b5 (net: ipv6 bind to device issue) caused
> a regression with Mobile IPv6 when it changed the meaning
> of fl->oif to become a strict requirement of the route
> lookup. Instead, only force strict mode when
> sk->sk_bound_dev_if is set on the calling socket, getting
> the intended behavior and fixing the regression.
>
> Tested-by: Arnaud Ebalard <arno@natisbad.org>
> Signed-off-by: Brian Haley <brian.haley@hp.com>
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 294cbe8..252d761 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -814,7 +814,7 @@ struct dst_entry * ip6_route_output(struct net *net, struct sock *sk,
> {
> int flags = 0;
>
> - if (fl->oif || rt6_need_strict(&fl->fl6_dst))
> + if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl->fl6_dst))
> flags |= RT6_LOOKUP_F_IFACE;
>
> if (!ipv6_addr_any(&fl->fl6_src))
hi,
sorry for the late reply, I was out last week..
the change looks ok, I'll verify it with the reproducer
I used for the last fix
thanks,
jirka
^ permalink raw reply
* Re: Question about netns & AF_UNIX
From: Martín Ferrari @ 2010-05-31 9:19 UTC (permalink / raw)
To: Dan Smith; +Cc: netdev, Mathieu Lacage
In-Reply-To: <87d3whb4jr.fsf@caffeine.danplanet.com>
Hi,
On Thu, May 27, 2010 at 20:08, Dan Smith <danms@us.ibm.com> wrote:
> If you are in different network namespaces, the binding of UNIX
> sockets is also kept separate. Even though the filesystem is shared,
> this seems to make the most sense to me.
To me it was the opposite, I thought natural that UNIX sockets would
continue to work, at least when they are bound to a filesystem entry.
Also it is a nice and clean way to communicate across namespaces
without assuming lots of things about the network configuration.
> Named pipes on the
> filesystem would still be shared, by the way.
Yes, today I've tried with named pipes and worked. It's just that they
aren't as nice as UNIX sockets :)
Thanks.
--
Martín Ferrari
^ permalink raw reply
* Re: [PATCH] mac8390: change an error return code and some cleanup, take 4
From: fthain @ 2010-05-31 9:21 UTC (permalink / raw)
To: David Miller; +Cc: joe, p_gortmaker, netdev, linux-kernel, linux-m68k
In-Reply-To: <20100531.001947.193703044.davem@davemloft.net>
On Mon, 31 May 2010, David Miller wrote:
> This is getting tiring Finn.
I agree. My patch addresses all of the criticism of the earlier
submissions.
To make it plain: there are 25 files or so that use ei_debug. Three of
those that now have the KERN_DEBUG printk's suppresed by the DEBUG macro
only do so as an apparently unintended side effect of a commit that claims
to "implement dynmic debug infrastructure". (Go figure.)
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=dd0fab5b940c0b65f26ac5b01485bac1f690ace6
Your suggestion to use pr_debug is invoking compile time infrastructure
(the DEBUG macro), so it is not in the spirit of this commit, and it is
not relevant to any criticism from you or Joe of the earlier submissions.
Please apply the patch.
Finn
^ permalink raw reply
* Re: [PATCH] mac8390: change an error return code and some cleanup, take 4
From: Geert Uytterhoeven @ 2010-05-31 9:58 UTC (permalink / raw)
To: fthain; +Cc: David Miller, joe, p_gortmaker, netdev, linux-kernel, linux-m68k
In-Reply-To: <alpine.LNX.2.00.1005311905520.469@nippy.intranet>
On Mon, May 31, 2010 at 11:21, <fthain@telegraphics.com.au> wrote:
> On Mon, 31 May 2010, David Miller wrote:
>> This is getting tiring Finn.
>
> I agree. My patch addresses all of the criticism of the earlier
> submissions.
>
> To make it plain: there are 25 files or so that use ei_debug. Three of
> those that now have the KERN_DEBUG printk's suppresed by the DEBUG macro
> only do so as an apparently unintended side effect of a commit that claims
> to "implement dynmic debug infrastructure". (Go figure.)
>
> http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=dd0fab5b940c0b65f26ac5b01485bac1f690ace6
>
> Your suggestion to use pr_debug is invoking compile time infrastructure
> (the DEBUG macro), so it is not in the spirit of this commit, and it is
> not relevant to any criticism from you or Joe of the earlier submissions.
>
> Please apply the patch.
`pr_debug()' indeed now may generate code if DEBUG is not defined,
i.e. if CONFIG_DYNAMIC_DEBUG is enabled.
This is intented for debug infrastructure the user may want to enable later.
If you want the old behavior, you can use `pr_devel()' instead, which
only generates code if DEBUG is defined.
This is intended for debug infrastructure for developers only.
However, you used `printk(KERN_DEBUG pr_fmt()...)`, which always generates code.
I'm still not 100% sure that was intentional?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH UPDATED2 3/3] vhost: apply cpumask and cgroup to vhost pollers
From: Tejun Heo @ 2010-05-31 10:20 UTC (permalink / raw)
To: Li Zefan
Cc: Michael S. Tsirkin, Oleg Nesterov, Sridhar Samudrala, netdev,
lkml, kvm@vger.kernel.org, Andrew Morton, Dmitri Vorobiev,
Jiri Kosina, Thomas Gleixner, Ingo Molnar, Andi Kleen
In-Reply-To: <4C0369CD.70008@cn.fujitsu.com>
Apply the cpumask and cgroup of the initializing task to the created
vhost poller.
Based on Sridhar Samudrala's patch. Li Zefan spotted a bug in error
path (twice), fixed (twice).
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Sridhar Samudrala <samudrala.sridhar@gmail.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
---
Heh... that's embarrassing. Let's see if I can get it right the third
time.
Thank you.
drivers/vhost/vhost.c | 36 ++++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)
Index: work/drivers/vhost/vhost.c
===================================================================
--- work.orig/drivers/vhost/vhost.c
+++ work/drivers/vhost/vhost.c
@@ -23,6 +23,7 @@
#include <linux/highmem.h>
#include <linux/slab.h>
#include <linux/kthread.h>
+#include <linux/cgroup.h>
#include <linux/net.h>
#include <linux/if_packet.h>
@@ -177,11 +178,29 @@ long vhost_dev_init(struct vhost_dev *de
struct vhost_virtqueue *vqs, int nvqs)
{
struct task_struct *poller;
- int i;
+ cpumask_var_t mask;
+ int i, ret = -ENOMEM;
+
+ if (!alloc_cpumask_var(&mask, GFP_KERNEL))
+ goto out_free_mask;
poller = kthread_create(vhost_poller, dev, "vhost-%d", current->pid);
- if (IS_ERR(poller))
- return PTR_ERR(poller);
+ if (IS_ERR(poller)) {
+ ret = PTR_ERR(poller);
+ goto out_free_mask;
+ }
+
+ ret = sched_getaffinity(current->pid, mask);
+ if (ret)
+ goto out_stop_poller;
+
+ ret = sched_setaffinity(poller->pid, mask);
+ if (ret)
+ goto out_stop_poller;
+
+ ret = cgroup_attach_task_current_cg(poller);
+ if (ret)
+ goto out_stop_poller;
dev->vqs = vqs;
dev->nvqs = nvqs;
@@ -202,7 +221,16 @@ long vhost_dev_init(struct vhost_dev *de
vhost_poll_init(&dev->vqs[i].poll,
dev->vqs[i].handle_kick, POLLIN, dev);
}
- return 0;
+
+ wake_up_process(poller); /* avoid contributing to loadavg */
+ ret = 0;
+ goto out_free_mask;
+
+out_stop_poller:
+ kthread_stop(poller);
+out_free_mask:
+ free_cpumask_var(mask);
+ return ret;
}
/* Caller should have device mutex */
^ permalink raw reply
* [PATCH 1/2] ksz884x: convert to netdev_tx_t
From: Denis Kirjanov @ 2010-05-31 10:24 UTC (permalink / raw)
To: davem; +Cc: netdev
Convert TX hook to netdev_tx_t type
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
drivers/net/ksz884x.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c
index c80ca64..7805bbf 100644
--- a/drivers/net/ksz884x.c
+++ b/drivers/net/ksz884x.c
@@ -4854,7 +4854,7 @@ static inline void copy_old_skb(struct sk_buff *old, struct sk_buff *skb)
*
* Return 0 if successful; otherwise an error code indicating failure.
*/
-static int netdev_tx(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
{
struct dev_priv *priv = netdev_priv(dev);
struct dev_info *hw_priv = priv->adapter;
^ permalink raw reply related
* [PATCH 2/2] ksz884x: Add missing validate_addr hook
From: Denis Kirjanov @ 2010-05-31 10:26 UTC (permalink / raw)
To: davem; +Cc: netdev
Add missing validate_addr hook
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
drivers/net/ksz884x.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c
index c80ca64..39e738e 100644
--- a/drivers/net/ksz884x.c
+++ b/drivers/net/ksz884x.c
@@ -6863,6 +6863,7 @@ static const struct net_device_ops netdev_ops = {
.ndo_tx_timeout = netdev_tx_timeout,
.ndo_change_mtu = netdev_change_mtu,
.ndo_set_mac_address = netdev_set_mac_address,
+ .ndo_validate_addr = eth_validate_addr,
.ndo_do_ioctl = netdev_ioctl,
.ndo_set_rx_mode = netdev_set_rx_mode,
#ifdef CONFIG_NET_POLL_CONTROLLER
^ permalink raw reply related
* Re: [PATCH] mac8390: change an error return code and some cleanup, take 4
From: fthain @ 2010-05-31 11:07 UTC (permalink / raw)
To: Geert Uytterhoeven, David Miller
Cc: joe, p_gortmaker, netdev, linux-kernel, linux-m68k
In-Reply-To: <AANLkTilkooBglbk33yDHmk8c_ZdlamOW8FVvuvjQaNsF@mail.gmail.com>
On Mon, 31 May 2010, Geert Uytterhoeven wrote:
>
> `pr_debug()' indeed now may generate code if DEBUG is not defined, i.e.
> if CONFIG_DYNAMIC_DEBUG is enabled. This is intented for debug
> infrastructure the user may want to enable later.
>
> If you want the old behavior, you can use `pr_devel()' instead, which
> only generates code if DEBUG is defined. This is intended for debug
> infrastructure for developers only.
>
> However, you used `printk(KERN_DEBUG pr_fmt()...)`, which always
> generates code. I'm still not 100% sure that was intentional?
Geert, in the beginning, I decided that it should be KERN_DEBUG, not
KERN_INFO, and made that change in the first patch submission. I used
pr_debug().
Then Joe pointed out that this required DEBUG defined, which I'd forgotten
(I didn't know about CONFIG_DYNAMIC_DEBUG). So, to retain the old
behaviour, while following the example of other usages of ei_debug in
lib8390 and drivers, I changed it to printk(KERN_DEBUG ...).
Then Joe pointed out that I should take advantage of pr_fmt(), so the
third submission made that change.
(Then David said I should propagate the return code from request_irq, so I
made the present patch submission.)
Apparently David now wants me to submit this again --
if (ei_debug)
pr_debug(...)
David, if that code is acceptable, please let me know.
If that code is mandatory, why didn't you say so upon the second patch
submission?
Alternatively, if the following is preferred (as implied by your last
email):
if (ei_debug)
pr_info(...)
Then let me know, and I'll quit bothering you.
Or just go ahead and change my patch if you wish to save us both some
time.
Finn
>
> Gr{oetje,eeting}s,
>
> Geert
^ permalink raw reply
* [PATCH] netfilter: don't xt_jumpstack_alloc twice in xt_register_table
From: Xiaotian Feng @ 2010-05-31 11:06 UTC (permalink / raw)
To: netfilter-devel, netfilter, coreteam
Cc: linux-kernel, netdev, Xiaotian Feng, Patrick McHardy,
David S. Miller, Jan Engelhardt, Andrew Morton, Rusty Russell,
Alexey Dobriyan
In xt_register_table, xt_jumpstack_alloc is called first, later
xt_replace_table is used. But in xt_replace_table, xt_jumpstack_alloc
will be used again. Then the memory allocated by previous xt_jumpstack_alloc
will be leaked. We can simply remove the previous xt_jumpstack_alloc because
there aren't any users of newinfo between xt_jumpstack_alloc and
xt_replace_table.
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jan Engelhardt <jengelh@medozas.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
---
net/netfilter/x_tables.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 445de70..47b1e79 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -844,10 +844,6 @@ struct xt_table *xt_register_table(struct net *net,
struct xt_table_info *private;
struct xt_table *t, *table;
- ret = xt_jumpstack_alloc(newinfo);
- if (ret < 0)
- return ERR_PTR(ret);
-
/* Don't add one object to multiple lists. */
table = kmemdup(input_table, sizeof(struct xt_table), GFP_KERNEL);
if (!table) {
--
1.7.0.1
^ permalink raw reply related
* [PATCH] virtio-net: pass gfp to add_buf
From: Rusty Russell @ 2010-05-31 11:10 UTC (permalink / raw)
To: netdev; +Cc: Michael S. Tsirkin
From: "Michael S. Tsirkin" <mst@redhat.com>
(Dave: the virtqueue_add_buf_gfp is in Linus' tree, so please queue
this trivial use now. Thanks!)
virtio-net bounces buffer allocations off to
a thread if it can't allocate buffers from the atomic
pool. However, if posting buffers still requires atomic
buffers, this is unlikely to succeed.
Fix by passing in the proper gfp_t parameter.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
drivers/net/virtio_net.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -341,7 +341,7 @@ static int add_recvbuf_small(struct virt
skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len);
- err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 2, skb);
+ err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 2, skb, gfp);
if (err < 0)
dev_kfree_skb(skb);
@@ -386,8 +386,8 @@ static int add_recvbuf_big(struct virtne
/* chain first in list head */
first->private = (unsigned long)list;
- err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2,
- first);
+ err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2,
+ first, gfp);
if (err < 0)
give_pages(vi, first);
@@ -405,7 +405,7 @@ static int add_recvbuf_mergeable(struct
sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE);
- err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 1, page);
+ err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 1, page, gfp);
if (err < 0)
give_pages(vi, page);
^ permalink raw reply
* [net-next-2.6 PATCH 2/2] be2net: replace udelay() with schedule_timeout() in mbox polling
From: Sathya Perla @ 2010-05-31 9:34 UTC (permalink / raw)
To: netdev
As mbox polling is done only in process context, it is better to
use schedule_timeout() instead of udelay().
Signed-off-by: Sathya Perla <sathyap@serverengines.com>
---
drivers/net/benet/be_cmds.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 9d11dbf..c2bd84c 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -186,7 +186,7 @@ static int be_mcc_notify_wait(struct be_adapter *adapter)
static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
{
- int cnt = 0, wait = 5;
+ int msecs = 0;
u32 ready;
do {
@@ -201,15 +201,14 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
if (ready)
break;
- if (cnt > 4000000) {
+ if (msecs > 4000) {
dev_err(&adapter->pdev->dev, "mbox poll timed out\n");
return -1;
}
- if (cnt > 50)
- wait = 200;
- cnt += wait;
- udelay(wait);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(msecs_to_jiffies(1));
+ msecs++;
} while (true);
return 0;
--
1.6.5.2
^ permalink raw reply related
* [net-next-2.6 PATCH 1/2] be2net: cleanup in case of error in be_open()
From: Sathya Perla @ 2010-05-31 9:33 UTC (permalink / raw)
To: netdev
This patch adds cleanup code (things like unregistering irq,
disabling napi etc) to be_open() when an error occurs inside the
routine.
Signed-off-by: Sathya Perla <sathyap@serverengines.com>
---
drivers/net/benet/be_main.c | 95 ++++++++++++++++++++++---------------------
1 files changed, 49 insertions(+), 46 deletions(-)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 54b1427..3225774 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1735,6 +1735,44 @@ done:
adapter->isr_registered = false;
}
+static int be_close(struct net_device *netdev)
+{
+ struct be_adapter *adapter = netdev_priv(netdev);
+ struct be_eq_obj *rx_eq = &adapter->rx_eq;
+ struct be_eq_obj *tx_eq = &adapter->tx_eq;
+ int vec;
+
+ cancel_delayed_work_sync(&adapter->work);
+
+ be_async_mcc_disable(adapter);
+
+ netif_stop_queue(netdev);
+ netif_carrier_off(netdev);
+ adapter->link_up = false;
+
+ be_intr_set(adapter, false);
+
+ if (adapter->msix_enabled) {
+ vec = be_msix_vec_get(adapter, tx_eq->q.id);
+ synchronize_irq(vec);
+ vec = be_msix_vec_get(adapter, rx_eq->q.id);
+ synchronize_irq(vec);
+ } else {
+ synchronize_irq(netdev->irq);
+ }
+ be_irq_unregister(adapter);
+
+ napi_disable(&rx_eq->napi);
+ napi_disable(&tx_eq->napi);
+
+ /* Wait for all pending tx completions to arrive so that
+ * all tx skbs are freed.
+ */
+ be_tx_compl_clean(adapter);
+
+ return 0;
+}
+
static int be_open(struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
@@ -1765,27 +1803,29 @@ static int be_open(struct net_device *netdev)
/* Now that interrupts are on we can process async mcc */
be_async_mcc_enable(adapter);
+ schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
+
status = be_cmd_link_status_query(adapter, &link_up, &mac_speed,
&link_speed);
if (status)
- goto ret_sts;
+ goto err;
be_link_status_update(adapter, link_up);
- if (be_physfn(adapter))
+ if (be_physfn(adapter)) {
status = be_vid_config(adapter);
- if (status)
- goto ret_sts;
+ if (status)
+ goto err;
- if (be_physfn(adapter)) {
status = be_cmd_set_flow_control(adapter,
adapter->tx_fc, adapter->rx_fc);
if (status)
- goto ret_sts;
+ goto err;
}
- schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
-ret_sts:
- return status;
+ return 0;
+err:
+ be_close(adapter->netdev);
+ return -EIO;
}
static int be_setup_wol(struct be_adapter *adapter, bool enable)
@@ -1913,43 +1953,6 @@ static int be_clear(struct be_adapter *adapter)
return 0;
}
-static int be_close(struct net_device *netdev)
-{
- struct be_adapter *adapter = netdev_priv(netdev);
- struct be_eq_obj *rx_eq = &adapter->rx_eq;
- struct be_eq_obj *tx_eq = &adapter->tx_eq;
- int vec;
-
- cancel_delayed_work_sync(&adapter->work);
-
- be_async_mcc_disable(adapter);
-
- netif_stop_queue(netdev);
- netif_carrier_off(netdev);
- adapter->link_up = false;
-
- be_intr_set(adapter, false);
-
- if (adapter->msix_enabled) {
- vec = be_msix_vec_get(adapter, tx_eq->q.id);
- synchronize_irq(vec);
- vec = be_msix_vec_get(adapter, rx_eq->q.id);
- synchronize_irq(vec);
- } else {
- synchronize_irq(netdev->irq);
- }
- be_irq_unregister(adapter);
-
- napi_disable(&rx_eq->napi);
- napi_disable(&tx_eq->napi);
-
- /* Wait for all pending tx completions to arrive so that
- * all tx skbs are freed.
- */
- be_tx_compl_clean(adapter);
-
- return 0;
-}
#define FW_FILE_HDR_SIGN "ServerEngines Corp. "
char flash_cookie[2][16] = {"*** SE FLAS",
--
1.6.5.2
^ permalink raw reply related
* Re: [PATCH] mac8390: change an error return code and some cleanup, take 4
From: David Miller @ 2010-05-31 11:27 UTC (permalink / raw)
To: fthain; +Cc: joe, p_gortmaker, netdev, linux-kernel, linux-m68k
In-Reply-To: <alpine.LNX.2.00.1005311905520.469@nippy.intranet>
From: fthain@telegraphics.com.au
Date: Mon, 31 May 2010 19:21:26 +1000 (EST)
> Your suggestion to use pr_debug is invoking compile time infrastructure
> (the DEBUG macro), so it is not in the spirit of this commit, and it is
> not relevant to any criticism from you or Joe of the earlier submissions.
>
> Please apply the patch.
I won't do that, because your change elides the pr_fmt prefix Joe
Perches added to the driver for the purposes of making sure such a
prefix would be added to all log messages output by the driver.
The whole idea is that everything the driver puts into the kernel
log has the driver module name at the beginning. That's what the
pr_fmt define at the top of the driver does.
It's so you can tell which driver the message came from.
You're undoing that, which is a bug. It's a step backwards, it's
wrong.
And to top it off we've had to explain this stuff to you multiple
times.
So, as long as the patch is incorrect I absolutely will not apply it.
^ permalink raw reply
* Re: [PATCH] mac8390: change an error return code and some cleanup, take 4
From: David Miller @ 2010-05-31 11:30 UTC (permalink / raw)
To: fthain; +Cc: geert, joe, p_gortmaker, netdev, linux-kernel, linux-m68k
In-Reply-To: <alpine.LNX.2.00.1005312011210.469@nippy.intranet>
From: fthain@telegraphics.com.au
Date: Mon, 31 May 2010 21:07:09 +1000 (EST)
> Apparently David now wants me to submit this again --
>
> if (ei_debug)
> pr_debug(...)
>
> David, if that code is acceptable, please let me know.
The only thing I care about is at the moment that you don't do
something that ends up dropping the pr_fmt prefix.
The pr_fmt define at the beginning of the driver is for nothing
if we end up adding exceptions that end up eliding it for no
good reason. And that's what your patch was doing.
^ permalink raw reply
* Re: [PATCH] netfilter: don't xt_jumpstack_alloc twice in xt_register_table
From: Jan Engelhardt @ 2010-05-31 11:51 UTC (permalink / raw)
To: Xiaotian Feng
Cc: netfilter-devel, netfilter, coreteam, linux-kernel, netdev,
Patrick McHardy, David S. Miller, Andrew Morton, Rusty Russell,
Alexey Dobriyan
In-Reply-To: <1275303998-2435-1-git-send-email-dfeng@redhat.com>
On Monday 2010-05-31 13:06, Xiaotian Feng wrote:
>In xt_register_table, xt_jumpstack_alloc is called first, later
>xt_replace_table is used. But in xt_replace_table, xt_jumpstack_alloc
>will be used again. Then the memory allocated by previous xt_jumpstack_alloc
>will be leaked. We can simply remove the previous xt_jumpstack_alloc because
>there aren't any users of newinfo between xt_jumpstack_alloc and
>xt_replace_table.
Indeed that seems to be so.
>diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
>index 445de70..47b1e79 100644
>--- a/net/netfilter/x_tables.c
>+++ b/net/netfilter/x_tables.c
>@@ -844,10 +844,6 @@ struct xt_table *xt_register_table(struct net *net,
> struct xt_table_info *private;
> struct xt_table *t, *table;
>
>- ret = xt_jumpstack_alloc(newinfo);
>- if (ret < 0)
>- return ERR_PTR(ret);
>-
> /* Don't add one object to multiple lists. */
> table = kmemdup(input_table, sizeof(struct xt_table), GFP_KERNEL);
> if (!table) {
^ permalink raw reply
* Re: [PATCH] IPv6: fix Mobile IPv6 regression
From: Jiri Olsa @ 2010-05-31 12:49 UTC (permalink / raw)
To: Brian Haley
Cc: David Miller, Arnaud Ebalard, Scott C Otto,
YOSHIFUJI Hideaki / 吉藤英明, netdev
In-Reply-To: <20100531084620.GB1929@jolsa.lab.eng.brq.redhat.com>
On Mon, May 31, 2010 at 10:46:20AM +0200, Jiri Olsa wrote:
> On Fri, May 28, 2010 at 02:17:43PM -0400, Brian Haley wrote:
> > Commit f4f914b5 (net: ipv6 bind to device issue) caused
> > a regression with Mobile IPv6 when it changed the meaning
> > of fl->oif to become a strict requirement of the route
> > lookup. Instead, only force strict mode when
> > sk->sk_bound_dev_if is set on the calling socket, getting
> > the intended behavior and fixing the regression.
> >
> > Tested-by: Arnaud Ebalard <arno@natisbad.org>
> > Signed-off-by: Brian Haley <brian.haley@hp.com>
> >
> > diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> > index 294cbe8..252d761 100644
> > --- a/net/ipv6/route.c
> > +++ b/net/ipv6/route.c
> > @@ -814,7 +814,7 @@ struct dst_entry * ip6_route_output(struct net *net, struct sock *sk,
> > {
> > int flags = 0;
> >
> > - if (fl->oif || rt6_need_strict(&fl->fl6_dst))
> > + if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl->fl6_dst))
> > flags |= RT6_LOOKUP_F_IFACE;
> >
> > if (!ipv6_addr_any(&fl->fl6_src))
> hi,
>
> sorry for the late reply, I was out last week..
>
> the change looks ok, I'll verify it with the reproducer
> I used for the last fix
>
> thanks,
> jirka
it passed the test for me, so it looks fine
jirka
^ permalink raw reply
* Re: [PATCH] mac8390: change an error return code and some cleanup, take 4
From: Finn Thain @ 2010-05-31 12:55 UTC (permalink / raw)
To: David Miller; +Cc: geert, joe, p_gortmaker, netdev, linux-kernel, linux-m68k
In-Reply-To: <20100531.043056.258120791.davem@davemloft.net>
On Mon, 31 May 2010, David Miller wrote:
> From: fthain@telegraphics.com.au
> Date: Mon, 31 May 2010 21:07:09 +1000 (EST)
>
> > Apparently David now wants me to submit this again --
> >
> > if (ei_debug)
> > pr_debug(...)
> >
> > David, if that code is acceptable, please let me know.
>
> The only thing I care about is at the moment that you don't do something
> that ends up dropping the pr_fmt prefix.
>
> The pr_fmt define at the beginning of the driver is for nothing if we
> end up adding exceptions that end up eliding it for no good reason.
> And that's what your patch was doing.
>
Since you have rejected my most recent patch submission, which uses pr_fmt
explicitly, I imagine that what you are trying to say here is that only
pr_debug or pr_info are acceptable.
Now, so that we don't have to go through pointless resubmission
iterations, can you tell me which of the following you prefer:
if (ei_debug)
pr_debug(...)
OR
if (ei_debug)
pr_info(...)
Thanks.
Finn
^ permalink raw reply
* Re: [PATCH] mac8390: change an error return code and some cleanup, take 4
From: David Miller @ 2010-05-31 13:02 UTC (permalink / raw)
To: fthain; +Cc: geert, joe, p_gortmaker, netdev, linux-kernel, linux-m68k
In-Reply-To: <alpine.OSX.2.00.1005312244520.1490@localhost>
From: Finn Thain <fthain@telegraphics.com.au>
Date: Mon, 31 May 2010 22:55:23 +1000 (EST)
> if (ei_debug)
> pr_debug(...)
>
> OR
>
> if (ei_debug)
> pr_info(...)
Well for the printk in question, it's telling the user that
a certain feature can't be enabled.
And if the driver has an explicit way to control this message,
using ei_debug, it's kind of redundant to slap another layer on
top by using the debug printk facility.
Changing this to a debug log level printk is only going to make
getting the debug message shown harder for the user. So leaving it at
pr_info() is just as correct in my eyes.
Finally, your patch has so many problems getting applied because
you're doing multiple things in one patch.
And in fact I've asked you not to do this on several occiaions.
Fix the error return codes in one patch, and nothing more.
Then in another you can masterbate with printk log levels.
^ permalink raw reply
* [PATCH] phylib: Add support for the LXT973 phy.
From: Richard Cochran @ 2010-05-31 13:09 UTC (permalink / raw)
To: netdev
This patch implements a work around for Erratum 5, "3.3 V Fiber Speed
Selection." If the hardware wiring does not respect this erratum, then
fiber optic mode will not work properly.
Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
---
drivers/net/phy/lxt.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 50 insertions(+), 1 deletions(-)
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
index 057ecaa..c3de582 100644
--- a/drivers/net/phy/lxt.c
+++ b/drivers/net/phy/lxt.c
@@ -53,6 +53,9 @@
#define MII_LXT971_ISR 19 /* Interrupt Status Register */
+/* register definitions for the 973 */
+#define MII_LXT973_PCR 16 /* Port Configuration Register */
+#define PCR_FIBER_SELECT 1
MODULE_DESCRIPTION("Intel LXT PHY driver");
MODULE_AUTHOR("Andy Fleming");
@@ -119,6 +122,33 @@ static int lxt971_config_intr(struct phy_device *phydev)
return err;
}
+static int lxt973_probe(struct phy_device *phydev)
+{
+ int val = phy_read(phydev, MII_LXT973_PCR);
+
+ if (val & PCR_FIBER_SELECT) {
+ /*
+ * If fiber is selected, then the only correct setting
+ * is 100Mbps, full duplex, and auto negotiation off.
+ */
+ val = phy_read(phydev, MII_BMCR);
+ val |= (BMCR_SPEED100 | BMCR_FULLDPLX);
+ val &= ~BMCR_ANENABLE;
+ phy_write(phydev, MII_BMCR, val);
+ /* Remember that the port is in fiber mode. */
+ phydev->priv = lxt973_probe;
+ } else {
+ phydev->priv = NULL;
+ }
+ return 0;
+}
+
+static int lxt973_config_aneg(struct phy_device *phydev)
+{
+ /* Do nothing if port is in fiber mode. */
+ return phydev->priv ? 0 : genphy_config_aneg(phydev);
+}
+
static struct phy_driver lxt970_driver = {
.phy_id = 0x78100000,
.name = "LXT970",
@@ -146,6 +176,18 @@ static struct phy_driver lxt971_driver = {
.driver = { .owner = THIS_MODULE,},
};
+static struct phy_driver lxt973_driver = {
+ .phy_id = 0x00137a10,
+ .name = "LXT973",
+ .phy_id_mask = 0xfffffff0,
+ .features = PHY_BASIC_FEATURES,
+ .flags = 0,
+ .probe = lxt973_probe,
+ .config_aneg = lxt973_config_aneg,
+ .read_status = genphy_read_status,
+ .driver = { .owner = THIS_MODULE,},
+};
+
static int __init lxt_init(void)
{
int ret;
@@ -157,9 +199,15 @@ static int __init lxt_init(void)
ret = phy_driver_register(&lxt971_driver);
if (ret)
goto err2;
+
+ ret = phy_driver_register(&lxt973_driver);
+ if (ret)
+ goto err3;
return 0;
- err2:
+ err3:
+ phy_driver_unregister(&lxt971_driver);
+ err2:
phy_driver_unregister(&lxt970_driver);
err1:
return ret;
@@ -169,6 +217,7 @@ static void __exit lxt_exit(void)
{
phy_driver_unregister(&lxt970_driver);
phy_driver_unregister(&lxt971_driver);
+ phy_driver_unregister(&lxt973_driver);
}
module_init(lxt_init);
--
1.6.3.3
^ permalink raw reply related
* [PATCH] ixp4xx: Support the all multicast flag on the NPE devices.
From: Richard Cochran @ 2010-05-31 13:11 UTC (permalink / raw)
To: Krzysztof Halasa; +Cc: netdev, linux-arm-kernel
This patch adds support for the IFF_ALLMULTI flag. Previously only the
IFF_PROMISC flag was supported.
Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
---
drivers/net/arm/ixp4xx_eth.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c
index 6be8b09..5d35064 100644
--- a/drivers/net/arm/ixp4xx_eth.c
+++ b/drivers/net/arm/ixp4xx_eth.c
@@ -739,6 +739,17 @@ static void eth_set_mcast_list(struct net_device *dev)
struct dev_mc_list *mclist;
u8 diffs[ETH_ALEN], *addr;
int i;
+ u8 allmulti[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 };
+
+ if (dev->flags & IFF_ALLMULTI) {
+ for (i = 0; i < ETH_ALEN; i++) {
+ __raw_writel(allmulti[i], &port->regs->mcast_addr[i]);
+ __raw_writel(allmulti[i], &port->regs->mcast_mask[i]);
+ }
+ __raw_writel(DEFAULT_RX_CNTRL0 | RX_CNTRL0_ADDR_FLTR_EN,
+ &port->regs->rx_control[0]);
+ return;
+ }
if ((dev->flags & IFF_PROMISC) || netdev_mc_empty(dev)) {
__raw_writel(DEFAULT_RX_CNTRL0 & ~RX_CNTRL0_ADDR_FLTR_EN,
--
1.6.3.3
^ permalink raw reply related
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