* Re: [net-next-2.6 PATCH 2/3] bonding: add Speed/Duplex information to /proc/net/bonding/bond
From: David Miller @ 2010-10-07 1:44 UTC (permalink / raw)
To: ole; +Cc: fubar, bonding-devel, netdev
In-Reply-To: <4CACEADA.70009@ans.pl>
From: Krzysztof Olędzki <ole@ans.pl>
Date: Wed, 06 Oct 2010 23:32:10 +0200
> Please note however that this procfs file was recently changed ("Slave
> queue ID" was added) so if this is indeed a problem than we would
> already heard about this.
You make a good argument, therefore I have decided to apply
your patch.
Thanks.
^ permalink raw reply
* Re: [PATCH] Documentation/networking/ixgbevf.txt: Change file permissions to 644
From: Joe Perches @ 2010-10-07 1:52 UTC (permalink / raw)
To: David Miller; +Cc: jeffrey.t.kirsher, netdev, rdunlap, gregory.v.rose
In-Reply-To: <20101006.184215.35062616.davem@davemloft.net>
On Wed, 2010-10-06 at 18:42 -0700, David Miller wrote:
> So I won't actually be applying this patch.
No worries, happy it's getting resolved.
I sent a patch to checkpatch so these could be avoided
in the future. Maybe Andy W has a better idea.
^ permalink raw reply
* Re: [PATCH] Documentation/networking/ixgbevf.txt: Change file permissions to 644
From: David Miller @ 2010-10-07 1:59 UTC (permalink / raw)
To: joe; +Cc: jeffrey.t.kirsher, netdev, rdunlap, gregory.v.rose
In-Reply-To: <1286416346.3292.2.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Wed, 06 Oct 2010 18:52:26 -0700
> On Wed, 2010-10-06 at 18:42 -0700, David Miller wrote:
>> So I won't actually be applying this patch.
>
> No worries, happy it's getting resolved.
>
> I sent a patch to checkpatch so these could be avoided
> in the future. Maybe Andy W has a better idea.
GIT would probably be a better place to detect this, even if
it's not on by default I would enable it in my own personal
.gitconfig
^ permalink raw reply
* Re: linux-next: manual merge of the net tree with the net-current tree
From: David Miller @ 2010-10-07 2:35 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, eric.dumazet, joe
In-Reply-To: <20101007123104.bf7a9808.sfr@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 7 Oct 2010 12:31:04 +1100
> Hi all,
>
> Today's linux-next merge of the net tree got a conflict in
> net/caif/caif_socket.c between commit
> 79315068f4560f3f7bd6e9790190dcb43059770c ("caif: fix two caif_connect()
> bugs") from the net-current tree and commit
> b31fa5bad576cd8180a5ad70c648333b44320d44 ("net/caif: Use pr_fmt") from
> the net tree.
>
> I fixed it up (see below) and can carry the fix as necessary.
Thanks Stephen, I'm merging net-2.6 into net-next-2.6 right now
to resolve this.
Thanks!
^ permalink raw reply
* [PATCH] TCP: Fix setting of snd_ssthresh in tcp_mtu_probe_success
From: John Heffner @ 2010-10-07 3:41 UTC (permalink / raw)
To: davem; +Cc: netdev
This looks like a simple typo that has gone unnoticed for some time. The
impact is relatively low but it's clearly wrong.
Signed-off-by: John Heffner <johnwheffner@gmail.com>
---
net/ipv4/tcp_input.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index f6fdd72..e4fbdae 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2874,7 +2874,7 @@ static void tcp_mtup_probe_success(struct sock *sk)
icsk->icsk_mtup.probe_size;
tp->snd_cwnd_cnt = 0;
tp->snd_cwnd_stamp = tcp_time_stamp;
- tp->rcv_ssthresh = tcp_current_ssthresh(sk);
+ tp->snd_ssthresh = tcp_current_ssthresh(sk);
icsk->icsk_mtup.search_low = icsk->icsk_mtup.probe_size;
icsk->icsk_mtup.probe_size = 0;
--
1.7.0.4
^ permalink raw reply related
* [RFC] net: allow FEC driver to not have attached PHY
From: Greg Ungerer @ 2010-10-07 3:50 UTC (permalink / raw)
To: netdev; +Cc: gerg
Hi All,
I have a board with a ColdFire SoC on it with the built-in FEC
ethernet module. On this hardware the FEC eth output is directly
attached to a RTL8305 4-port 10/100 switch. There is no conventional
PHY, the FEC output is direct into the uplink port of the switch
chip.
This setup doesn't work after the FEC code was switch to using
phylib. The driver used to have code to bypass phy detection/setup
for this particular board. The phylib probe finds nothing, and of
course sets a no-link condition.
So, what is the cleanest way to support this?
The attached patch adds a config option to do this sort of generically
for the FEC driver. But I am wondering if there isn't a better way?
Regards
Greg
---
[RFC] net: allow FEC driver to not have attached PHY
At least one board using the FEC driver does not have a conventional
PHY attached to it, it is directly connected to a somewhat simple
ethernet switch (the board is the SnapGear/LITE, and the attached
4-port ethernet switch is a RealTek RTL8305). This switch does not
present the usual register interface of a PHY, it presents nothing.
So a PHY scan will find nothing.
After the FEC driver was changed to use phylib for supporting phys
it no longer works on this particular board/switch setup.
Add a config option to allow configuring the FEC driver to not expect
a PHY to be present.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
drivers/net/Kconfig | 9 +++++++++
drivers/net/fec.c | 7 +++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 93494e2..ee44728 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1934,6 +1934,15 @@ config FEC2
Say Y here if you want to use the second built-in 10/100 Fast
ethernet controller on some Motorola ColdFire processors.
+config FEC_NOPHY
+ bool "FEC has no attached PHY"
+ depends on FEC
+ help
+ Some boards using the FEC driver may not have a PHY directly
+ attached to it. Typically in this scenario the FEC output is
+ directly connected to the input of an ethernet switch or hub.
+ Say Y here if your hardware is like this.
+
config FEC_MPC52xx
tristate "MPC52xx FEC driver"
depends on PPC_MPC52xx && PPC_BESTCOMM
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 768b840..3637f89 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -910,6 +910,11 @@ fec_enet_open(struct net_device *dev)
if (ret)
return ret;
+#ifdef CONFIG_FEC_NOPHY
+ /* No PHY connected, assume link is always up */
+ fep->link = 1;
+ fec_restart(dev, 0);
+#else
/* Probe and connect to PHY when open the interface */
ret = fec_enet_mii_probe(dev);
if (ret) {
@@ -917,6 +922,8 @@ fec_enet_open(struct net_device *dev)
return ret;
}
phy_start(fep->phy_dev);
+#endif
+
netif_start_queue(dev);
fep->opened = 1;
return 0;
^ permalink raw reply related
* Re: [PATCH] TCP: Fix setting of snd_ssthresh in tcp_mtu_probe_success
From: David Miller @ 2010-10-07 4:18 UTC (permalink / raw)
To: johnwheffner; +Cc: netdev
In-Reply-To: <1286422913-30034-1-git-send-email-johnwheffner@gmail.com>
From: John Heffner <johnwheffner@gmail.com>
Date: Wed, 6 Oct 2010 23:41:53 -0400
> This looks like a simple typo that has gone unnoticed for some time. The
> impact is relatively low but it's clearly wrong.
>
> Signed-off-by: John Heffner <johnwheffner@gmail.com>
Amazing how long something like this can survive :-)
Applied, thanks John.
^ permalink raw reply
* Re: Segmentation fault when using ping6
From: Baruch Siach @ 2010-10-07 5:32 UTC (permalink / raw)
To: Rogerio Pimentel; +Cc: netdev, linux-arm-kernel
In-Reply-To: <4CACDBB1.9050305@freescale.com>
Hi Rogerio,
On Wed, Oct 06, 2010 at 05:27:29PM -0300, Rogerio Pimentel wrote:
> I'm having a "segmentation fault" problem when using ping6.
>
> When testing on ARM9 platforms (i.MX25 and i.MX27), it returns the error:
>
> root@freescale ~$ ping6 ::1
> PING ::1 (::1): 56 data bytes
> Segmentation fault
>
> When testing on ARM11 and ARM Cortex A8 platforms (i.MX31 and
> i.MX51), it works:
>
> root@freescale ~$ ping6 ::1
> PING ::1 (::1): 56 data bytes
> 64 bytes from ::1: seq=0 ttl=64 time=0.331 ms
> 64 bytes from ::1: seq=1 ttl=64 time=0.214 ms
> 64 bytes from ::1: seq=2 ttl=64 time=0.176 ms
> 64 bytes from ::1: seq=3 ttl=64 time=0.155 ms
>
> On all cases, I'm using Linux Kernel 2.6.35 (from Mainline) and
> Busybox 1.15.0
>
> Does anybody have any idea?
This seems to be a Busybox related issue. I'd suggests you to try the latest
version of Busybox (1.17.2), and if the problem persists, ask at the Busybox
mailing list. Don't forget to add strace output to your message.
baruch
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply
* Re: [PATCH -next] sundance: Drop legacy _COMPAT_WITH_OLD_KERNEL includes
From: David Miller @ 2010-10-07 6:11 UTC (permalink / raw)
To: dkirjanov; +Cc: netdev
In-Reply-To: <20101006135956.GA5556@hera.kernel.org>
From: Denis Kirjanov <dkirjanov@kernel.org>
Date: Wed, 6 Oct 2010 13:59:56 +0000
> Drop legacy includes since 2.4.x
>
> Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next] dccp:
From: David Miller @ 2010-10-07 6:12 UTC (permalink / raw)
To: shemminger; +Cc: acme, dccp, netdev
In-Reply-To: <20101005232409.61cb9412@s6510>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 5 Oct 2010 23:24:09 +0900
> Remove dead code and make some functions static.
> Compile tested only.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Looks good, applied, thanks.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] net: netif_set_real_num_rx_queues may cap num_rx_queues at init time
From: Eric Dumazet @ 2010-10-07 6:16 UTC (permalink / raw)
To: John Fastabend; +Cc: bhutchings, netdev, therbert
In-Reply-To: <20101004220042.3471.92774.stgit@jf-dev1-dcblab>
Le lundi 04 octobre 2010 à 15:00 -0700, John Fastabend a écrit :
> The logic for netif_set_real_num_rx_queues is the following,
>
...
> Because netif_set_real_num_rx_queues sets num_rx_queues if the
> reg state is not NETREG_REGISTERED we end up with the incorrect
> max number of rx queues. This patch proposes to remove the else
> clause above so this does not occur. Also just reading the
> function set_real_num it seems a bit unexpected that num_rx_queues
> gets set.
>
> CC: Ben Hutchings <bhutchings@solarflare.com>
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
^ permalink raw reply
* Re: [patch] eicon: make buffer larger
From: David Miller @ 2010-10-07 6:30 UTC (permalink / raw)
To: error27; +Cc: mac, isdn, netdev, linux-kernel, kernel-janitors
In-Reply-To: <20101004192459.GE5692@bicker>
From: Dan Carpenter <error27@gmail.com>
Date: Mon, 4 Oct 2010 21:24:59 +0200
> In diva_mnt_add_xdi_adapter() we do this:
> strcpy (clients[id].drvName, tmp);
> strcpy (clients[id].Dbg.drvName, tmp);
>
> The "clients[id].drvName" is a 128 character buffer and
> "clients[id].Dbg.drvName" was originally a 16 character buffer but I've
> changed it to 128 as well. We don't actually use 128 characters but we
> do use more than 16.
>
> I've also changed the size of "tmp" to 128 characters instead of 256.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] net: netif_set_real_num_rx_queues may cap num_rx_queues at init time
From: David Miller @ 2010-10-07 6:35 UTC (permalink / raw)
To: eric.dumazet; +Cc: john.r.fastabend, bhutchings, netdev, therbert
In-Reply-To: <1286432199.9417.47.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 07 Oct 2010 08:16:39 +0200
> Le lundi 04 octobre 2010 à 15:00 -0700, John Fastabend a écrit :
>> The logic for netif_set_real_num_rx_queues is the following,
>>
>
>
> ...
>
>> Because netif_set_real_num_rx_queues sets num_rx_queues if the
>> reg state is not NETREG_REGISTERED we end up with the incorrect
>> max number of rx queues. This patch proposes to remove the else
>> clause above so this does not occur. Also just reading the
>> function set_real_num it seems a bit unexpected that num_rx_queues
>> gets set.
>>
>> CC: Ben Hutchings <bhutchings@solarflare.com>
>>
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>> ---
>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks everyone.
^ permalink raw reply
* Re: [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
From: David Miller @ 2010-10-07 6:36 UTC (permalink / raw)
To: hawk; +Cc: netdev, jeffrey.t.kirsher
In-Reply-To: <20101005141833.20929.10943.stgit@localhost>
From: Jesper Dangaard Brouer <hawk@comx.dk>
Date: Tue, 05 Oct 2010 16:18:33 +0200
> Network driver igb: Improve the accuracy of stats in /proc/net/dev, by
> updating the adapter stats when reading /proc/net/dev. Currently the
> stats are updated by the watchdog timer every 2 sec, or when getting
> stats via ethtool -S.
>
> A number of userspace apps read these /proc/net/dev stats every second,
> e.g. ifstat, which then gives a perceived very bursty traffic pattern,
> which is actually false.
>
> Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
I assume that the Intel folks will take care of integrating this
now that the locking is fixed.
Thanks.
^ permalink raw reply
* Re: [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
From: Eric Dumazet @ 2010-10-07 6:44 UTC (permalink / raw)
To: David Miller; +Cc: hawk, netdev, jeffrey.t.kirsher
In-Reply-To: <20101006.233611.68115178.davem@davemloft.net>
Le mercredi 06 octobre 2010 à 23:36 -0700, David Miller a écrit :
> From: Jesper Dangaard Brouer <hawk@comx.dk>
> Date: Tue, 05 Oct 2010 16:18:33 +0200
>
> > Network driver igb: Improve the accuracy of stats in /proc/net/dev, by
> > updating the adapter stats when reading /proc/net/dev. Currently the
> > stats are updated by the watchdog timer every 2 sec, or when getting
> > stats via ethtool -S.
> >
> > A number of userspace apps read these /proc/net/dev stats every second,
> > e.g. ifstat, which then gives a perceived very bursty traffic pattern,
> > which is actually false.
> >
> > Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
>
> I assume that the Intel folks will take care of integrating this
> now that the locking is fixed.
>
I integrated Jesper patch into my cumulative patch.
BTW, ixgbe has similar locking problem.
^ permalink raw reply
* Re: [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
From: David Miller @ 2010-10-07 6:46 UTC (permalink / raw)
To: eric.dumazet; +Cc: hawk, netdev, jeffrey.t.kirsher
In-Reply-To: <1286433848.9417.49.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 07 Oct 2010 08:44:08 +0200
> Le mercredi 06 octobre 2010 à 23:36 -0700, David Miller a écrit :
>> From: Jesper Dangaard Brouer <hawk@comx.dk>
>> Date: Tue, 05 Oct 2010 16:18:33 +0200
>>
>> > Network driver igb: Improve the accuracy of stats in /proc/net/dev, by
>> > updating the adapter stats when reading /proc/net/dev. Currently the
>> > stats are updated by the watchdog timer every 2 sec, or when getting
>> > stats via ethtool -S.
>> >
>> > A number of userspace apps read these /proc/net/dev stats every second,
>> > e.g. ifstat, which then gives a perceived very bursty traffic pattern,
>> > which is actually false.
>> >
>> > Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
>>
>> I assume that the Intel folks will take care of integrating this
>> now that the locking is fixed.
>>
>
> I integrated Jesper patch into my cumulative patch.
Ok.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] ixgbe: Use affinity_hint when Flow Director is enabled
From: David Miller @ 2010-10-07 6:48 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, peter.p.waskiewicz.jr
In-Reply-To: <20101005112511.23263.64121.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 05 Oct 2010 04:27:49 -0700
> From: Peter Waskiewicz <peter.p.waskiewicz.jr@intel.com>
>
> Use the new infrastructure to balance interrupts for flow
> alignment when ATR or Flow Director are enabled.
>
> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Tested-by: Stephen Ko <stephen.s.ko@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied, thanks.
^ permalink raw reply
* Re: sending VLAN packets via packet_mmap
From: David Miller @ 2010-10-07 6:53 UTC (permalink / raw)
To: phil; +Cc: netdev, johann.baudy, eric.dumazet
In-Reply-To: <20100930192414.GD26509@orbit.nwl.cc>
From: Phil Sutter <phil@nwl.cc>
Date: Thu, 30 Sep 2010 21:24:14 +0200
> The actual problem in tpacket_snd() is this:
>
> | reserve = dev->hard_header_len;
> | [...]
> | if (size_max > dev->mtu + reserve)
> | size_max = dev->mtu + reserve;
>
> I guess the check is there to avoid skb overflows on malicious data
> input. Is this correct? Are there other reasons for it's existence?
We can add a special allowance of 4 extra bytes in this size check
_iff_ the device is ethernet and the NETIF_F_VLAN_CHALLENGED netdev
feature bit is not set.
^ permalink raw reply
* Re: ixgbe: normalize frag_list usage
From: David Miller @ 2010-10-07 6:58 UTC (permalink / raw)
To: alexander.h.duyck
Cc: jeffrey.t.kirsher, jesse.brandeburg, bruce.w.allan, netdev
In-Reply-To: <80769D7B14936844A23C0C43D9FBCF0F25B97A24B5@orsmsx501.amr.corp.intel.com>
From: "Duyck, Alexander H" <alexander.h.duyck@intel.com>
Date: Tue, 5 Oct 2010 15:45:32 -0700
> The patch below is kind of what I had in mind for a way to do RSC and maintain
> the pointer scheme you are looking for. Consider this patch an RFC for now
> since I based this off of Jeff's internal testing tree and so it would need
> some modification to apply cleanly to net-next.
Can you really not remember the head somewhere?
What I wanted is for everyone to build their frag list SKBs from head to tail,
always. So that I could, as I mentioned in my original posting, do something
like:
struct sk_buff {
union {
struct list_head list;
struct {
struct sk_buff *frag_next;
struct sk_buff *frag_tail_tracker;
};
};
};
The ->frag_tail_tracker is only used in the head SKB to maintain where the
last SKB in the frag list is.
You're tracking the head from the inner SKBs, such that my intended
conventions are not being followed.
^ permalink raw reply
* Re: [PATCH] sysctl: fix min/max handling in __do_proc_doulongvec_minmax()
From: Américo Wang @ 2010-10-07 7:18 UTC (permalink / raw)
To: Américo Wang
Cc: Eric Dumazet, Robin Holt, Andrew Morton, linux-kernel,
Willy Tarreau, David S. Miller, netdev, James Morris,
Pekka Savola (ipv6), Patrick McHardy, Alexey Kuznetsov, ebiederm
In-Reply-To: <20101005130117.GK5170@cr0.nay.redhat.com>
On Tue, Oct 05, 2010 at 09:01:17PM +0800, Américo Wang wrote:
>On Mon, Oct 04, 2010 at 12:38:21PM +0200, Eric Dumazet wrote:
>>Le lundi 04 octobre 2010 à 18:35 +0800, Américo Wang a écrit :
>>
>>> Your patch does fix the problem, but seems not a good solution,
>>> we should skip all min/max checking if ->extra(1|2) is NULL,
>>> instead of checking it every time within the loop.
>>
>>Please do submit a patch, we'll see if you come to a better solution,
>>with no added code size (this is slow path, I dont care for checking it
>>'every time winthin the loop')
>>
>>
>
>I have one, but just did compile test. :)
>I will test it tomorrow.
>
Here is the final one.
--------------->
Eric D. noticed that we may trigger an OOPS if we leave ->extra{1,2}
to NULL when we use proc_doulongvec_minmax().
Actually, we don't need to store min/max values in a vector,
because all the elements in the vector should share the same min/max
value, like what proc_dointvec_minmax() does.
This also shrinks the binary size a little bit.
text data bss dec hex filename
12419 8744 4016 25179 625b kernel/sysctl.o.BEFORE
12395 8744 4024 25163 624b kernel/sysctl.o.AFTER
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Eric W. <ebiederm@xmission.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
---
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index f88552c..ba5e511 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2448,86 +2448,119 @@ int proc_dointvec_minmax(struct ctl_table *table, int write,
do_proc_dointvec_minmax_conv, ¶m);
}
-static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
- void __user *buffer,
+static int __doulongvec_minmax_read(void *data, void __user *buffer,
size_t *lenp, loff_t *ppos,
unsigned long convmul,
unsigned long convdiv)
{
- unsigned long *i, *min, *max;
- int vleft, first = 1, err = 0;
- unsigned long page = 0;
- size_t left;
- char *kbuf;
+ unsigned long *i = (unsigned long *) data;
+ int err = 0;
+ bool first = true;
+ size_t left = *lenp;
- if (!data || !table->maxlen || !*lenp || (*ppos && !write)) {
- *lenp = 0;
- return 0;
+ for (; left; i++, first=false) {
+ unsigned long val;
+
+ val = convdiv * (*i) / convmul;
+ if (!first)
+ err = proc_put_char(&buffer, &left, '\t');
+ err = proc_put_long(&buffer, &left, val, false);
+ if (err)
+ break;
}
- i = (unsigned long *) data;
- min = (unsigned long *) table->extra1;
- max = (unsigned long *) table->extra2;
- vleft = table->maxlen / sizeof(unsigned long);
- left = *lenp;
+ if (!first && left && !err)
+ err = proc_put_char(&buffer, &left, '\n');
- if (write) {
- if (left > PAGE_SIZE - 1)
- left = PAGE_SIZE - 1;
- page = __get_free_page(GFP_TEMPORARY);
- kbuf = (char *) page;
- if (!kbuf)
- return -ENOMEM;
- if (copy_from_user(kbuf, buffer, left)) {
- err = -EFAULT;
- goto free;
- }
- kbuf[left] = 0;
+ *lenp -= left;
+ *ppos += *lenp;
+ return err;
+}
+
+static int __doulongvec_minmax_write(void *data, void __user *buffer,
+ size_t *lenp, loff_t *ppos, int vleft,
+ unsigned long min, unsigned long max)
+{
+ char *kbuf;
+ size_t left = *lenp;
+ unsigned long page = 0;
+ unsigned long *i = (unsigned long *) data;
+ int err = 0;
+ bool first = true;
+
+ if (left > PAGE_SIZE - 1)
+ left = PAGE_SIZE - 1;
+ page = __get_free_page(GFP_TEMPORARY);
+ kbuf = (char *) page;
+ if (!kbuf)
+ return -ENOMEM;
+ if (copy_from_user(kbuf, buffer, left)) {
+ err = -EFAULT;
+ goto free;
}
+ kbuf[left] = 0;
- for (; left && vleft--; i++, min++, max++, first=0) {
+ for (; left && vleft--; i++, first=false) {
unsigned long val;
+ bool neg;
- if (write) {
- bool neg;
-
- left -= proc_skip_spaces(&kbuf);
+ left -= proc_skip_spaces(&kbuf);
- err = proc_get_long(&kbuf, &left, &val, &neg,
- proc_wspace_sep,
- sizeof(proc_wspace_sep), NULL);
- if (err)
- break;
- if (neg)
- continue;
- if ((min && val < *min) || (max && val > *max))
- continue;
- *i = val;
- } else {
- val = convdiv * (*i) / convmul;
- if (!first)
- err = proc_put_char(&buffer, &left, '\t');
- err = proc_put_long(&buffer, &left, val, false);
- if (err)
- break;
- }
+ err = proc_get_long(&kbuf, &left, &val, &neg,
+ proc_wspace_sep,
+ sizeof(proc_wspace_sep), NULL);
+ if (err)
+ break;
+ if (neg)
+ continue;
+ if (val < min || val > max)
+ continue;
+ *i = val;
}
- if (!write && !first && left && !err)
- err = proc_put_char(&buffer, &left, '\n');
- if (write && !err)
+ if (!err)
left -= proc_skip_spaces(&kbuf);
free:
- if (write) {
- free_page(page);
- if (first)
- return err ? : -EINVAL;
- }
+ free_page(page);
+ if (first)
+ return err ? : -EINVAL;
+
*lenp -= left;
*ppos += *lenp;
return err;
}
+static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
+ void __user *buffer,
+ size_t *lenp, loff_t *ppos,
+ unsigned long convmul,
+ unsigned long convdiv)
+{
+ if (!data || !table->maxlen || !*lenp || (*ppos && !write)) {
+ *lenp = 0;
+ return 0;
+ }
+
+ if (write) {
+ unsigned long min, max;
+ int vleft;
+
+ vleft = table->maxlen / sizeof(unsigned long);
+ if (table->extra1)
+ min = *(unsigned long *) table->extra1;
+ else
+ min = 0;
+ if (table->extra2)
+ max = *(unsigned long *) table->extra2;
+ else
+ max = ULONG_MAX;
+ return __doulongvec_minmax_write(data, buffer, lenp,
+ ppos, vleft, min, max);
+ } else
+ return __doulongvec_minmax_read(data, buffer, lenp,
+ ppos, convmul, convdiv);
+}
+
static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
^ permalink raw reply related
* Re: pull-request: bluetooth-2.6 2010-10-05
From: David Miller @ 2010-10-07 8:02 UTC (permalink / raw)
To: padovan; +Cc: linville, marcel, linux-bluetooth, netdev
In-Reply-To: <20101005171349.GA16520@vigoh>
From: "Gustavo F. Padovan" <padovan@profusion.mobi>
Date: Tue, 5 Oct 2010 14:13:49 -0300
> In this patch set we have two fixes for regressions in L2CAP due to ERTM code
> we added in L2CAP for 2.6.36, a bugfix in the L2CAP Streaming Mode that was
> making the kernel crash. And a fix for a deadlock issue between the sk_sndbuf
> and the backlog queue in ERTM. The rest are also needed bug fixes.
Pulled, thanks.
^ permalink raw reply
* BUG ? ipip unregister_netdevice_many()
From: Hans Schillstrom @ 2010-10-07 8:48 UTC (permalink / raw)
To: netdev@vger.kernel.org; +Cc: Eric W. Biederman, Daniel Lezcano
Hello
I'm trying to exit a network name space and it doesn't work (or am I doing something wrong?)
The only netdevices left are lo and the tunnels ip6tnl0, sit0 and tunl0 when exiting netns.
A netns is created by lxc-execute with two interfaces eth0 eth1 (macvlan)
(see conf file at the end)
Kernel: net-next-2.6 top from 4 october 2010
I added some printk's inn ipip.c ipip_exit_net()
...
rtnl_lock();
printk(KERN_ERR "ipip_exit_net(enter)\n");
ipip_destroy_tunnels(ipn, &list);
printk(KERN_ERR "ipip_exit_net(1)\n");
unregister_netdevice_queue(ipn->fb_tunnel_dev, &list);
printk(KERN_ERR "ipip_exit_net(2)\n");
unregister_netdevice_many(&list);
printk(KERN_ERR "ipip_exit_net(3)\n");
rtnl_unlock();
printk(KERN_ERR "ipip_exit_net(exit)\n");
Exit steps:
===== Screen dump =====
# ifconfig eth0 0.0.0.0 down
# ifconfig eth1 0.0.0.0 down
# ifconfig lo 0.0.0.0 down
# ip li de eth0
# ip li de eth1
# ifconfig -a
ip6tnl0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:1460 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
LOOPBACK MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
tunl0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
# ps
PID USER VSZ STAT COMMAND
1 root 12412 S /usr/lib64/lxc/lxc-init -- /var/bin/init
2 root 4540 S /bin/ash /var/bin/init
7 root 6640 S inetd
8 root 4544 S /bin/ash
26 root 4544 R ps
# lsmod
Module Size Used by Not tainted
macvlan 8709 0
pcnet32 29549 0
tg3 112093 0
libphy 21043 1 tg3
# kill 7 2
# ps
PID USER VSZ STAT COMMAND
1 root 12412 S /usr/lib64/lxc/lxc-init -- /var/bin/init
8 root 4544 S /bin/ash
28 root 4544 R ps
# exit ( here is the exit from netns )
# ipip_exit_net(enter)
ipip_exit_net(1)
ipip_exit_net(2)
------------[ cut here ]------------
WARNING: at /home/hans/evip/kvm/net-next-2.6/kernel/sysctl.c:1953 unregister_sysctl_table+0xc7/0xf9()
Hardware name: Bochs
Modules linked in: macvlan pcnet32 tg3 libphy
Pid: 5, comm: kworker/u:0 Not tainted 2.6.36-rc3+ #7
Call Trace:
[<ffffffff8103e281>] warn_slowpath_common+0x85/0x9d
[<ffffffff8103e2b3>] warn_slowpath_null+0x1a/0x1c
[<ffffffff81045e64>] unregister_sysctl_table+0xc7/0xf9
[<ffffffff812c86a5>] neigh_sysctl_unregister+0x27/0x3f
[<ffffffff81342108>] addrconf_ifdown+0x415/0x45e
[<ffffffff81342b98>] addrconf_notify+0x756/0x7fe
[<ffffffff812cacfb>] ? neigh_ifdown+0xc3/0xd4
[<ffffffff813622b3>] ? ip6mr_device_event+0x8d/0x9e
[<ffffffff8105eddb>] notifier_call_chain+0x37/0x63
[<ffffffff8105ee8b>] raw_notifier_call_chain+0x14/0x16
[<ffffffff812c15c7>] call_netdevice_notifiers+0x4a/0x4f
[<ffffffff812c1c1b>] rollback_registered_many+0x121/0x208
[<ffffffff812c1d1d>] unregister_netdevice_many+0x1b/0x71
[<ffffffff81324209>] ipip_exit_net+0xea/0x11a
[<ffffffff812bc941>] ? cleanup_net+0x0/0x198
[<ffffffff812bc2cf>] ops_exit_list+0x2a/0x5b
[<ffffffff812bca39>] cleanup_net+0xf8/0x198
[<ffffffff810568c7>] process_one_work+0x2a2/0x44d
[<ffffffff81056e35>] worker_thread+0x1db/0x34e
[<ffffffff81056c5a>] ? worker_thread+0x0/0x34e
[<ffffffff8105a030>] kthread+0x82/0x8a
[<ffffffff81003954>] kernel_thread_helper+0x4/0x10
[<ffffffff81059fae>] ? kthread+0x0/0x8a
[<ffffffff81003950>] ? kernel_thread_helper+0x0/0x10
---[ end trace 939b5185219f32e7 ]---
ipip_exit_net(3)
ipip_exit_net(exit)
unregister_netdevice: waiting for lo to become free. Usage count = 4
unregister_netdevice: waiting for lo to become free. Usage count = 4
unregister_netdevice: waiting for lo to become free. Usage count = 4
....
...
===== End of screen dump =====
lxc conf file:
# Container with network virtualized using the vlan device driver
# Local eth0 uplink
lxc.utsname = fee_0
lxc.network.type = macvlan
lxc.network.flags = up
lxc.network.link = eth1
lxc.network.hwaddr = 00:00:04:01:01:01
lxc.network.ipv4 = 192.168.1.21/24
lxc.network.ipv6 = 2003::2:1:1/96
# local eth1 downlink - to the RS farm
lxc.network.type = macvlan
lxc.network.flags = up
lxc.network.link = eth0
lxc.network.hwaddr = 00:00:03:01:01:01
lxc.network.ipv4 = 192.168.0.21/24
lxc.network.ipv6 = 2003::1:1:1/96
lxc.mount.entry = /var/lib/lxc/fee_0/var /var none rw,bind 0 0
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>
^ permalink raw reply
* [PATCH] sysctl: fix min/max handling in __do_proc_doulongvec_minmax()
From: Américo Wang @ 2010-10-07 9:25 UTC (permalink / raw)
To: Américo Wang
Cc: Eric Dumazet, Robin Holt, Andrew Morton, linux-kernel,
Willy Tarreau, David S. Miller, netdev, James Morris,
Pekka Savola (ipv6), Patrick McHardy, Alexey Kuznetsov, ebiederm
In-Reply-To: <20101007071859.GD5471@cr0.nay.redhat.com>
>>
>
>Here is the final one.
Oops, that one is not correct. Hopefully this one
is correct.
--------------->
Eric D. noticed that we may trigger an OOPS if we leave ->extra{1,2}
to NULL when we use proc_doulongvec_minmax().
Actually, we don't need to store min/max values in a vector,
because all the elements in the vector should share the same min/max
value, like what proc_dointvec_minmax() does.
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Eric W. <ebiederm@xmission.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
---
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index f88552c..fad9208 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2448,86 +2448,119 @@ int proc_dointvec_minmax(struct ctl_table *table, int write,
do_proc_dointvec_minmax_conv, ¶m);
}
-static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
- void __user *buffer,
- size_t *lenp, loff_t *ppos,
+static int __doulongvec_minmax_read(void *data, void __user *buffer,
+ size_t *lenp, loff_t *ppos, int vleft,
unsigned long convmul,
unsigned long convdiv)
{
- unsigned long *i, *min, *max;
- int vleft, first = 1, err = 0;
- unsigned long page = 0;
- size_t left;
- char *kbuf;
+ unsigned long *i = data;
+ int err = 0;
+ bool first = true;
+ size_t left = *lenp;
- if (!data || !table->maxlen || !*lenp || (*ppos && !write)) {
- *lenp = 0;
- return 0;
+ for (; left && vleft--; i++, first=false) {
+ unsigned long val;
+
+ val = convdiv * (*i) / convmul;
+ if (!first)
+ err = proc_put_char(&buffer, &left, '\t');
+ err = proc_put_long(&buffer, &left, val, false);
+ if (err)
+ break;
}
- i = (unsigned long *) data;
- min = (unsigned long *) table->extra1;
- max = (unsigned long *) table->extra2;
- vleft = table->maxlen / sizeof(unsigned long);
- left = *lenp;
+ if (!first && left && !err)
+ err = proc_put_char(&buffer, &left, '\n');
- if (write) {
- if (left > PAGE_SIZE - 1)
- left = PAGE_SIZE - 1;
- page = __get_free_page(GFP_TEMPORARY);
- kbuf = (char *) page;
- if (!kbuf)
- return -ENOMEM;
- if (copy_from_user(kbuf, buffer, left)) {
- err = -EFAULT;
- goto free;
- }
- kbuf[left] = 0;
+ *lenp -= left;
+ *ppos += *lenp;
+ return err;
+}
+
+static int __doulongvec_minmax_write(void *data, void __user *buffer,
+ size_t *lenp, loff_t *ppos, int vleft,
+ unsigned long min, unsigned long max)
+{
+ char *kbuf;
+ size_t left = *lenp;
+ unsigned long page = 0;
+ unsigned long *i = (unsigned long *) data;
+ int err = 0;
+ bool first = true;
+
+ if (left > PAGE_SIZE - 1)
+ left = PAGE_SIZE - 1;
+ page = __get_free_page(GFP_TEMPORARY);
+ kbuf = (char *) page;
+ if (!kbuf)
+ return -ENOMEM;
+ if (copy_from_user(kbuf, buffer, left)) {
+ err = -EFAULT;
+ goto free;
}
+ kbuf[left] = 0;
- for (; left && vleft--; i++, min++, max++, first=0) {
+ for (; left && vleft--; i++, first=false) {
unsigned long val;
+ bool neg;
- if (write) {
- bool neg;
-
- left -= proc_skip_spaces(&kbuf);
+ left -= proc_skip_spaces(&kbuf);
- err = proc_get_long(&kbuf, &left, &val, &neg,
- proc_wspace_sep,
- sizeof(proc_wspace_sep), NULL);
- if (err)
- break;
- if (neg)
- continue;
- if ((min && val < *min) || (max && val > *max))
- continue;
- *i = val;
- } else {
- val = convdiv * (*i) / convmul;
- if (!first)
- err = proc_put_char(&buffer, &left, '\t');
- err = proc_put_long(&buffer, &left, val, false);
- if (err)
- break;
- }
+ err = proc_get_long(&kbuf, &left, &val, &neg,
+ proc_wspace_sep,
+ sizeof(proc_wspace_sep), NULL);
+ if (err)
+ break;
+ if (neg)
+ continue;
+ if (val < min || val > max)
+ continue;
+ *i = val;
}
- if (!write && !first && left && !err)
- err = proc_put_char(&buffer, &left, '\n');
- if (write && !err)
+ if (!err)
left -= proc_skip_spaces(&kbuf);
free:
- if (write) {
- free_page(page);
- if (first)
- return err ? : -EINVAL;
- }
+ free_page(page);
+ if (first)
+ return err ? : -EINVAL;
+
*lenp -= left;
*ppos += *lenp;
return err;
}
+static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
+ void __user *buffer,
+ size_t *lenp, loff_t *ppos,
+ unsigned long convmul,
+ unsigned long convdiv)
+{
+ int vleft;
+ if (!data || !table->maxlen || !*lenp || (*ppos && !write)) {
+ *lenp = 0;
+ return 0;
+ }
+
+ vleft = table->maxlen / sizeof(unsigned long);
+ if (write) {
+ unsigned long min, max;
+
+ if (table->extra1)
+ min = *(unsigned long *) table->extra1;
+ else
+ min = 0;
+ if (table->extra2)
+ max = *(unsigned long *) table->extra2;
+ else
+ max = ULONG_MAX;
+ return __doulongvec_minmax_write(data, buffer, lenp,
+ ppos, vleft, min, max);
+ } else
+ return __doulongvec_minmax_read(data, buffer, lenp,
+ ppos, vleft, convmul, convdiv);
+}
+
static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
^ permalink raw reply related
* Re: [PATCH] SIW: Queue pair
From: Bernard Metzler @ 2010-10-07 9:21 UTC (permalink / raw)
To: Bart Van Assche; +Cc: linux-rdma, linux-rdma-owner, netdev
In-Reply-To: <AANLkTimM3Lpmt3JLgbCtuCjqFjNb8AkvBpdzpN7Sx978@mail.gmail.com>
linux-rdma-owner@vger.kernel.org wrote on 10/06/2010 07:57:29 PM:
> On Tue, Oct 5, 2010 at 8:55 AM, Bernard Metzler <bmt@zurich.ibm.com>
wrote:
> >
> > [ ... ]
> > +int
> > +siw_qp_modify(struct siw_qp *qp, struct siw_qp_attrs *attrs,
> > + enum siw_qp_attr_mask mask)
> > +{
> > [ ... ]
> > + case SIW_QP_STATE_ERROR:
> > + siw_rq_flush(qp);
> > + qp->attrs.state = SIW_QP_STATE_ERROR;
> > + drop_conn = 1;
> > + break;
>
> At least for InfiniBand when the state of a queue pair is changed to
> Error, work requests must be completed in error. The above code just
> flushes pending work requests. That doesn't look correct to me.
>
> A quote from the InfiniBand Architecture Specification, table 91, QP
> State Transition Properties:
>
> Any state to Reset: QP attributes are reset to the same values after
> the QP was created. Outstanding Work Requests are removed from the
> queues without notifying the Consumer.
>
right. i was trying to follow the verbs specification, which makes the
same statement - see sec. 6.2.4 of the Hilland vers:
The following is done on entry into the Error state:
* The RI MUST flush any incomplete WRs on the SQ or RQ. All WQEs
on the SQ and RQ, except for the WQE that caused the error (if
any), MUST be returned with the Flushed Error Completion Status
through the Completion Queue associated with the WQ.
following that, siw_rq_flush() flushes to the CQ. so, i think, we are
in sync here (the code flushes only the RQ to the CQ here, since we come
from IDLE or RTR, which must not have anything on the SQ).
thanks,
bernard.
^ permalink raw reply
* Re: [PATCH] sysctl: fix min/max handling in __do_proc_doulongvec_minmax()
From: Eric Dumazet @ 2010-10-07 9:51 UTC (permalink / raw)
To: Américo Wang
Cc: Robin Holt, Andrew Morton, linux-kernel, Willy Tarreau,
David S. Miller, netdev, James Morris, Pekka Savola (ipv6),
Patrick McHardy, Alexey Kuznetsov, ebiederm
In-Reply-To: <20101007092538.GE5471@cr0.nay.redhat.com>
Le jeudi 07 octobre 2010 à 17:25 +0800, Américo Wang a écrit :
> >>
> >
> >Here is the final one.
>
> Oops, that one is not correct. Hopefully this one
> is correct.
>
> --------------->
>
> Eric D. noticed that we may trigger an OOPS if we leave ->extra{1,2}
> to NULL when we use proc_doulongvec_minmax().
>
> Actually, we don't need to store min/max values in a vector,
> because all the elements in the vector should share the same min/max
> value, like what proc_dointvec_minmax() does.
>
If we assert same min/max limits are to be applied to all elements,
a much simpler fix than yours would be :
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index f88552c..8e45451 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2485,7 +2485,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
kbuf[left] = 0;
}
- for (; left && vleft--; i++, min++, max++, first=0) {
+ for (; left && vleft--; i++, first=0) {
unsigned long val;
if (write) {
Please dont send huge patches like this to 'fix' a bug,
especially on slow path.
First we fix the bug, _then_ we can try to make code more
efficient or more pretty or shorter.
So the _real_ question is :
Should the min/max limits should be a single pair,
shared by all elements, or a vector of limits.
^ 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