Netdev List
 help / color / mirror / Atom feed
* 2.6.24-rc5-mm1 -- INFO: possible circular locking dependency detected -- pm-suspend/5800 is trying to acquire lock
From: Miles Lane @ 2007-12-18 14:03 UTC (permalink / raw)
  To: Andrew Morton, LKML, netdev, ipw3945-devel, Len Brown

I have only seen this happen once, and cannot reproduce it.  I'll keep
trying, though.

Dec 16 22:10:48 syntropy kernel: [  231.718023]
=======================================================
Dec 16 22:10:48 syntropy kernel: [  231.718025] [ INFO: possible
circular locking dependency detected ]
Dec 16 22:10:48 syntropy kernel: [  231.718028] 2.6.24-rc5-mm1 #7
Dec 16 22:10:48 syntropy kernel: [  231.718029]
-------------------------------------------------------
Dec 16 22:10:48 syntropy kernel: [  231.718032] pm-suspend/5800 is
trying to acquire lock:
Dec 16 22:10:48 syntropy kernel: [  231.718034]
(&(&priv->init_alive_start)->work){--..}, at:
[__cancel_work_timer+0x8a/0x17f] __cancel_work_timer+0x8a/0x17f
Dec 16 22:10:48 syntropy kernel: [  231.718045]
Dec 16 22:10:48 syntropy kernel: [  231.718046] but task is already
holding lock:
Dec 16 22:10:48 syntropy kernel: [  231.718047]  (&priv->mutex){--..},
at: [<f8a587e7>] iwl3945_pci_suspend+0x1d/0x65 [iwl3945]
Dec 16 22:10:48 syntropy kernel: [  231.718065]
Dec 16 22:10:48 syntropy kernel: [  231.718066] which lock already
depends on the new lock.
Dec 16 22:10:48 syntropy kernel: [  231.718067]
Dec 16 22:10:48 syntropy kernel: [  231.718068]
Dec 16 22:10:48 syntropy kernel: [  231.718069] the existing
dependency chain (in reverse order) is:
Dec 16 22:10:48 syntropy kernel: [  231.718071]
Dec 16 22:10:48 syntropy kernel: [  231.718072] -> #1 (&priv->mutex){--..}:
Dec 16 22:10:48 syntropy kernel: [  231.718075]
[__lock_acquire+0xa17/0xbf4] __lock_acquire+0xa17/0xbf4
Dec 16 22:10:48 syntropy kernel: [  231.718083]
[mac80211:lock_acquire+0x76/0x1d8] lock_acquire+0x76/0x9d
Dec 16 22:10:48 syntropy kernel: [  231.718088]
[pcmcia:mutex_lock_nested+0xf7/0xd7d] mutex_lock_nested+0xf7/0x294
Dec 16 22:10:48 syntropy kernel: [  231.718096]        [<f8a56ff7>]
iwl3945_bg_init_alive_start+0x2d/0x1d7 [iwl3945]
Dec 16 22:10:48 syntropy kernel: [  231.718109]
[run_workqueue+0xbb/0x18b] run_workqueue+0xbb/0x18b
Dec 16 22:10:48 syntropy kernel: [  231.718115]
[worker_thread+0xbe/0xcd] worker_thread+0xbe/0xcd
Dec 16 22:10:48 syntropy kernel: [  231.718121]
[kthread+0x3b/0x61] kthread+0x3b/0x61
Dec 16 22:10:48 syntropy kernel: [  231.718126]
[kernel_thread_helper+0x7/0x10] kernel_thread_helper+0x7/0x10
Dec 16 22:10:48 syntropy kernel: [  231.718133]        [<ffffffff>] 0xffffffff
Dec 16 22:10:48 syntropy kernel: [  231.718145]
Dec 16 22:10:48 syntropy kernel: [  231.718146] -> #0
(&(&priv->init_alive_start)->work){--..}:
Dec 16 22:10:48 syntropy kernel: [  231.718149]
[__lock_acquire+0x93e/0xbf4] __lock_acquire+0x93e/0xbf4
Dec 16 22:10:48 syntropy kernel: [  231.718155]
[mac80211:lock_acquire+0x76/0x1d8] lock_acquire+0x76/0x9d
Dec 16 22:10:48 syntropy kernel: [  231.718161]
[__cancel_work_timer+0xb3/0x17f] __cancel_work_timer+0xb3/0x17f
Dec 16 22:10:48 syntropy kernel: [  231.718167]
[iwl3945:cancel_delayed_work_sync+0xb/0x0d]
cancel_delayed_work_sync+0xb/0xd
Dec 16 22:10:48 syntropy kernel: [  231.718173]        [<f8a542cb>]
__iwl3945_down+0x51/0x310 [iwl3945]
Dec 16 22:10:48 syntropy kernel: [  231.718184]        [<f8a587f7>]
iwl3945_pci_suspend+0x2d/0x65 [iwl3945]
Dec 16 22:10:48 syntropy kernel: [  231.718196]
[pci_device_suspend+0x1b/0x4b] pci_device_suspend+0x1b/0x4b
Dec 16 22:10:48 syntropy kernel: [  231.718203]
[device_suspend+0x17e/0x259] device_suspend+0x17e/0x259
Dec 16 22:10:48 syntropy kernel: [  231.718210]
[suspend_devices_and_enter+0x3d/0x138]
suspend_devices_and_enter+0x3d/0x138
Dec 16 22:10:48 syntropy kernel: [  231.718217]
[enter_state+0x121/0x17d] enter_state+0x121/0x17d
Dec 16 22:10:48 syntropy kernel: [  231.718222]
[state_store+0x96/0xac] state_store+0x96/0xac
Dec 16 22:10:48 syntropy kernel: [  231.718228]
[kobj_attr_store+0x1a/0x22] kobj_attr_store+0x1a/0x22
Dec 16 22:10:48 syntropy kernel: [  231.718234]
[sysfs_write_file+0xb8/0xe3] sysfs_write_file+0xb8/0xe3
Dec 16 22:10:48 syntropy kernel: [  231.718242]
[vfs_write+0xa4/0x120] vfs_write+0xa4/0x120
Dec 16 22:10:48 syntropy kernel: [  231.718248]
[sys_write+0x3b/0x60] sys_write+0x3b/0x60
Dec 16 22:10:48 syntropy kernel: [  231.718254]
[sysenter_past_esp+0x6b/0xc1] sysenter_past_esp+0x6b/0xc1
Dec 16 22:10:48 syntropy kernel: [  231.718259]        [<ffffffff>] 0xffffffff
Dec 16 22:10:48 syntropy kernel: [  231.718269]
Dec 16 22:10:48 syntropy kernel: [  231.718269] other info that might
help us debug this:
Dec 16 22:10:48 syntropy kernel: [  231.718271]
Dec 16 22:10:48 syntropy kernel: [  231.718272] 4 locks held by pm-suspend/5800:
Dec 16 22:10:48 syntropy kernel: [  231.718274]  #0:
(&buffer->mutex){--..}, at: [sysfs_write_file+0x25/0xe3]
sysfs_write_file+0x25/0xe3
Dec 16 22:10:48 syntropy kernel: [  231.718280]  #1:
(pm_mutex){--..}, at: [enter_state+0x166/0x17d]
enter_state+0x166/0x17d
Dec 16 22:10:48 syntropy kernel: [  231.718286]  #2:  (dpm_mtx){--..},
at: [device_suspend+0x2b/0x259] device_suspend+0x2b/0x259
Dec 16 22:10:48 syntropy kernel: [  231.718291]  #3:
(&priv->mutex){--..}, at: [<f8a587e7>] iwl3945_pci_suspend+0x1d/0x65
[iwl3945]
Dec 16 22:10:48 syntropy kernel: [  231.718304]
Dec 16 22:10:48 syntropy kernel: [  231.718304] stack backtrace:
Dec 16 22:10:48 syntropy kernel: [  231.718307] Pid: 5800, comm:
pm-suspend Not tainted 2.6.24-rc5-mm1 #7
Dec 16 22:10:48 syntropy kernel: [  231.718310]
[show_trace_log_lvl+0x12/0x25] show_trace_log_lvl+0x12/0x25
Dec 16 22:10:48 syntropy kernel: [  231.718314]  [show_trace+0xd/0x10]
show_trace+0xd/0x10
Dec 16 22:10:48 syntropy kernel: [  231.718318]
[sbp2:dump_stack+0x57/0x1734] dump_stack+0x57/0x5f
Dec 16 22:10:48 syntropy kernel: [  231.718321]
[print_circular_bug_tail+0x5b/0x66] print_circular_bug_tail+0x5b/0x66
Dec 16 22:10:48 syntropy kernel: [  231.718325]
[__lock_acquire+0x93e/0xbf4] __lock_acquire+0x93e/0xbf4
Dec 16 22:10:48 syntropy kernel: [  231.718329]
[mac80211:lock_acquire+0x76/0x1d8] lock_acquire+0x76/0x9d
Dec 16 22:10:48 syntropy kernel: [  231.718332]
[__cancel_work_timer+0xb3/0x17f] __cancel_work_timer+0xb3/0x17f
Dec 16 22:10:48 syntropy kernel: [  231.718336]
[iwl3945:cancel_delayed_work_sync+0xb/0x0d]
cancel_delayed_work_sync+0xb/0xd
Dec 16 22:10:48 syntropy kernel: [  231.718340]  [<f8a542cb>]
__iwl3945_down+0x51/0x310 [iwl3945]
Dec 16 22:10:48 syntropy kernel: [  231.718350]  [<f8a587f7>]
iwl3945_pci_suspend+0x2d/0x65 [iwl3945]
Dec 16 22:10:48 syntropy kernel: [  231.718360]
[pci_device_suspend+0x1b/0x4b] pci_device_suspend+0x1b/0x4b
Dec 16 22:10:48 syntropy kernel: [  231.718363]
[device_suspend+0x17e/0x259] device_suspend+0x17e/0x259
Dec 16 22:10:48 syntropy kernel: [  231.718367]
[suspend_devices_and_enter+0x3d/0x138]
suspend_devices_and_enter+0x3d/0x138
Dec 16 22:10:48 syntropy kernel: [  231.718371]
[enter_state+0x121/0x17d] enter_state+0x121/0x17d
Dec 16 22:10:48 syntropy kernel: [  231.718374]
[state_store+0x96/0xac] state_store+0x96/0xac
Dec 16 22:10:48 syntropy kernel: [  231.718378]
[kobj_attr_store+0x1a/0x22] kobj_attr_store+0x1a/0x22
Dec 16 22:10:48 syntropy kernel: [  231.718381]
[sysfs_write_file+0xb8/0xe3] sysfs_write_file+0xb8/0xe3
Dec 16 22:10:48 syntropy kernel: [  231.718385]
[vfs_write+0xa4/0x120] vfs_write+0xa4/0x120
Dec 16 22:10:48 syntropy kernel: [  231.718388]  [sys_write+0x3b/0x60]
sys_write+0x3b/0x60
Dec 16 22:10:48 syntropy kernel: [  231.718391]
[sysenter_past_esp+0x6b/0xc1] sysenter_past_esp+0x6b/0xc1
Dec 16 22:10:48 syntropy kernel: [  231.718395]  =======================

^ permalink raw reply

* [RFC][PATCH][IPV4] ip_gre: use skb->{mac,network}_header consistently
From: Timo Teräs @ 2007-12-18 13:59 UTC (permalink / raw)
  To: Alexey Kuznetsov, davem, netdev
In-Reply-To: <20071024100842.GA19369@ms2.inr.ac.ru>

From: Timo Teras <timo.teras@iki.fi>

Make both send and receive paths use consistently skb->*_header:
  mac_header = outer IPv4 header
  network_header = encapsulated packet (e.g. inner IPv4 header)

Signed-off-by: Timo Teras <timo.teras@iki.fi>
---
Currently in send path:
  network_header = outer IPv4 header
  transport_header = encapsulated packet
And receive path:
  network_header = encapsulated packet
  mac_header = GRE header

mac_header used to be the outer IPv4 header on receive path, but it was
broken/changed when skb_reset_mac_header() was introduced.

This also makes ipgre_header_parse() work correctly as it assumes that
mac_header points to the outer IPv4 header always. Though, it returns
zeros for outgoing packets that are tcpdumped from gre tunnel without
explicit local address, since the routing is done in ipgre_tunnel_xmit().

 net/ipv4/ip_gre.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 02b02a8..eba1ade 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -613,7 +613,7 @@ static int ipgre_rcv(struct sk_buff *skb)
 				offset += 4;
 		}
 
-		skb_reset_mac_header(skb);
+		skb->mac_header = skb->network_header;
 		__pskb_pull(skb, offset);
 		skb_reset_network_header(skb);
 		skb_postpull_rcsum(skb, skb_transport_header(skb), offset);
@@ -826,9 +826,8 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
 		old_iph = ip_hdr(skb);
 	}
 
-	skb->transport_header = skb->network_header;
 	skb_push(skb, gre_hlen);
-	skb_reset_network_header(skb);
+	skb_reset_mac_header(skb);
 	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
 	IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
 			      IPSKB_REROUTED);
@@ -839,7 +838,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
 	 *	Push down and install the IPIP header.
 	 */
 
-	iph 			=	ip_hdr(skb);
+	iph 			=	(struct iphdr *) skb_mac_header(skb);
 	iph->version		=	4;
 	iph->ihl		=	sizeof(struct iphdr) >> 2;
 	iph->frag_off		=	df;
@@ -1070,6 +1069,7 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev,
 	struct iphdr *iph = (struct iphdr *)skb_push(skb, t->hlen);
 	__be16 *p = (__be16*)(iph+1);
 
+	skb_reset_mac_header(skb);
 	memcpy(iph, &t->parms.iph, sizeof(struct iphdr));
 	p[0]		= t->parms.o_flags;
 	p[1]		= htons(type);
-- 
1.5.2.5



^ permalink raw reply related

* Re: [ROSE] [AX25] possible circular locking
From: Jarek Poplawski @ 2007-12-18 13:52 UTC (permalink / raw)
  To: Bernard Pidoux F6BVP
  Cc: Alexey Dobriyan, Ralf Baechle DL5RB, Linux Netdev List
In-Reply-To: <47664A0C.4060903@free.fr>

On Mon, Dec 17, 2007 at 11:06:04AM +0100, Bernard Pidoux F6BVP wrote:
> Hi,
>
>
> When I killall kissattach I can see the following message.
>
> This happens on kernel 2.6.24-rc5 already patched with the 6 previously
> patches I sent recently.
>
>
> =======================================================
> [ INFO: possible circular locking dependency detected ]
> 2.6.23.9 #1
> -------------------------------------------------------
> kissattach/2906 is trying to acquire lock:
>  (linkfail_lock){-+..}, at: [<d8bd4603>] ax25_link_failed+0x11/0x39 [ax25]
>
> but task is already holding lock:
>  (ax25_list_lock){-+..}, at: [<d8bd7c7c>] ax25_device_event+0x38/0x84
> [ax25]
>
> which lock already depends on the new lock.
>
>
> the existing dependency chain (in reverse order) is:
...

It seems, lockdep is warried about the different order here:

#1 (rose_neigh_list_lock){-+..}:
#3 (ax25_list_lock){-+..}:

#0 (linkfail_lock){-+..}:
#1 (rose_neigh_list_lock){-+..}:

#3 (ax25_list_lock){-+..}:
#0 (linkfail_lock){-+..}:

So, ax25_list_lock could be taken before and after linkfail_lock. 
I don't know if this three-thread clutch is very probable (or
possible at all), but it seems this other bug nearby reported by
Bernard ("[...] system impossible to reboot with linux-2.6.24-rc5")
could have similar source - namely ax25_list_lock held by
ax25_kill_by_device() during ax25_disconnect(). It looks like the
only place which calls ax25_disconnect() this way, so I guess, it
isn't necessary. But, since I don't know AX25 & ROSE at all, this
should be necessarily verified by somebody who knows these things.

I attach here my very experimental proposal with breaking the lock
for ax25_disconnect(), with some failsafe and debugging because of
this, but, if in this special case the lock is required for some
other reasons, then this patch should be dumped, of course.

Regards,
Jarek P.

WARNING:
not tested, not even compiled, needs some ack before testing!

---

diff -Nurp linux-2.6.24-rc5-/net/ax25/af_ax25.c linux-2.6.24-rc5+/net/ax25/af_ax25.c
--- linux-2.6.24-rc5-/net/ax25/af_ax25.c	2007-12-17 13:29:19.000000000 +0100
+++ linux-2.6.24-rc5+/net/ax25/af_ax25.c	2007-12-18 13:36:05.000000000 +0100
@@ -87,10 +87,19 @@ static void ax25_kill_by_device(struct n
 		return;
 
 	spin_lock_bh(&ax25_list_lock);
+again:
 	ax25_for_each(s, node, &ax25_list) {
 		if (s->ax25_dev == ax25_dev) {
+			struct hlist_node *nn = node->next;
+
 			s->ax25_dev = NULL;
+			spin_unlock_bh(&ax25_list_lock);
 			ax25_disconnect(s, ENETUNREACH);
+			spin_lock_bh(&ax25_list_lock);
+			if (nn != node->next) {
+				WARN_ON_ONCE(1);
+				goto again;
+			}
 		}
 	}
 	spin_unlock_bh(&ax25_list_lock);

^ permalink raw reply

* Re: [PATCH] MAINTAINERS: remove Adam Fritzler, update his email address in other sources
From: Matthew Wilcox @ 2007-12-18 13:43 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andrew Morton, linux-kernel, Adam Fritzler, James E.J. Bottomley,
	Jeff Garzik, Mike Phillips, Philip Blundell, linux-scsi, netdev,
	Adrian Bunk
In-Reply-To: <1197953283.4891.24.camel@localhost>

On Mon, Dec 17, 2007 at 08:48:03PM -0800, Joe Perches wrote:
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 9507b42..690f172 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3758,13 +3758,6 @@ W:	http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/
>  T:	git kernel.org:/pub/scm/linux/kernel/git/bunk/trivial.git
>  S:	Maintained
>  
> -TMS380 TOKEN-RING NETWORK DRIVER
> -P:	Adam Fritzler
> -M:	mid@auk.cx
> -L:	linux-tr@linuxtr.net
> -W:	http://www.auk.cx/tms380tr/
> -S:	Maintained

That's pretty unfriendly.  Presumably the linux-tr list is still active
and would still help people with that driver.  So how about:

 TMS380 TOKEN-RING NETWORK DRIVER
-P:   Adam Fritzler
-M:   mid@auk.cx
 L:   linux-tr@linuxtr.net
?W:?
-S:   Maintained
+S:   Orphan

(Dunno what to do about W:)

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

^ permalink raw reply

* Re: [DCCP] [PATCH 1/1]: Whitespace / outdated documentation
From: Arnaldo Carvalho de Melo @ 2007-12-18 13:44 UTC (permalink / raw)
  To: Gerrit Renker, Arnaldo, netdev, dccp
In-Reply-To: <20071218124108.GA5968@gerrit.erg.abdn.ac.uk>

Em Tue, Dec 18, 2007 at 12:41:08PM +0000, Gerrit Renker escreveu:
> [CCID3]: Whitespace cleanups and outdated documentation
> 
> This removes outdated documentation which had been forgotten to be
> removed (x_recv, rtt now appear twice, p was removed from rx_sock);
> and removes new whitespace.
> 
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>

Thanks, I'll get my scripts fixed... :-\

- Arnaldo

^ permalink raw reply

* update frequency for stats in /proc/net/dev
From: Mark Seger @ 2007-12-18 13:37 UTC (permalink / raw)
  To: netdev

A number of years ago I had written a comprehensive system monitoring 
tool called collectl, which among other things allowed me to monitor 
network traffic in real-time display as well as log the data to a file.  
Furthermore, that file can be generated in a format suitable for 
plotting with gnuplot.  As it turned out, I would very frequently see 
spikes of 200MB/sec on my 1Gb link.  A colleague noticed the reason was 
because the network counters were being updated every 0.9765 seconds and 
this was causing the problem.  I don't know how long this problem 
existed but it was certainly there in 2.4 kernels.  As it turns out, my 
tool is capable of monitoring with a fractional frequency and I have 
been able to get good data in spite of this problem.  However, I've 
since noticed that now the stats are updated once a second but that also 
means when I process the data at 0.9765 I get the wrong numbers again.  
Clearly one answer is to just update the counters more frequently but I 
suspect that is not being done for reasons of performance.

Anyhow, I just wanted to let people know that ALL tools that monitor 
once a second on older counters will get the wrong numbers and tools 
that correct for the wrong number by using fractional intervals (and I 
suspect mine is the only one that does) but run on newer kernels will 
also get the wrong numbers.  In any event, if anyone is interested in 
trying out collectl - it monitors a  LOT more than just networks - you 
can snag a copy of from http://collectl.sourceforge.net/ if you'd like 
to take if for a drive.  The website has a lot of output examples to 
give you a better idea what it can do.  I even included a writeup about 
the odd network performance observations at 
http://collectl.sourceforge.net/NetworkStats.html

-mark



^ permalink raw reply

* kernel softlockup/networking/e1000
From: Denys Fedoryshchenko @ 2007-12-18 13:10 UTC (permalink / raw)
  To: netdev


At the beginning - kernel is with "gentoo patched", but i checked, there is 
nothing major and almost none from patched code used on this router (there is 
almost no networking patches, except e1000e support, small GRE fix and few 
wireless things, which is not used).

syslog
http://www.nuclearcat.com/kern.log
.config
http://www.nuclearcat.com/.config

router ~ # gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.2.2/work/gcc-4.2.2/
configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.2.2 --
includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/include --datadir=/usr/share/
gcc-data/i686-pc-linux-gnu/4.2.2 --mandir=/usr/share/gcc-data/i686-pc-linux-
gnu/4.2.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.2.2/info --
with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/include/g++-v4 --
host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-
nls --without-included-gettext --with-system-zlib --disable-checking --
disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-
multilib --enable-libmudflap --disable-libssp --disable-libgcj --with-
arch=i686 --enable-languages=c,c++,fortran --enable-shared --enable-
threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.2.2 (Gentoo 4.2.2 p1.0)

router ~ # uname -a
Linux router 2.6.23-gentoo-r2 #3 SMP Mon Nov 19 15:09:24 EET 2007 i686 
Intel(R) Xeon(R) CPU X5355 @ 2.66GHz GenuineIntel GNU/Linux

router ~ # cat /proc/interrupts
          CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       
CPU6       CPU7
 0:        694          0          1          0          0          
0          0          0   IO-APIC-edge      timer
 1:       1141          0          0          0          0          
0          1          0   IO-APIC-edge      i8042
 6:          2          0          1          0          0          
0          0          0   IO-APIC-edge      floppy
 8:         54          0          0          1          1          
0          0          0   IO-APIC-edge      rtc
 9:          0          0          0          0          0          
0          0          0   IO-APIC-fasteoi   acpi
12:          1          0          0          0          1          
1          0          0   IO-APIC-edge      i8042
14:       8020          2          2          2          2          
2          2          3   IO-APIC-edge      libata
15:          0          0          0          0          0          
0          0          0   IO-APIC-edge      libata
16:     122789          0          0          1          0          
0          0          0   IO-APIC-fasteoi   aic94xx
17:          0          0          0          0          0          
0          0          0   IO-APIC-fasteoi   uhci_hcd:usb3
18:         33          1          0          0          0          
0          0          0   IO-APIC-fasteoi   uhci_hcd:usb1, ehci_hcd:usb4
19:          0          0          0          0          0          
0          0          0   IO-APIC-fasteoi   uhci_hcd:usb2
215:  173332578  173317578  173586819  173444564  173374366  173536578  
173171437  173782581   PCI-MSI-edge      eth2
216:  141388022  141590316  141227813  141530717  141023079  141749631  
141857184  141451943   PCI-MSI-edge      eth1
217:  146862670  146734470  146827732  146667083  147244919  146356156  
146613744  146407840   PCI-MSI-edge      eth0
NMI:          0          0          0          0          0          
0          0          0
LOC:  248340082  247983648  241693808  240574453  246992581  245863535  
242106539  240296195
ERR:          0
MIS:          0
router ~ #                                  



--
Denys Fedoryshchenko
Technical Manager
Virtual ISP S.A.L.


^ permalink raw reply

* Re: [virtio-net][PATCH] Don't arm tx hrtimer with a constant 500us each transmit
From: Dor Laor @ 2007-12-18 12:55 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel, netdev-u79uwXL29TY76Z2rM5mHXA, virtualization
In-Reply-To: <200712181101.14916.rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1942 bytes --]

Rusty Russell wrote:
> On Wednesday 12 December 2007 23:54:00 Dor Laor wrote:
>   
>> commit 763769621d271d92204ed27552d75448587c1ac0
>> Author: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
>> Date:   Wed Dec 12 14:52:00 2007 +0200
>>
>>     [virtio-net][PATCH] Don't arm tx hrtimer with a constant 50us each
>> transmit
>>
>>     The current start_xmit sets 500us hrtimer to kick the host.
>>     The problem is that if another xmit happens before the timer was
>> fired then
>>     the first xmit will have to wait additional 500us.
>>     This patch does not re-arm the timer if there is existing one.
>>     This will shorten the latency for tx.
>>     
>
> Hi Dor!
>
>     Yes, I pondered this when I wrote the code.  On the one hand, it's a 
> low-probability pathological corner case, on the other, your patch reduces 
> the number of timer reprograms in the normal case.
>
> So I've applied it, thanks!
> Rusty.
>
>
>   
Thanks, it actually improved my tx performance in 20%!
Expecting the host side timer with your new patch.
Cheers,
Dor.
>
>
>   
>>     Signed-off-by: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
>>
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>> index 7b051d5..8bb17d1
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -406,10 +405,10 @@ again:
>>          virtio_debug(vdebug, "%s: before calling kick %d\n",
>> __FUNCTION__, __LINE__);
>>          vi->svq->vq_ops->kick(vi->svq);
>>          vi->out_num = 0;
>> -    } else {
>> -        vi->stats.hrtimer_starts++;
>> -        hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
>> -                  HRTIMER_MODE_REL);
>> +    } else if (!hrtimer_is_queued(&vi->tx_timer)) {
>> +            vi->stats.hrtimer_starts++;
>> +            hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
>> +                      HRTIMER_MODE_REL);
>>      }
>>      return 0;
>>  }
>>     
>
>
>
>   


[-- Attachment #1.2: Type: text/html, Size: 2755 bytes --]

[-- Attachment #2: Type: text/plain, Size: 308 bytes --]

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply

* Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode
From: Herbert Xu @ 2007-12-18 12:49 UTC (permalink / raw)
  To: Gerrit Renker, netdev
In-Reply-To: <20071218114344.GB817@gerrit.erg.abdn.ac.uk>

On Tue, Dec 18, 2007 at 11:43:44AM +0000, Gerrit Renker wrote:
>
> It looks as if this work is reaching the cause of the problem, which would
> be good since the problem propagates to all users of such counters (UDP,
> UDP-Lite, and similar MIB counters). So thank you for taking this issue up,
> I hope that this will lead to a patch set resolving the counter issues.

Heh the counter issue is what led to this patch.  I think the
UDP counters should be fixed already.  Please have a look at
net-2.6.25 and let us know if it's still broken.

As to the SNMP counter issue in general, Christoph Lameter's
new percpu code will greatly simplify this and we won't need
to disable preemption or do the fancy softirq/user splitting
that we have right now.  I eagerly await its acceptance into
the Linux kernel.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [RFC] mac80211: clean up frame receive handling
From: Johannes Berg @ 2007-12-18 12:47 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: linux-wireless, netdev, Michael Wu, Tomas Winkler
In-Reply-To: <20071218041810.GB5698-mgr6C1c9aYeHXe+LvDLADg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3586 bytes --]


> > Unfortunately not. Does that really matter? It seems that the
> > verification whether the frame was encrypted would either be "always
> > require encryption when pairwise keys in use" (which this patch doesn't
> > do right now but could trivially be done) or simply "don't care since it
> > doesn't really matter".
> 
> In theory, yes, this does matter and the implementation does not comply
> with the standard if we do not verify this for WPA/WPA2/IEEE 802.11 RSN.

Ouch, ok.

> However, I do not believe there is any real security issue in not doing
> so and even worse, some client implementations end up using unencrypted
> EAPOL frames when they should really be encrypted..

That was what I was thinking. I guess being lax caused those
implementations to "work" to a point where now it can't be changed?

> hostapd has a place in the implementation where this information could
> be processed, but I did not actually ever enable such validation because
> of the potential interoperability issues. Likewise, wpa_supplicant does
> not validate this either.

Ok.

> In other words, this would be kind of nice to have feature in the kernel
> interface, but not really something that would be strictly required from
> security view point.

Right. I don't see how we can do this though of course it ought to be
possible with some sort of out-of-band data even on the regular data
interface. I still think the regular data interface is a better place
for these frames because of fragmentation/encryption/aggregation issues.

> > Actually, 802.1X doesn't specify that, as I said previously it
> > *recommends* it in C.3.3 (not C.1.1 as the 802.11 specs lead you to
> > believe). Also, a patch to do this was rejected by Stephen Hemminger, so
> > I decided to only pass up EAPOL frames that are either for our own
> > unicast address or the link-local eapol address, both of which won't be
> > bridged.
> 
> It is a "must" requirement, but apparently only in informative clause of
> IEEE 802.1X. However, this is a real issue and if the bridging code
> cannot be changed to do this, so dropping multicast/broadcast EAPOL
> frames in mac80211 (in both RX and TX direction) sounds reasonable
> workaround to prevent cases where wireless clients could otherwise mess
> with other IEEE 802.1X authentications (e.g., for the wired port of an
> AP).

It's a tad more complicated than that. The patch as it stands will allow
a station to mess with other 802.1X authentications when it has already
authenticated its own virtual port. It also drops frames in a way that
when the own virtual port is not authenticated it cannot do this. I
believe that the former is an issue with the linux bridging code and if
somebody wants to deploy linux-based 802.1X they need to install the
appropriate ebtables rules on all equipment.

> I added the C.3.3 vs. C.1.1 issue to my pending comments for the next
> IEEE 802.11 maintenance task group (TGmb). Should you find any other
> issues with IEEE Std 802.11-2007, I can add them to that list so that
> they can eventually be fixed.

Thanks. I'll let you know. I have one request for clarification
actually:
The standard always talks about DTIM count and how stations can use that
to know when the next DTIM beacon is sent. However, in one sentence
where it talks about timing, it also says that TSF==0 is not only a TBTT
but also a DTIM beacon. Is that intentional? No implementations I know
of seem to require TSF==0 to be DTIM but rather use the DTIM count to
sync.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* [DCCP] [PATCH 1/1]: Whitespace / outdated documentation
From: Gerrit Renker @ 2007-12-18 12:41 UTC (permalink / raw)
  To: Arnaldo, netdev; +Cc: dccp

[CCID3]: Whitespace cleanups and outdated documentation

This removes outdated documentation which had been forgotten to be
removed (x_recv, rtt now appear twice, p was removed from rx_sock);
and removes new whitespace.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
 net/dccp/ccids/ccid3.c |    6 +++---
 net/dccp/ccids/ccid3.h |    3 ---
 2 files changed, 3 insertions(+), 6 deletions(-)

--- a/net/dccp/ccids/ccid3.h
+++ b/net/dccp/ccids/ccid3.h
@@ -133,9 +133,6 @@ enum ccid3_hc_rx_states {
 
 /** struct ccid3_hc_rx_sock - CCID3 receiver half-connection socket
  *
- *  @ccid3hcrx_x_recv  -  Receiver estimate of send rate (RFC 3448 4.3)
- *  @ccid3hcrx_rtt  -  Receiver estimate of rtt (non-standard)
- *  @ccid3hcrx_p  -  Current loss event rate (RFC 3448 5.4)
  *  @ccid3hcrx_last_counter  -  Tracks window counter (RFC 4342, 8.1)
  *  @ccid3hcrx_state  -  Receiver state, one of %ccid3_hc_rx_states
  *  @ccid3hcrx_bytes_recv  -  Total sum of DCCP payload bytes
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -437,9 +437,9 @@ static void ccid3_hc_tx_packet_recv(stru
 		ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK);
 
 		if (hctx->ccid3hctx_t_rto == 0) {
- 			/*
+			/*
 			 * Initial feedback packet: Larger Initial Windows (4.2)
- 			 */
+			 */
 			hctx->ccid3hctx_x    = rfc3390_initial_rate(sk);
 			hctx->ccid3hctx_t_ld = now;
 
@@ -451,7 +451,7 @@ static void ccid3_hc_tx_packet_recv(stru
 			 * First feedback after nofeedback timer expiry (4.3)
 			 */
 			goto done_computing_x;
- 		}
+		}
 	}
 
 	/* Update sending rate (step 4 of [RFC 3448, 4.3]) */
-- 

^ permalink raw reply

* Re: [RFC] mac80211: clean up frame receive handling
From: Johannes Berg @ 2007-12-18 12:42 UTC (permalink / raw)
  To: Jouni Malinen
  Cc: John W. Linville, linux-wireless, netdev, Michael Wu,
	Tomas Winkler
In-Reply-To: <20071218042253.GC5698-mgr6C1c9aYeHXe+LvDLADg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]


> > I think in theory all eapol frames are sent to the PAE group address,
> > but I have no idea which of the checks would be more efficient. It seems
> > that the first could be optimised a lot because it's constant too...
> 
> They are not.. PAE group address is used for all EAPOL frames in
> non-shared media LANs (e.g., wired Ethernet switch), but IEEE 802.11
> uses the specific MAC address of the PAE since it is a shared media LAN
> (i.e., the frames are between the unicast MAC address of the non-AP
> STA/Supplicant and AP/Authenticator). 

If that's how it's specified, ok, but I think it's not strictly
necessary because the AP is addressed already by the BSSID, no?

> If we end up having to drop the
> PAE group addressed EAPOL frames in mac80211 anyway due to Linux
> bridging code not doing this,

No, we don't. We have to drop "unicast to somebody else". Group
addressed frames are dropped just fine.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* [PATCHv7 iproute2 2/2][RESEND] Interface group as new ip link option
From: Laszlo Attila Toth @ 2007-12-18 12:29 UTC (permalink / raw)
  To: David Miller, Patrick McHardy
  Cc: Jarek Poplawski, netdev, netfilter-devel, Laszlo Attila Toth
In-Reply-To: <11963527101117-git-send-email-panther@balabit.hu>

Interfaces can be grouped and each group has an unique positive integer ID.
It can be set via ip link. Symbolic names can be specified in
/etc/iproute2/rt_ifgroup. Any value of unsigned int32 is valid.

Signed-off-by: Laszlo Attila Toth <panther@balabit.hu>
---
 include/linux/if_link.h |    2 +
 include/rt_names.h      |    2 +
 ip/ipaddress.c          |    4 +++
 ip/iplink.c             |   11 ++++++++
 lib/rt_names.c          |   62 +++++++++++++++++++++++++++++++++++++++++++++++
 man/man8/ip.8           |    5 ++++
 6 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index c948395..5a2d071 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -79,6 +79,8 @@ enum
 	IFLA_LINKINFO,
 #define IFLA_LINKINFO IFLA_LINKINFO
 	IFLA_NET_NS_PID,
+	IFLA_IFGROUP,
+#define	IFLA_IFGROUP IFLA_IFGROUP
 	__IFLA_MAX
 };
 
diff --git a/include/rt_names.h b/include/rt_names.h
index 07a10e0..ea2d46a 100644
--- a/include/rt_names.h
+++ b/include/rt_names.h
@@ -8,11 +8,13 @@ char* rtnl_rtscope_n2a(int id, char *buf, int len);
 char* rtnl_rttable_n2a(__u32 id, char *buf, int len);
 char* rtnl_rtrealm_n2a(int id, char *buf, int len);
 char* rtnl_dsfield_n2a(int id, char *buf, int len);
+char* rtnl_ifgroup_n2a(__u32 id, char *buf, int len);
 int rtnl_rtprot_a2n(__u32 *id, char *arg);
 int rtnl_rtscope_a2n(__u32 *id, char *arg);
 int rtnl_rttable_a2n(__u32 *id, char *arg);
 int rtnl_rtrealm_a2n(__u32 *id, char *arg);
 int rtnl_dsfield_a2n(__u32 *id, char *arg);
+int rtnl_ifgroup_a2n(__u32 *id, char *arg);
 
 const char *inet_proto_n2a(int proto, char *buf, int len);
 int inet_proto_a2n(char *buf);
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index d1c6620..1ecbe03 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -227,6 +227,10 @@ int print_linkinfo(const struct sockaddr_nl *who,
 		fprintf(fp, "mtu %u ", *(int*)RTA_DATA(tb[IFLA_MTU]));
 	if (tb[IFLA_QDISC])
 		fprintf(fp, "qdisc %s ", (char*)RTA_DATA(tb[IFLA_QDISC]));
+	if (tb[IFLA_IFGROUP]) {
+		SPRINT_BUF(b1);
+		fprintf(fp, "group %s ", rtnl_ifgroup_n2a(*(int*)RTA_DATA(tb[IFLA_IFGROUP]), b1, sizeof(b1)));
+	}
 #ifdef IFLA_MASTER
 	if (tb[IFLA_MASTER]) {
 		SPRINT_BUF(b1);
diff --git a/ip/iplink.c b/ip/iplink.c
index f28f91c..cdef533 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <linux/sockios.h>
+#include <linux/rtnetlink.h>
 
 #include "rt_names.h"
 #include "utils.h"
@@ -46,6 +47,7 @@ void iplink_usage(void)
 	fprintf(stderr, "	                     promisc { on | off } |\n");
 	fprintf(stderr, "	                     trailers { on | off } |\n");
 	fprintf(stderr, "	                     txqueuelen PACKETS |\n");
+	fprintf(stderr, "	                     group GROUP |\n");
 	fprintf(stderr, "	                     name NEWNAME |\n");
 	fprintf(stderr, "	                     address LLADDR | broadcast LLADDR |\n");
 	fprintf(stderr, "	                     mtu MTU }\n");
@@ -146,6 +148,7 @@ static int iplink_have_newlink(void)
 static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
 {
 	int qlen = -1;
+	__u32 group = 0;
 	int mtu = -1;
 	int len;
 	char abuf[32];
@@ -198,6 +201,14 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
 			if (get_integer(&qlen,  *argv, 0))
 				invarg("Invalid \"txqueuelen\" value\n", *argv);
 			addattr_l(&req.n, sizeof(req), IFLA_TXQLEN, &qlen, 4);
+		} else if (matches(*argv, "group") == 0) {
+			NEXT_ARG();
+			if (group != 0)
+				duparg("group", *argv);
+
+			if (rtnl_ifgroup_a2n(&group, *argv))
+				invarg("\"group\" value is invalid\n", *argv);
+			addattr_l(&req.n, sizeof(req), IFLA_IFGROUP, &group, sizeof(group));
 		} else if (strcmp(*argv, "mtu") == 0) {
 			NEXT_ARG();
 			if (mtu != -1)
diff --git a/lib/rt_names.c b/lib/rt_names.c
index 8d019a0..8837e4f 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -446,3 +446,65 @@ int rtnl_dsfield_a2n(__u32 *id, char *arg)
 	return 0;
 }
 
+static char * rtnl_rtifgroup_tab[256] = {
+	"0",
+};
+
+static int rtnl_rtifgroup_init;
+
+static void rtnl_rtifgroup_initialize(void)
+{
+	rtnl_rtifgroup_init = 1;
+	rtnl_tab_initialize("/etc/iproute2/rt_ifgroup",
+			    rtnl_rtifgroup_tab, 256);
+}
+
+char * rtnl_ifgroup_n2a(__u32 id, char *buf, int len)
+{
+	if (id>=256) {
+		snprintf(buf, len, "0x%x", id);
+		return buf;
+	}
+	if (!rtnl_rtifgroup_tab[id]) {
+		if (!rtnl_rtifgroup_init)
+			rtnl_rtifgroup_initialize();
+	}
+	if (rtnl_rtifgroup_tab[id])
+		return rtnl_rtifgroup_tab[id];
+	snprintf(buf, len, "0x%02x", id);
+	return buf;
+}
+
+
+int rtnl_ifgroup_a2n(__u32 *id, char *arg)
+{
+	static char *cache = NULL;
+	static unsigned long res;
+	char *end;
+	int i;
+
+	if (cache && strcmp(cache, arg) == 0) {
+		*id = res;
+		return 0;
+	}
+
+	if (!rtnl_rtifgroup_init)
+		rtnl_rtifgroup_initialize();
+
+	for (i=0; i<256; i++) {
+		if (rtnl_rtifgroup_tab[i] &&
+		    strcmp(rtnl_rtifgroup_tab[i], arg) == 0) {
+			cache = rtnl_rtifgroup_tab[i];
+			res = i;
+			*id = res;
+			return 0;
+		}
+	}
+
+	res = strtoul(arg, &end, 0);
+	if (!end || end == arg || *end)
+		return -1;
+	*id = res;
+	return 0;
+}
+
diff --git a/man/man8/ip.8 b/man/man8/ip.8
index 8fd6d52..0338dab 100644
--- a/man/man8/ip.8
+++ b/man/man8/ip.8
@@ -511,6 +511,11 @@ already configured.
 change the transmit queue length of the device.
 
 .TP
+.BI group " GROUP"
+.TP 
+change the interface group identifier of the device.
+
+.TP
 .BI mtu " NUMBER"
 change the 
 .I MTU
-- 
1.5.2.5


^ permalink raw reply related

* [PATCHv7 1/5][RESEND] Remove unnecessary locks from rtnetlink
From: Laszlo Attila Toth @ 2007-12-18 12:29 UTC (permalink / raw)
  To: David Miller, Patrick McHardy
  Cc: Jarek Poplawski, netdev, netfilter-devel, Laszlo Attila Toth
In-Reply-To: <11963527103201-git-send-email-panther@balabit.hu>

The do_setlink() function is protected by rtnl, additional locks are unnecessary.
and the set_operstate() function is called from protected parts. Locks removed
from both functions.

The set_operstate() is also called from rtnl_create_link() and from no other places.
In rtnl_create_link() none of the changes is protected by set_lock_bh() except
inside set_operstate(), different locking scheme is not necessary
for the operstate.

Signed-off-by: Laszlo Attila Toth <panther@balabit.hu>
---

 net/core/rtnetlink.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 4a07e83..f95c6c5 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -562,9 +562,7 @@ static void set_operstate(struct net_device *dev, unsigned char transition)
 	}
 
 	if (dev->operstate != operstate) {
-		write_lock_bh(&dev_base_lock);
 		dev->operstate = operstate;
-		write_unlock_bh(&dev_base_lock);
 		netdev_state_change(dev);
 	}
 }
@@ -879,9 +877,7 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
 		set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
 
 	if (tb[IFLA_LINKMODE]) {
-		write_lock_bh(&dev_base_lock);
 		dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
-		write_unlock_bh(&dev_base_lock);
 	}
 
 	err = 0;

^ permalink raw reply related

* [PATCHv7 2/5][RESEND] rtnetlink: send a single notification on device state changes
From: Laszlo Attila Toth @ 2007-12-18 12:29 UTC (permalink / raw)
  To: David Miller, Patrick McHardy
  Cc: Jarek Poplawski, netdev, netfilter-devel, Laszlo Attila Toth
In-Reply-To: <1196352710402-git-send-email-panther@balabit.hu>

In do_setlink() a single notification is sent at the end of the function
if any modification occured. If the address has been changed, another
notification is sent.

Both of them is required because originally only the NETDEV_CHANGEADDR notification
was sent and although device state change implies address change, some programs may
expect the original notification. It remains for compatibity.

Signed-off-by: Laszlo Attila Toth <panther@balabit.hu>
---

 net/core/rtnetlink.c |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index f95c6c5..6be8608 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -542,7 +542,7 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id,
 
 EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo);
 
-static void set_operstate(struct net_device *dev, unsigned char transition)
+static int set_operstate(struct net_device *dev, unsigned char transition)
 {
 	unsigned char operstate = dev->operstate;
 
@@ -563,8 +563,9 @@ static void set_operstate(struct net_device *dev, unsigned char transition)
 
 	if (dev->operstate != operstate) {
 		dev->operstate = operstate;
-		netdev_state_change(dev);
-	}
+		return 1;
+	} else
+		return 0;
 }
 
 static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
@@ -858,6 +859,7 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
 	if (tb[IFLA_BROADCAST]) {
 		nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len);
 		send_addr_notify = 1;
+		modified = 1;
 	}
 
 	if (ifm->ifi_flags || ifm->ifi_change) {
@@ -870,14 +872,21 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
 		dev_change_flags(dev, flags);
 	}
 
-	if (tb[IFLA_TXQLEN])
-		dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
+	if (tb[IFLA_TXQLEN]) {
+		if (dev->tx_queue_len != nla_get_u32(tb[IFLA_TXQLEN])) {
+			dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
+			modified = 1;
+		}
+	}
 
 	if (tb[IFLA_OPERSTATE])
-		set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
+		modified |= set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
 
 	if (tb[IFLA_LINKMODE]) {
-		dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
+		if (dev->link_mode != nla_get_u8(tb[IFLA_LINKMODE])) {
+			dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
+			modified = 1;
+		} 
 	}
 
 	err = 0;
@@ -891,6 +900,10 @@ errout:
 
 	if (send_addr_notify)
 		call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
+
+	if (modified)
+		netdev_state_change(dev);
+
 	return err;
 }
 

^ permalink raw reply related

* [PATCH 2/2] Module for ip utility to support veth device
From: Vitaliy Gusev @ 2007-12-18 12:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Pavel Emelyanov, Patrick McHardy


module link_veth

Signed-off-by: Vitaliy Gusev <vgusev@openvz.org>

---

 link_veth.c |   76 +++++++++++++++++++-----------------------------------------
 veth.h      |    2 -
 2 files changed, 25 insertions(+), 53 deletions(-)

diff --git a/ip/link_veth.c b/ip/link_veth.c
index a4764f2..226b4ef 100644
--- a/ip/link_veth.c
+++ b/ip/link_veth.c
@@ -10,78 +10,52 @@
  *
  */
 
-#include <stdio.h>
 #include <string.h>
 
 #include "utils.h"
 #include "ip_common.h"
 #include "veth.h"
 
-#define ETH_ALEN	6
+#define	IFNAMSIZ	16
 
 static void usage(void)
 {
-	printf("Usage: ip link add ... type veth "
-			"[peer <peer-name>] [mac <mac>] [peer_mac <mac>]\n");
+	printf("Usage: ip link <options> type veth "
+		"[peer <options>]\nTo get <options> type "
+		"'ip link add help'\n");
 }
 
 static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
 		struct nlmsghdr *hdr)
 {
-	__u8 mac[ETH_ALEN];
+	char *name, *type, *link, *dev;
+	int err, len;
+	struct rtattr * data;
 
-	for (; argc != 0; argv++, argc--) {
-		if (strcmp(*argv, "peer") == 0) {
-			argv++;
-			argc--;
-			if (argc == 0) {
-				usage();
-				return -1;
-			}
-
-			addattr_l(hdr, 1024, VETH_INFO_PEER,
-					*argv, strlen(*argv));
-
-			continue;
-		}
-
-		if (strcmp(*argv, "mac") == 0) {
-			argv++;
-			argc--;
-			if (argc == 0) {
-				usage();
-				return -1;
-			}
-
-			if (hexstring_a2n(*argv, mac, sizeof(mac)) == NULL)
-				return -1;
-
-			addattr_l(hdr, 1024, VETH_INFO_MAC,
-					mac, ETH_ALEN);
-			continue;
-		}
+	if (strcmp(argv[0], "peer") != 0) {
+		usage();
+		return -1;
+	}
 
-		if (strcmp(*argv, "peer_mac") == 0) {
-			argv++;
-			argc--;
-			if (argc == 0) {
-				usage();
-				return -1;
-			}
+	data = NLMSG_TAIL(hdr);
+	addattr_l(hdr, 1024, VETH_INFO_PEER, NULL, 0);
 
-			if (hexstring_a2n(*argv, mac, sizeof(mac)) == NULL)
-				return -1;
+	hdr->nlmsg_len += sizeof(struct ifinfomsg);
 
-			addattr_l(hdr, 1024, VETH_INFO_PEER_MAC,
-					mac, ETH_ALEN);
-			continue;
-		}
+	err = iplink_parse(argc - 1, argv + 1, (struct iplink_req *)hdr,
+			&name, &type, &link, &dev);
+	if (err < 0)
+		return err;
 
-		usage();
-		return -1;
+	if (name) {
+		len = strlen(name) + 1;
+		if (len > IFNAMSIZ)
+			invarg("\"name\" too long\n", *argv);
+		addattr_l(hdr, 1024, IFLA_IFNAME, name, len);
 	}
 
-	return 0;
+	data->rta_len = (void *)NLMSG_TAIL(hdr) - (void *)data;
+	return argc - 1 - err;
 }
 
 struct link_util veth_link_util = {
diff --git a/ip/veth.h b/ip/veth.h
index b84a530..aa2e6f9 100644
--- a/ip/veth.h
+++ b/ip/veth.h
@@ -3,9 +3,7 @@
 
 enum {
 	VETH_INFO_UNSPEC,
-	VETH_INFO_MAC,
 	VETH_INFO_PEER,
-	VETH_INFO_PEER_MAC,
 
 	__VETH_INFO_MAX
 #define VETH_INFO_MAX	(__VETH_INFO_MAX - 1)
-- 
Thank,
Vitaliy Gusev

^ permalink raw reply related

* [PATCH 1/2] Introduce iplink_parse() routine
From: Vitaliy Gusev @ 2007-12-18 12:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Pavel Emelyanov, Patrick McHardy

From: Pavel Emelyanov <xemul@openvz.org>
Date: Thu, 19 Jul 2007 13:32:31 +0400

This routine parses CLI attributes, describing generic link
parameters such as name, address, etc.

This is mostly copy-pasted from iplink_modify().

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>

 include/utils.h |    3 +
 ip/iplink.c     |  127 
++++++++++++++++++++++++++++++++------------------------
 2 files changed, 76 insertions(+), 54 deletions(-)

diff --git a/include/utils.h b/include/utils.h
index 9ee55fd..7223a10 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -147,4 +147,7 @@ extern int cmdlineno;
 extern ssize_t getcmdline(char **line, size_t *len, FILE *in);
 extern int makeargs(char *line, char *argv[], int maxargs);
 
+struct iplink_req;
+int iplink_parse(int argc, char **argv, struct iplink_req *req,
+		char **name, char **type, char **link, char **dev);
 #endif /* __UTILS_H__ */
diff --git a/ip/iplink.c b/ip/iplink.c
index f28f91c..95801a6 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -143,140 +143,159 @@ static int iplink_have_newlink(void)
 }
 #endif /* ! IPLINK_IOCTL_COMPAT */
 
-static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
+struct iplink_req {
+	struct nlmsghdr		n;
+	struct ifinfomsg	i;
+	char			buf[1024];
+};
+
+int iplink_parse(int argc, char **argv, struct iplink_req *req,
+		char **name, char **type, char **link, char **dev)
 {
+	int ret, len;
+	char abuf[32];
 	int qlen = -1;
 	int mtu = -1;
-	int len;
-	char abuf[32];
-	char *dev = NULL;
-	char *name = NULL;
-	char *link = NULL;
-	char *type = NULL;
-	struct link_util *lu = NULL;
-	struct {
-		struct nlmsghdr		n;
-		struct ifinfomsg	i;
-		char			buf[1024];
-	} req;
 
-	memset(&req, 0, sizeof(req));
-
-	req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
-	req.n.nlmsg_flags = NLM_F_REQUEST|flags;
-	req.n.nlmsg_type = cmd;
-	req.i.ifi_family = preferred_family;
+	ret = argc;
 
 	while (argc > 0) {
 		if (strcmp(*argv, "up") == 0) {
-			req.i.ifi_change |= IFF_UP;
-			req.i.ifi_flags |= IFF_UP;
+			req->i.ifi_change |= IFF_UP;
+			req->i.ifi_flags |= IFF_UP;
 		} else if (strcmp(*argv, "down") == 0) {
-			req.i.ifi_change |= IFF_UP;
-			req.i.ifi_flags &= ~IFF_UP;
+			req->i.ifi_change |= IFF_UP;
+			req->i.ifi_flags &= ~IFF_UP;
 		} else if (strcmp(*argv, "name") == 0) {
 			NEXT_ARG();
-			name = *argv;
+			*name = *argv;
 		} else if (matches(*argv, "link") == 0) {
 			NEXT_ARG();
-			link = *argv;
+			*link = *argv;
 		} else if (matches(*argv, "address") == 0) {
 			NEXT_ARG();
 			len = ll_addr_a2n(abuf, sizeof(abuf), *argv);
-			addattr_l(&req.n, sizeof(req), IFLA_ADDRESS, abuf, len);
+			addattr_l(&req->n, sizeof(*req), IFLA_ADDRESS, abuf, len);
 		} else if (matches(*argv, "broadcast") == 0 ||
-			   strcmp(*argv, "brd") == 0) {
+				strcmp(*argv, "brd") == 0) {
 			NEXT_ARG();
 			len = ll_addr_a2n(abuf, sizeof(abuf), *argv);
-			addattr_l(&req.n, sizeof(req), IFLA_BROADCAST, abuf, len);
+			addattr_l(&req->n, sizeof(*req), IFLA_BROADCAST, abuf, len);
 		} else if (matches(*argv, "txqueuelen") == 0 ||
-			   strcmp(*argv, "qlen") == 0 ||
-			   matches(*argv, "txqlen") == 0) {
+				strcmp(*argv, "qlen") == 0 ||
+				matches(*argv, "txqlen") == 0) {
 			NEXT_ARG();
 			if (qlen != -1)
 				duparg("txqueuelen", *argv);
 			if (get_integer(&qlen,  *argv, 0))
 				invarg("Invalid \"txqueuelen\" value\n", *argv);
-			addattr_l(&req.n, sizeof(req), IFLA_TXQLEN, &qlen, 4);
+			addattr_l(&req->n, sizeof(*req), IFLA_TXQLEN, &qlen, 4);
 		} else if (strcmp(*argv, "mtu") == 0) {
 			NEXT_ARG();
 			if (mtu != -1)
 				duparg("mtu", *argv);
 			if (get_integer(&mtu, *argv, 0))
 				invarg("Invalid \"mtu\" value\n", *argv);
-			addattr_l(&req.n, sizeof(req), IFLA_MTU, &mtu, 4);
+			addattr_l(&req->n, sizeof(*req), IFLA_MTU, &mtu, 4);
 		} else if (strcmp(*argv, "multicast") == 0) {
 			NEXT_ARG();
-			req.i.ifi_change |= IFF_MULTICAST;
+			req->i.ifi_change |= IFF_MULTICAST;
 			if (strcmp(*argv, "on") == 0) {
-				req.i.ifi_flags |= IFF_MULTICAST;
+				req->i.ifi_flags |= IFF_MULTICAST;
 			} else if (strcmp(*argv, "off") == 0) {
-				req.i.ifi_flags &= ~IFF_MULTICAST;
+				req->i.ifi_flags &= ~IFF_MULTICAST;
 			} else
 				return on_off("multicast");
 		} else if (strcmp(*argv, "allmulticast") == 0) {
 			NEXT_ARG();
-			req.i.ifi_change |= IFF_ALLMULTI;
+			req->i.ifi_change |= IFF_ALLMULTI;
 			if (strcmp(*argv, "on") == 0) {
-				req.i.ifi_flags |= IFF_ALLMULTI;
+				req->i.ifi_flags |= IFF_ALLMULTI;
 			} else if (strcmp(*argv, "off") == 0) {
-				req.i.ifi_flags &= ~IFF_ALLMULTI;
+				req->i.ifi_flags &= ~IFF_ALLMULTI;
 			} else
 				return on_off("allmulticast");
 		} else if (strcmp(*argv, "promisc") == 0) {
 			NEXT_ARG();
-			req.i.ifi_change |= IFF_PROMISC;
+			req->i.ifi_change |= IFF_PROMISC;
 			if (strcmp(*argv, "on") == 0) {
-				req.i.ifi_flags |= IFF_PROMISC;
+				req->i.ifi_flags |= IFF_PROMISC;
 			} else if (strcmp(*argv, "off") == 0) {
-				req.i.ifi_flags &= ~IFF_PROMISC;
+				req->i.ifi_flags &= ~IFF_PROMISC;
 			} else
 				return on_off("promisc");
 		} else if (strcmp(*argv, "trailers") == 0) {
 			NEXT_ARG();
-			req.i.ifi_change |= IFF_NOTRAILERS;
+			req->i.ifi_change |= IFF_NOTRAILERS;
 			if (strcmp(*argv, "off") == 0) {
-				req.i.ifi_flags |= IFF_NOTRAILERS;
+				req->i.ifi_flags |= IFF_NOTRAILERS;
 			} else if (strcmp(*argv, "on") == 0) {
-				req.i.ifi_flags &= ~IFF_NOTRAILERS;
+				req->i.ifi_flags &= ~IFF_NOTRAILERS;
 			} else
 				return on_off("trailers");
 		} else if (strcmp(*argv, "arp") == 0) {
 			NEXT_ARG();
-			req.i.ifi_change |= IFF_NOARP;
+			req->i.ifi_change |= IFF_NOARP;
 			if (strcmp(*argv, "on") == 0) {
-				req.i.ifi_flags &= ~IFF_NOARP;
+				req->i.ifi_flags &= ~IFF_NOARP;
 			} else if (strcmp(*argv, "off") == 0) {
-				req.i.ifi_flags |= IFF_NOARP;
+				req->i.ifi_flags |= IFF_NOARP;
 			} else
 				return on_off("noarp");
 #ifdef IFF_DYNAMIC
 		} else if (matches(*argv, "dynamic") == 0) {
 			NEXT_ARG();
-			req.i.ifi_change |= IFF_DYNAMIC;
+			req->i.ifi_change |= IFF_DYNAMIC;
 			if (strcmp(*argv, "on") == 0) {
-				req.i.ifi_flags |= IFF_DYNAMIC;
+				req->i.ifi_flags |= IFF_DYNAMIC;
 			} else if (strcmp(*argv, "off") == 0) {
-				req.i.ifi_flags &= ~IFF_DYNAMIC;
+				req->i.ifi_flags &= ~IFF_DYNAMIC;
 			} else
 				return on_off("dynamic");
 #endif
 		} else if (matches(*argv, "type") == 0) {
 			NEXT_ARG();
-			type = *argv;
+			*type = *argv;
 			argc--; argv++;
 			break;
 		} else {
-                        if (strcmp(*argv, "dev") == 0) {
+			if (strcmp(*argv, "dev") == 0) {
 				NEXT_ARG();
 			}
-			if (dev)
+			if (*dev)
 				duparg2("dev", *argv);
-			dev = *argv;
+			*dev = *argv;
 		}
 		argc--; argv++;
 	}
 
+	return ret - argc;
+}
+
+static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
+{
+	int len;
+	char *dev = NULL;
+	char *name = NULL;
+	char *link = NULL;
+	char *type = NULL;
+	struct link_util *lu = NULL;
+	struct iplink_req req;
+	int ret;
+
+	memset(&req, 0, sizeof(req));
+
+	req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
+	req.n.nlmsg_flags = NLM_F_REQUEST|flags;
+	req.n.nlmsg_type = cmd;
+	req.i.ifi_family = preferred_family;
+
+	ret = iplink_parse(argc, argv, &req, &name, &type, &link, &dev);
+	if (ret < 0)
+		return ret;
+
+	argc -= ret;
+	argv += ret;
 	ll_init_map(&rth);
 
 	if (type) {
-- 
Thank,
Vitaliy Gusev

^ permalink raw reply related

* [PATCH] Module for ip utility to support veth device (v.4)
From: Vitaliy Gusev @ 2007-12-18 12:14 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Pavel Emelyanov, Patrick McHardy

The usage is
# ip link add [name]  [device parameters] type veth [peer [name <name> <other 
device params>]]

This consists of two parts:
1/2 makes some copy-paste changes in ip/iplink.c for generic CLI
attributes parsing,
2/2 the module itself.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>


^ permalink raw reply

* Re: [PATCH 3/3] [UDP6]: Counter increment on BH mode
From: Gerrit Renker @ 2007-12-18 11:43 UTC (permalink / raw)
  To: Herbert Xu; +Cc: netdev
In-Reply-To: <20071215135851.GA29063@gondor.apana.org.au>

| 
| I didn't hear any objections so here is the patch again.
| 
| [SNMP]: Fix SNMP counters with PREEMPT
| 
I don't feel competent to say whether this is correct, but it seems that
this is going a long way towards resolving older problems with the SNMP
counters.

What I can say is that a year ago, when doing the UDP/-Lite work, I found
that the counters were not accurate, which was due to the double-counting
problem that Wang Chen brought up again.

Resolving this issue was stalled at that time due to the fact that a
counter may be incremented on one CPU and then later decremented on
another.

It looks as if this work is reaching the cause of the problem, which would
be good since the problem propagates to all users of such counters (UDP,
UDP-Lite, and similar MIB counters). So thank you for taking this issue up,
I hope that this will lead to a patch set resolving the counter issues.

Best regards,
Gerrit

^ permalink raw reply

* Re: [0/4] DST: Distributed storage.
From: Evgeniy Polyakov @ 2007-12-18 11:08 UTC (permalink / raw)
  To: David Chinner; +Cc: lkml, netdev, linux-fsdevel
In-Reply-To: <20071218010003.GE4396912@sgi.com>

Hi David.

On Tue, Dec 18, 2007 at 12:00:04PM +1100, David Chinner (dgc@sgi.com) wrote:
> On Mon, Dec 17, 2007 at 06:03:38PM +0300, Evgeniy Polyakov wrote:
> > DST passed all FS tests in LTP with XFS (modulo MAX_LOCK_DEPTH too low bug:
> > [ 8398.605691] BUG: MAX_LOCK_DEPTH too low!
> > [ 8398.609641] turning off the locking correctness validator.
> 
> Evgeniy, can you please start reporting these XFS problems you are
> coming across to the XFS list (xfs@oss.sgi.com)? They may be
> real issues that we need to address and we should not be hearing
> about them for the first time in the release notes for a block
> device project....

It is not XFS as is, but lock validator warning. I just found it
working with XFS - it can be anything else: VFS, block layer, DST itself
(there is number of locks too), so I did not fill the bug against
filesystem, but pointed that some problem, probalby harmless,
exists in tested environment.

-- 
	Evgeniy Polyakov

^ permalink raw reply

* Re: e1000 driver problems
From: Lukas Hejtmanek @ 2007-12-18 11:08 UTC (permalink / raw)
  To: Kok, Auke; +Cc: NetDev
In-Reply-To: <47541ED0.9090808@intel.com>

Hello,

the problem seems to be gone in 2.6.24-rc kernels.

-- 
Lukáš Hejtmánek

^ permalink raw reply

* Re: [UPDATED PATCH] SGISEEQ: use cached memory access to make driver work on IP28
From: Thomas Bogendoerfer @ 2007-12-18 10:30 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linux-mips, ralf
In-Reply-To: <47671FEE.90103@pobox.com>

On Mon, Dec 17, 2007 at 08:18:38PM -0500, Jeff Garzik wrote:
> >Changes to last version:
> >- Use inline functions for dma_sync_* instead of macros (suggested by Ralf)
> >- added Kconfig change to make selection for similair SGI boxes easier
> 
> hrm, could you rediff?  it doesn't seem to apply

sure, against which tree ? I tried netdev-2.6 and it applies without fuzz...

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply

* Re: [PATCH/RFC] [POWERPC] Add fixed-phy support for fs_enet
From: Jochen Friedrich @ 2007-12-18 10:13 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Vitaly Bordug, linuxppc-dev, linux-kernel, netdev, Scott Wood
In-Reply-To: <4767042E.2070903@garzik.org>

Hi Jeff,

> ACK, pass this through paulus?

Yes, that's fine for me.

Thanks,
Jochen

^ permalink raw reply

* [PATCH] Platform Changes for UCC TDM driver for MPC8323ERDB. Also includes related QE changes.
From: Poonam_Aggrwal-b10812 @ 2007-12-18  9:02 UTC (permalink / raw)
  To: rubini, linuxppc-dev, netdev, kumar.gala
  Cc: michael.barkowski, rich.cutler, ashish.kalra

From: Poonam Aggrwal <b10812@freescale.com>

This patch makes necessary changes in the QE and UCC framework to support 
TDM. It also adds support to configure the BRG properly through device 
tree entries. Includes the device tree changes for UCC TDM driver as well.
It also includes device tree entries for UCC TDM driver.

Tested on MPC8323ERDB platform.


Signed-off-by: Poonam Aggrwal <b10812@freescale.com>
Signed-off-by: Ashish Kalra <ashish.kalra@freescale.com>
Signed-off-by: Kim Phillips <Kim.Phillips@freescale.com>
Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
---
Incorporated comments of Stephen and Tabi. Please review if they look 
fine.

 arch/powerpc/boot/dts/mpc832x_rdb.dts |   58 +++++++
 arch/powerpc/sysdev/qe_lib/qe.c       |  205 ++++++++++++++++++++++++--
 arch/powerpc/sysdev/qe_lib/ucc.c      |  265 +++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/qe_lib/ucc_fast.c |   37 +++++
 include/asm-powerpc/qe.h              |    8 +
 include/asm-powerpc/ucc.h             |    4 +
 include/asm-powerpc/ucc_fast.h        |    4 +
 7 files changed, 568 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..c0e6283 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -105,6 +105,17 @@
 			device_type = "par_io";
 			num-ports = <7>;
 
+			ucc1pio:ucc_pin@01 {
+				pio-map = <
+			/* port  pin  dir  open_drain  assignment  has_irq */
+					0  e  2  0  1  0	/* CLK11 */
+					3 16  1  0  2  0	/* BRG9 */
+					3 1b  1  0  2  0	/* BRG3 */
+					0  0  3  0  2  0	/* TDMATxD0 */
+					0  4  3  0  2  0	/* TDMARxD0 */
+					3 1b  2  0  1  0>;	/* CLK1 */
+			};
+
 			ucc2pio:ucc_pin@02 {
 				pio-map = <
 			/* port  pin  dir  open_drain  assignment  has_irq */
@@ -169,6 +180,36 @@
 			};
 		};
 
+		clocks {
+			compatible = "fsl,cpm-clocks";
+			/* clock freqs in Hz(for CLK1~CLK24).
+			 * CLK11 is 1024KHz,
+			 * all other clocks unused
+			 * #clock-cells define number of cells
+			 * used by the clock-frequency.
+			 * right now only #clock cells=1 is
+			 * implemented. Provision is there to
+			 * handle frequencies >4Gig
+			 */
+			#clock-cells = <1>;
+			clock-frequency = <0 0 0 0 0 0
+					   0 0 0 0 d#1024000 0
+					   0 0 0 0 0 0
+					   0 0 0 0 0 0>;
+		};
+
+		brg@640 {
+			compatible = "fsl,cpm-brg";
+			/* input clock sources for all the 16 BRGs.
+			 * 1-24 for CLK1 to CLK24.
+			 * BRG9 uses CLK11,BRG1 and BRG2-8 use
+			 * the QE clock.
+			 */
+			fsl,brg-sources = <0 0 0 0 0 0 0 0
+					   b 0 0 0 0 0 0 0>;
+			reg = <640 7f>;
+		};
+
 		spi@4c0 {
 			device_type = "spi";
 			compatible = "fsl_spi";
@@ -187,6 +228,23 @@
 			mode = "cpu";
 		};
 
+		ucc@2000 {
+			device_type = "tdm";
+			compatible = "fsl,ucc-tdm";
+			model = "UCC";
+			device-id = <1>;
+			fsl,tdm-num = <1>;
+			fsl,si-num = <1>;
+			fsl,tdm-tx-clk = "CLK1";
+			fsl,tdm-rx-clk = "CLK1";
+			fsl,tdm-tx-sync = "BRG9";
+			fsl,tdm-rx-sync = "BRG9";
+			reg = <2000 200>;
+			interrupts = <20>;
+			interrupt-parent = <&qeic>;
+			pio-handle = <&ucc1pio>;
+		};
+
 		ucc@3000 {
 			device_type = "network";
 			compatible = "ucc_geth";
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1df3b4a..f1bc902 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -149,20 +149,189 @@ EXPORT_SYMBOL(qe_issue_cmd);
  */
 static unsigned int brg_clk = 0;
 
-unsigned int get_brg_clk(void)
+u32 get_brg_clk(enum qe_clock brgclk, enum qe_clock *brg_source)
 {
-	struct device_node *qe;
-	if (brg_clk)
-		return brg_clk;
+	struct device_node *qe, *brg, *clocks;
+	enum qe_clock brg_src;
+	u32 brg_input_freq = 0;
+	u32 brg_num;
+	int ret;
+	const unsigned int *prop;
 
-	qe = of_find_node_by_type(NULL, "qe");
-	if (qe) {
+	*brg_source = 0;
+
+	brg_num = brgclk - QE_BRG1;
+	brg = of_find_compatible_node(NULL, NULL, "fsl,cpm-brg");
+	if (brg) {
 		unsigned int size;
-		const u32 *prop = of_get_property(qe, "brg-frequency", &size);
-		brg_clk = *prop;
-		of_node_put(qe);
-	};
-	return brg_clk;
+		prop = of_get_property(brg,
+					"fsl,brg-sources", &size);
+		of_node_put(brg);
+
+		if (prop && *prop >= 1 && *prop <= 24)
+			brg_src = *(prop + brg_num);
+		else {
+			printk(KERN_ERR "%s: invalid fsl,brg-sources in device "
+				"tree\n", __FUNCTION__);
+			ret = -EINVAL;
+			goto err;
+		}
+		if (brg_src == 0) {
+			*brg_source = 0;
+			if (brg_clk > 0)
+				return brg_clk;
+			qe = of_find_node_by_type(NULL, "qe");
+			if (qe) {
+				unsigned int size;
+				prop = of_get_property
+						(qe, "brg-frequency", &size);
+				if (!prop) {
+					printk(KERN_ERR "%s: QE brg-frequency"
+						"not present in device tree\n",
+						 __FUNCTION__);
+					ret = -EINVAL;
+					of_node_put(qe);
+					goto err;
+				}
+				if (*prop) {
+					of_node_put(qe);
+					brg_clk = *prop;
+					return *prop;
+				} else {
+				/*
+				 * Older versions of U-Boot do not initialize
+				 * the brg-frequency property, so in this case
+				 * we assume the BRG frequency is half the QE
+				 * bus frequency.
+				 */
+					prop = of_get_property(qe,
+						 "bus-frequency", NULL);
+					of_node_put(qe);
+					if (!prop) {
+						printk(KERN_ERR "%s: "
+						" QE bus-frequency not present"
+						" in device tree\n",
+						 __FUNCTION__);
+						ret = -EINVAL;
+						goto err;
+					}
+					if (*prop) {
+						brg_clk = *prop / 2;
+						return brg_clk;
+					} else {
+						printk(KERN_ERR "%s: invalid"
+						" QE bus-frequency in device"
+						" tree\n", __FUNCTION__);
+						ret = -EINVAL;
+						goto err;
+					}
+				}
+			} else {
+				printk(KERN_ERR "%s: no qe node in device tree"
+					"\n", __FUNCTION__);
+				ret = EINVAL;
+				goto err;
+			}
+		} else {
+			*brg_source = brg_src + QE_CLK1 - 1;
+			clocks = of_find_compatible_node(NULL, NULL,
+							"fsl,cpm-clocks");
+			if (!clocks) {
+				printk(KERN_ERR "%s: no clocks node in device"
+					" tree \n", __FUNCTION__);
+				ret = -EINVAL;
+				goto err;
+			} else {
+				prop = of_get_property(clocks,
+						"#clock-cells", &size);
+				/*
+				 * clock-cells = 1 only supported right now.
+				 */
+				if (!prop || *prop != 1) {
+					printk(KERN_ERR "%s: invalid "
+					"#clock-cells value in device tree \n",
+					 __FUNCTION__);
+					of_node_put(clocks);
+					ret = -EINVAL;
+					goto err;
+				}
+
+				prop = of_get_property(clocks,
+						"clock-frequency", &size);
+				if (!prop) {
+					printk(KERN_ERR "%s: no"
+					" #clock-frequency prop in device"
+					" tree\n", __FUNCTION__);
+					of_node_put(clocks);
+					ret = -EINVAL;
+					goto err;
+				}
+				brg_input_freq = *(prop+(brg_src - 1));
+				of_node_put(clocks);
+				return brg_input_freq;
+			}
+		}
+	} else {
+		printk(KERN_ERR "%s: no brg node in device tree\n",
+			 __FUNCTION__);
+		ret = -EINVAL;
+		goto err;
+	}
+err: return ret;
+}
+
+u32 qe_brg_src(int brg_num, enum qe_clock brg_src)
+{
+	u32 clock_bits, shift;
+
+	clock_bits = 0;
+
+	switch (brg_num) {
+	case 1:
+	case 2:
+	case 5:
+	case 6:
+		switch (brg_src) {
+		case QE_CLK3:   clock_bits = 1; break;
+		case QE_CLK5:   clock_bits = 2; break;
+		default: break;
+		}
+		break;
+	case 3:
+	case 4:
+	case 7:
+	case 8:
+		switch (brg_src) {
+		case QE_CLK9:    clock_bits = 1; break;
+		case QE_CLK15:   clock_bits = 2; break;
+		default: break;
+		}
+		break;
+	case 9:
+	case 10:
+		switch (brg_src) {
+		case QE_CLK11:    clock_bits = 1; break;
+		default: break;
+		}
+		break;
+	case 11:
+	case 15:
+	case 16:
+		switch (brg_src) {
+		case QE_CLK13:    clock_bits = 1; break;
+		default: break;
+		}
+		break;
+	default: clock_bits = 0; break;
+	}
+	shift = 14;
+
+	if (!clock_bits)
+		return -ENOENT;
+
+	clock_bits <<= shift;
+
+	return clock_bits;
 }
 
 /* Program the BRG to the given sampling rate and multiplier
@@ -177,11 +346,18 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
 {
 	u32 divisor, tempval;
 	u32 div16 = 0;
+	u32 brg_clock;
+	enum qe_clock brgsrc;
+	u32 src_bits = 0;
 
 	if ((brg < QE_BRG1) || (brg > QE_BRG16))
 		return -EINVAL;
 
-	divisor = get_brg_clk() / (rate * multiplier);
+	brg_clock = get_brg_clk(brg, &brgsrc);
+	if (brg_clock < 0)
+		return -EINVAL;
+
+	divisor = brg_clock / (rate * multiplier);
 
 	if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
 		div16 = QE_BRGC_DIV16;
@@ -194,8 +370,11 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
 	if (!div16 && (divisor & 1))
 		divisor++;
 
+	if (brgsrc > 0)
+		src_bits = qe_brg_src(brg - QE_BRG1 + 1, brgsrc);
+
 	tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
-		QE_BRGC_ENABLE | div16;
+		QE_BRGC_ENABLE | div16 | src_bits;
 
 	out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
 
diff --git a/arch/powerpc/sysdev/qe_lib/ucc.c b/arch/powerpc/sysdev/qe_lib/ucc.c
index 0e348d9..f2de0ed 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc.c
@@ -213,3 +213,268 @@ int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
 
 	return 0;
 }
+
+int ucc_set_tdm_rxtx_clk(int tdm_num, char *clk_src, enum comm_dir mode)
+{
+	enum qe_clock clock;
+	u32 clock_bits, shift;
+	struct qe_mux *qe_mux_reg = NULL;
+
+	clock_bits = 0;
+	qe_mux_reg = &qe_immr->qmx;
+
+	if ((tdm_num > 3 || tdm_num < 0))
+		return -EINVAL;
+
+	/* The communications direction must be RX or TX */
+	if (!((mode == COMM_DIR_RX) || (mode == COMM_DIR_TX)))
+		return -EINVAL;
+
+	clock = qe_clock_source(clk_src);
+	switch (mode) {
+	case COMM_DIR_RX:
+		switch (tdm_num) {
+		case 0:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK3:   clock_bits = 6; break;
+			case QE_CLK8:   clock_bits = 7; break;
+			default: break;
+			}
+			shift = 28;
+			break;
+		case 1:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK5:   clock_bits = 6; break;
+			case QE_CLK10:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 24;
+			break;
+		case 2:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK7:   clock_bits = 6; break;
+			case QE_CLK12:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 20;
+			break;
+		case 3:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK9:   clock_bits = 6; break;
+			case QE_CLK14:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 16;
+			break;
+		default:
+			break;
+		}
+		break;
+	case COMM_DIR_TX:
+		switch (tdm_num) {
+		case 0:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK4:   clock_bits = 6; break;
+			case QE_CLK9:   clock_bits = 7; break;
+			default: break;
+			}
+			shift = 12;
+			break;
+		case 1:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK6:   clock_bits = 6; break;
+			case QE_CLK11:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 8;
+			break;
+		case 2:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK8:   clock_bits = 6; break;
+			case QE_CLK13:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 4;
+			break;
+		case 3:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK10:  clock_bits = 6; break;
+			case QE_CLK15:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 0;
+			break;
+		default:
+			break;
+		}
+		break;
+	default:
+		break;
+	}
+
+	if (!clock_bits)
+		return -ENOENT;
+
+	clock_bits <<= shift;
+
+	qe_mux_reg->cmxsi1cr_l |= clock_bits;
+
+	return 0;
+}
+
+int ucc_set_tdm_rxtx_sync(int tdm_num, char *sync_src, enum comm_dir mode)
+{
+	enum qe_clock clock;
+	u32 shift, clock_bits;
+	struct qe_mux *qe_mux_reg = NULL;
+	int source;
+
+	source = -1;
+	qe_mux_reg = &qe_immr->qmx;
+
+	if ((tdm_num > 3 || tdm_num < 0))
+		return -EINVAL;
+
+	/* The communications direction must be RX or TX */
+	if (!((mode == COMM_DIR_RX) || (mode == COMM_DIR_TX)))
+		return -EINVAL;
+
+	switch (mode) {
+	case COMM_DIR_RX:
+		if (strcasecmp("RSYNC", sync_src) == 0) {
+			source = 0;
+			shift = 0;
+			break;
+		}
+		clock = qe_clock_source(sync_src);
+		switch (tdm_num) {
+		case 0:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG10:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 30;
+			break;
+		case 1:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG10:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 28;
+			break;
+		case 2:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG11:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 26;
+			break;
+		case 3:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG11:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 24;
+			break;
+		default:
+			source = -1;
+			break;
+		}
+		break;
+	case COMM_DIR_TX:
+		if (strcasecmp("TSYNC", sync_src) == 0) {
+			source = 0;
+			shift = 0;
+			break;
+		}
+		clock = qe_clock_source(sync_src);
+		switch (tdm_num) {
+		case 0:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG10:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 14;
+			break;
+		case 1:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG10:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 12;
+			break;
+		case 2:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG11:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 10;
+			break;
+		case 3:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG11:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 8;
+			break;
+		default:
+			source = -1;
+			break;
+		}
+		break;
+	default:
+		source = -1;
+		break;
+	}
+
+	if (source == -1)
+		return -ENOENT;
+
+	clock_bits = (u32) source;
+	clock_bits <<= shift;
+
+
+	qe_mux_reg->cmxsi1syr  |= clock_bits;
+
+	return 0;
+}
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
index 3223acb..9c8559f 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
@@ -327,6 +327,43 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 			ucc_fast_free(uccf);
 			return -EINVAL;
 		}
+	} else {
+		/* TDM Rx clock routing */
+		if ((uf_info->tdm_rx_clk != NULL) &&
+			ucc_set_tdm_rxtx_clk(uf_info->ucc_num,
+				uf_info->tdm_rx_clk, COMM_DIR_RX)) {
+			printk(KERN_ERR "%s: illegal value for TDM RX clock",
+				__FUNCTION__);
+			ucc_fast_free(uccf);
+			return -EINVAL;
+		}
+		/* TDM Tx clock routing */
+		if ((uf_info->tdm_tx_clk != NULL) &&
+			ucc_set_tdm_rxtx_clk(uf_info->ucc_num,
+				uf_info->tdm_tx_clk, COMM_DIR_TX)) {
+			printk(KERN_ERR "%s: illegal value for TDM TX clock",
+				__FUNCTION__);
+			ucc_fast_free(uccf);
+			return -EINVAL;
+		}
+		/* TDM Rx sync routing */
+		if ((uf_info->tdm_rx_sync != NULL) &&
+			ucc_set_tdm_rxtx_sync(uf_info->ucc_num,
+				uf_info->tdm_rx_sync, COMM_DIR_RX)) {
+			printk(KERN_ERR "%s: illegal value for TDM RX"
+				"Frame sync", __FUNCTION__);
+			ucc_fast_free(uccf);
+			return -EINVAL;
+		}
+		/* TDM Tx sync routing */
+		if ((uf_info->tdm_tx_sync != NULL) &&
+			ucc_set_tdm_rxtx_sync(uf_info->ucc_num,
+				uf_info->tdm_tx_sync, COMM_DIR_TX)) {
+			printk(KERN_ERR "%s: illegal value for TDM TX"
+					"Frame sync", __FUNCTION__);
+			ucc_fast_free(uccf);
+			return -EINVAL;
+		}
 	}
 
 	/* Set interrupt mask register at UCC level. */
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index bcf60be..51de236 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -497,6 +497,14 @@ struct ucc_slow_pram {
 #define UCC_GETH_UCCE_RXF1      0x00000002
 #define UCC_GETH_UCCE_RXF0      0x00000001
 
+/* Transparent UCC Event Register (UCCE) */
+#define UCC_TRANS_UCCE_GRA	0x0080
+#define UCC_TRANS_UCCE_TXE	0x0010
+#define UCC_TRANS_UCCE_RXF	0x0008
+#define UCC_TRANS_UCCE_BSY	0x0004
+#define UCC_TRANS_UCCE_TXB	0x0002
+#define UCC_TRANS_UCCE_RXB	0x0001
+
 /* UPSMR, when used as a UART */
 #define UCC_UART_UPSMR_FLC		0x8000
 #define UCC_UART_UPSMR_SL		0x4000
diff --git a/include/asm-powerpc/ucc.h b/include/asm-powerpc/ucc.h
index 46b09ba..153db97 100644
--- a/include/asm-powerpc/ucc.h
+++ b/include/asm-powerpc/ucc.h
@@ -42,6 +42,10 @@ int ucc_set_qe_mux_mii_mng(unsigned int ucc_num);
 int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
 	enum comm_dir mode);
 
+int ucc_set_tdm_rxtx_clk(int tdm_num, char *clk_src, enum comm_dir mode);
+
+int ucc_set_tdm_rxtx_sync(int tdm_num, char *clk_src, enum comm_dir mode);
+
 int ucc_mux_set_grant_tsa_bkpt(unsigned int ucc_num, int set, u32 mask);
 
 /* QE MUX clock routing for UCC
diff --git a/include/asm-powerpc/ucc_fast.h b/include/asm-powerpc/ucc_fast.h
index f529f70..d267983 100644
--- a/include/asm-powerpc/ucc_fast.h
+++ b/include/asm-powerpc/ucc_fast.h
@@ -152,6 +152,10 @@ struct ucc_fast_info {
 	enum ucc_fast_rx_decoding_method renc;
 	enum ucc_fast_transparent_tcrc tcrc;
 	enum ucc_fast_sync_len synl;
+	char *tdm_rx_clk;
+	char *tdm_tx_clk;
+	char *tdm_rx_sync;
+	char *tdm_tx_sync;
 };
 
 struct ucc_fast_private {
-- 
1.5.3.3

^ permalink raw reply related

* Update ip command line processing
From: Simon Horman @ 2007-12-18  8:57 UTC (permalink / raw)
  To: linux-kernel, netdev; +Cc: Amos Waterland, David Miller

Recently the documentation in Documentation/nfsroot.txt was
update to note that in fact ip=off and ip=::::::off as the
latter is ignored and the default (on) is used.

This was certainly a step in the direction of reducing confusion.
But it seems to me that the code ought to be fixed up so that
ip=::::::off actually turns off ip autoconfiguration.

This patch also notes more specifically that ip=on (aka ip=::::::on)
is the default.

Cc: Amos Waterland <apw@us.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>

Index: net-2.6.25/net/ipv4/ipconfig.c
===================================================================
--- net-2.6.25.orig/net/ipv4/ipconfig.c	2007-12-18 17:45:07.000000000 +0900
+++ net-2.6.25/net/ipv4/ipconfig.c	2007-12-18 17:45:52.000000000 +0900
@@ -1414,9 +1414,16 @@ late_initcall(ip_auto_config);
  */
 static int __init ic_proto_name(char *name)
 {
+	if (!name) {
+		return 1;
+	}
 	if (!strcmp(name, "on") || !strcmp(name, "any")) {
 		return 1;
 	}
+	if (!strcmp(name, "off") || !strcmp(name, "none")) {
+		ic_enable = 0;
+		return 1;
+	}
 #ifdef CONFIG_IP_PNP_DHCP
 	else if (!strcmp(name, "dhcp")) {
 		ic_proto_enabled &= ~IC_RARP;
@@ -1451,12 +1458,6 @@ static int __init ip_auto_config_setup(c
 
 	ic_set_manually = 1;
 
-	ic_enable = (*addrs &&
-		(strcmp(addrs, "off") != 0) &&
-		(strcmp(addrs, "none") != 0));
-	if (!ic_enable)
-		return 1;
-
 	if (ic_proto_name(addrs))
 		return 1;
 
Index: net-2.6.25/Documentation/nfsroot.txt
===================================================================
--- net-2.6.25.orig/Documentation/nfsroot.txt	2007-12-18 17:46:47.000000000 +0900
+++ net-2.6.25/Documentation/nfsroot.txt	2007-12-18 17:48:51.000000000 +0900
@@ -97,10 +97,6 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netm
   autoconfiguration will take place.  The most common way to use this
   is "ip=dhcp".
 
-  Note that "ip=off" is not the same thing as "ip=::::::off", because in
-  the latter autoconfiguration will take place if any of DHCP, BOOTP or RARP
-  are compiled in the kernel.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox