<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/net/core/dev.c, branch v3.0-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>net: tracepoint of net_dev_xmit sees freed skb and causes panic</title>
<updated>2011-06-02T21:06:31+00:00</updated>
<author>
<name>Koki Sanagi</name>
<email>sanagi.koki@jp.fujitsu.com</email>
</author>
<published>2011-05-30T21:48:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ec764bf083a6ff396234351b51fd236f53c903bf'/>
<id>ec764bf083a6ff396234351b51fd236f53c903bf</id>
<content type='text'>
Because there is a possibility that skb is kfree_skb()ed and zero cleared
after ndo_start_xmit, we should not see the contents of skb like skb-&gt;len and
skb-&gt;dev-&gt;name after ndo_start_xmit. But trace_net_dev_xmit does that
and causes panic by NULL pointer dereference.
This patch fixes trace_net_dev_xmit not to see the contents of skb directly.

If you want to reproduce this panic,

1. Get tracepoint of net_dev_xmit on
2. Create 2 guests on KVM
2. Make 2 guests use virtio_net
4. Execute netperf from one to another for a long time as a network burden
5. host will panic(It takes about 30 minutes)

Signed-off-by: Koki Sanagi &lt;sanagi.koki@jp.fujitsu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because there is a possibility that skb is kfree_skb()ed and zero cleared
after ndo_start_xmit, we should not see the contents of skb like skb-&gt;len and
skb-&gt;dev-&gt;name after ndo_start_xmit. But trace_net_dev_xmit does that
and causes panic by NULL pointer dereference.
This patch fixes trace_net_dev_xmit not to see the contents of skb directly.

If you want to reproduce this panic,

1. Get tracepoint of net_dev_xmit on
2. Create 2 guests on KVM
2. Make 2 guests use virtio_net
4. Execute netperf from one to another for a long time as a network burden
5. host will panic(It takes about 30 minutes)

Signed-off-by: Koki Sanagi &lt;sanagi.koki@jp.fujitsu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: make dev_disable_lro use physical device if passed a vlan dev (v2)</title>
<updated>2011-05-25T21:55:25+00:00</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2011-05-24T08:31:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f11970e383acd6f505f492f1bc07fb1a4d884829'/>
<id>f11970e383acd6f505f492f1bc07fb1a4d884829</id>
<content type='text'>
If the device passed into dev_disable_lro is a vlan, then repoint the dev
poniter so that we actually modify the underlying physical device.

Signed-of-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: davem@davemloft.net
CC: bhutchings@solarflare.com

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the device passed into dev_disable_lro is a vlan, then repoint the dev
poniter so that we actually modify the underlying physical device.

Signed-of-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: davem@davemloft.net
CC: bhutchings@solarflare.com

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: use synchronize_rcu_expedited()</title>
<updated>2011-05-24T17:26:12+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-05-23T23:07:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=be3fc413da9eb17cce0991f214ab019d16c88c41'/>
<id>be3fc413da9eb17cce0991f214ab019d16c88c41</id>
<content type='text'>
synchronize_rcu() is very slow in various situations (HZ=100,
CONFIG_NO_HZ=y, CONFIG_PREEMPT=n)

Extract from my (mostly idle) 8 core machine :

 synchronize_rcu() in 99985 us
 synchronize_rcu() in 79982 us
 synchronize_rcu() in 87612 us
 synchronize_rcu() in 79827 us
 synchronize_rcu() in 109860 us
 synchronize_rcu() in 98039 us
 synchronize_rcu() in 89841 us
 synchronize_rcu() in 79842 us
 synchronize_rcu() in 80151 us
 synchronize_rcu() in 119833 us
 synchronize_rcu() in 99858 us
 synchronize_rcu() in 73999 us
 synchronize_rcu() in 79855 us
 synchronize_rcu() in 79853 us

When we hold RTNL mutex, we would like to spend some cpu cycles but not
block too long other processes waiting for this mutex.

We also want to setup/dismantle network features as fast as possible at
boot/shutdown time.

This patch makes synchronize_net() call the expedited version if RTNL is
locked.

synchronize_rcu_expedited() typical delay is about 20 us on my machine.

 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 20 us
 synchronize_rcu_expedited() in 16 us
 synchronize_rcu_expedited() in 20 us
 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 18 us

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
CC: Ben Greear &lt;greearb@candelatech.com&gt;
Reviewed-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
synchronize_rcu() is very slow in various situations (HZ=100,
CONFIG_NO_HZ=y, CONFIG_PREEMPT=n)

Extract from my (mostly idle) 8 core machine :

 synchronize_rcu() in 99985 us
 synchronize_rcu() in 79982 us
 synchronize_rcu() in 87612 us
 synchronize_rcu() in 79827 us
 synchronize_rcu() in 109860 us
 synchronize_rcu() in 98039 us
 synchronize_rcu() in 89841 us
 synchronize_rcu() in 79842 us
 synchronize_rcu() in 80151 us
 synchronize_rcu() in 119833 us
 synchronize_rcu() in 99858 us
 synchronize_rcu() in 73999 us
 synchronize_rcu() in 79855 us
 synchronize_rcu() in 79853 us

When we hold RTNL mutex, we would like to spend some cpu cycles but not
block too long other processes waiting for this mutex.

We also want to setup/dismantle network features as fast as possible at
boot/shutdown time.

This patch makes synchronize_net() call the expedited version if RTNL is
locked.

synchronize_rcu_expedited() typical delay is about 20 us on my machine.

 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 20 us
 synchronize_rcu_expedited() in 16 us
 synchronize_rcu_expedited() in 20 us
 synchronize_rcu_expedited() in 18 us
 synchronize_rcu_expedited() in 18 us

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
CC: Ben Greear &lt;greearb@candelatech.com&gt;
Reviewed-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: remove synchronize_net() from netdev_set_master()</title>
<updated>2011-05-23T01:01:20+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-05-19T19:37:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6df427fe8c481d3be437cbe8bd366bdac82b73c4'/>
<id>6df427fe8c481d3be437cbe8bd366bdac82b73c4</id>
<content type='text'>
In the old days, we used to access dev-&gt;master in __netif_receive_skb()
in a rcu_read_lock section.

So one synchronize_net() call was needed in netdev_set_master() to make
sure another cpu could not use old master while/after we release it.

We now use netdev_rx_handler infrastructure and added one
synchronize_net() call in bond_release()/bond_release_all()

Remove the obsolete synchronize_net() from netdev_set_master() and add
one in bridge del_nbp() after its netdev_rx_handler_unregister() call.

This makes enslave -d a bit faster.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Jiri Pirko &lt;jpirko@redhat.com&gt;
CC: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the old days, we used to access dev-&gt;master in __netif_receive_skb()
in a rcu_read_lock section.

So one synchronize_net() call was needed in netdev_set_master() to make
sure another cpu could not use old master while/after we release it.

We now use netdev_rx_handler infrastructure and added one
synchronize_net() call in bond_release()/bond_release_all()

Remove the obsolete synchronize_net() from netdev_set_master() and add
one in bridge del_nbp() after its netdev_rx_handler_unregister() call.

This makes enslave -d a bit faster.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Jiri Pirko &lt;jpirko@redhat.com&gt;
CC: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>macvlan: remove one synchronize_rcu() call</title>
<updated>2011-05-20T04:33:18+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-05-19T12:24:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=449f4544267e73d5db372971da63634707c32299'/>
<id>449f4544267e73d5db372971da63634707c32299</id>
<content type='text'>
When one macvlan device is dismantled, we can avoid one
synchronize_rcu() call done after deletion from hash list, since caller
will perform a synchronize_net() call after its ndo_stop() call.

Add a new netdev-&gt;dismantle field to signal this dismantle intent.

Reduces RTNL hold time.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Patrick McHardy &lt;kaber@trash.net&gt;
CC: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When one macvlan device is dismantled, we can avoid one
synchronize_rcu() call done after deletion from hash list, since caller
will perform a synchronize_net() call after its ndo_stop() call.

Add a new netdev-&gt;dismantle field to signal this dismantle intent.

Reduces RTNL hold time.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Patrick McHardy &lt;kaber@trash.net&gt;
CC: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6</title>
<updated>2011-05-17T21:33:11+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-05-17T21:33:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9cbc94eabb0791906051bbfac024ef2c2be8e079'/>
<id>9cbc94eabb0791906051bbfac024ef2c2be8e079</id>
<content type='text'>
Conflicts:
	drivers/net/vmxnet3/vmxnet3_ethtool.c
	net/core/dev.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	drivers/net/vmxnet3/vmxnet3_ethtool.c
	net/core/dev.c
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Change netdev_fix_features messages loglevel</title>
<updated>2011-05-17T19:44:10+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2011-05-16T10:37:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=604ae14ffb6d75d6eef4757859226b758d6bf9e3'/>
<id>604ae14ffb6d75d6eef4757859226b758d6bf9e3</id>
<content type='text'>
Cool, how about we make 'Features changed' debug as well?
This way userspace can't fill up the log just by tweaking tun features
with an ioctl.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cool, how about we make 'Features changed' debug as well?
This way userspace can't fill up the log just by tweaking tun features
with an ioctl.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: use hlist_del_rcu() in dev_change_name()</title>
<updated>2011-05-17T17:56:59+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-05-17T17:56:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=372b2312010bece1e36f577d6c99a6193ec54cbd'/>
<id>372b2312010bece1e36f577d6c99a6193ec54cbd</id>
<content type='text'>
Using plain hlist_del() in dev_change_name() is wrong since a
concurrent reader can crash trying to dereference LIST_POISON1.

Bug introduced in commit 72c9528bab94 (net: Introduce
dev_get_by_name_rcu())

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using plain hlist_del() in dev_change_name() is wrong since a
concurrent reader can crash trying to dereference LIST_POISON1.

Bug introduced in commit 72c9528bab94 (net: Introduce
dev_get_by_name_rcu())

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Change netdev_fix_features messages loglevel</title>
<updated>2011-05-16T19:14:21+00:00</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2011-05-16T19:14:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6f404e441d169afc90929ef5e451ec9779c1f11a'/>
<id>6f404e441d169afc90929ef5e451ec9779c1f11a</id>
<content type='text'>
Those reduced to DEBUG can possibly be triggered by unprivileged processes
and are nothing exceptional. Illegal checksum combinations can only be
caused by driver bug, so promote those messages to WARN.

Since GSO without SG will now only cause DEBUG message from
netdev_fix_features(), remove the workaround from register_netdevice().

Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Those reduced to DEBUG can possibly be triggered by unprivileged processes
and are nothing exceptional. Illegal checksum combinations can only be
caused by driver bug, so promote those messages to WARN.

Since GSO without SG will now only cause DEBUG message from
netdev_fix_features(), remove the workaround from register_netdevice().

Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net:set valid name before calling ndo_init()</title>
<updated>2011-05-13T20:49:49+00:00</updated>
<author>
<name>Peter Pan(潘卫平)</name>
<email>panweiping3@gmail.com</email>
</author>
<published>2011-05-12T15:46:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0696c3a8acd3b7c3186dd231d65d97e05a75189f'/>
<id>0696c3a8acd3b7c3186dd231d65d97e05a75189f</id>
<content type='text'>
In commit 1c5cae815d19 (net: call dev_alloc_name from register_netdevice),
a bug of bonding was involved, see example 1 and 2.

In register_netdevice(), the name of net_device is not valid until
dev_get_valid_name() is called. But dev-&gt;netdev_ops-&gt;ndo_init(that is
bond_init) is called before dev_get_valid_name(),
and it uses the invalid name of net_device.

I think register_netdevice() should make sure that the name of net_device is
valid before calling ndo_init().

example 1:
modprobe bonding
ls  /proc/net/bonding/bond%d

ps -eLf
root      3398     2  3398  0    1 21:34 ?        00:00:00 [bond%d]

example 2:
modprobe bonding max_bonds=3

[  170.100292] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[  170.101090] bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.
[  170.102469] ------------[ cut here ]------------
[  170.103150] WARNING: at /home/pwp/net-next-2.6/fs/proc/generic.c:586 proc_register+0x126/0x157()
[  170.104075] Hardware name: VirtualBox
[  170.105065] proc_dir_entry 'bonding/bond%d' already registered
[  170.105613] Modules linked in: bonding(+) sunrpc ipv6 uinput microcode ppdev parport_pc parport joydev e1000 pcspkr i2c_piix4 i2c_core [last unloaded: bonding]
[  170.108397] Pid: 3457, comm: modprobe Not tainted 2.6.39-rc2+ #14
[  170.108935] Call Trace:
[  170.109382]  [&lt;c0438f3b&gt;] warn_slowpath_common+0x6a/0x7f
[  170.109911]  [&lt;c051a42a&gt;] ? proc_register+0x126/0x157
[  170.110329]  [&lt;c0438fc3&gt;] warn_slowpath_fmt+0x2b/0x2f
[  170.110846]  [&lt;c051a42a&gt;] proc_register+0x126/0x157
[  170.111870]  [&lt;c051a4dd&gt;] proc_create_data+0x82/0x98
[  170.112335]  [&lt;f94e6af6&gt;] bond_create_proc_entry+0x3f/0x73 [bonding]
[  170.112905]  [&lt;f94dd806&gt;] bond_init+0x77/0xa5 [bonding]
[  170.113319]  [&lt;c0721ac6&gt;] register_netdevice+0x8c/0x1d3
[  170.113848]  [&lt;f94e0e30&gt;] bond_create+0x6c/0x90 [bonding]
[  170.114322]  [&lt;f94f4763&gt;] bonding_init+0x763/0x7b1 [bonding]
[  170.114879]  [&lt;c0401240&gt;] do_one_initcall+0x76/0x122
[  170.115317]  [&lt;f94f4000&gt;] ? 0xf94f3fff
[  170.115799]  [&lt;c0463f1e&gt;] sys_init_module+0x1286/0x140d
[  170.116879]  [&lt;c07c6d9f&gt;] sysenter_do_call+0x12/0x28
[  170.117404] ---[ end trace 64e4fac3ae5fff1a ]---
[  170.117924] bond%d: Warning: failed to register to debugfs
[  170.128728] ------------[ cut here ]------------
[  170.129360] WARNING: at /home/pwp/net-next-2.6/fs/proc/generic.c:586 proc_register+0x126/0x157()
[  170.130323] Hardware name: VirtualBox
[  170.130797] proc_dir_entry 'bonding/bond%d' already registered
[  170.131315] Modules linked in: bonding(+) sunrpc ipv6 uinput microcode ppdev parport_pc parport joydev e1000 pcspkr i2c_piix4 i2c_core [last unloaded: bonding]
[  170.133731] Pid: 3457, comm: modprobe Tainted: G        W   2.6.39-rc2+ #14
[  170.134308] Call Trace:
[  170.134743]  [&lt;c0438f3b&gt;] warn_slowpath_common+0x6a/0x7f
[  170.135305]  [&lt;c051a42a&gt;] ? proc_register+0x126/0x157
[  170.135820]  [&lt;c0438fc3&gt;] warn_slowpath_fmt+0x2b/0x2f
[  170.137168]  [&lt;c051a42a&gt;] proc_register+0x126/0x157
[  170.137700]  [&lt;c051a4dd&gt;] proc_create_data+0x82/0x98
[  170.138174]  [&lt;f94e6af6&gt;] bond_create_proc_entry+0x3f/0x73 [bonding]
[  170.138745]  [&lt;f94dd806&gt;] bond_init+0x77/0xa5 [bonding]
[  170.139278]  [&lt;c0721ac6&gt;] register_netdevice+0x8c/0x1d3
[  170.139828]  [&lt;f94e0e30&gt;] bond_create+0x6c/0x90 [bonding]
[  170.140361]  [&lt;f94f4763&gt;] bonding_init+0x763/0x7b1 [bonding]
[  170.140927]  [&lt;c0401240&gt;] do_one_initcall+0x76/0x122
[  170.141494]  [&lt;f94f4000&gt;] ? 0xf94f3fff
[  170.141975]  [&lt;c0463f1e&gt;] sys_init_module+0x1286/0x140d
[  170.142463]  [&lt;c07c6d9f&gt;] sysenter_do_call+0x12/0x28
[  170.142974] ---[ end trace 64e4fac3ae5fff1b ]---
[  170.144949] bond%d: Warning: failed to register to debugfs

Signed-off-by: Weiping Pan &lt;panweiping3@gmail.com&gt;
Reviewed-by: Jiri Pirko &lt;jpirko@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In commit 1c5cae815d19 (net: call dev_alloc_name from register_netdevice),
a bug of bonding was involved, see example 1 and 2.

In register_netdevice(), the name of net_device is not valid until
dev_get_valid_name() is called. But dev-&gt;netdev_ops-&gt;ndo_init(that is
bond_init) is called before dev_get_valid_name(),
and it uses the invalid name of net_device.

I think register_netdevice() should make sure that the name of net_device is
valid before calling ndo_init().

example 1:
modprobe bonding
ls  /proc/net/bonding/bond%d

ps -eLf
root      3398     2  3398  0    1 21:34 ?        00:00:00 [bond%d]

example 2:
modprobe bonding max_bonds=3

[  170.100292] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[  170.101090] bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.
[  170.102469] ------------[ cut here ]------------
[  170.103150] WARNING: at /home/pwp/net-next-2.6/fs/proc/generic.c:586 proc_register+0x126/0x157()
[  170.104075] Hardware name: VirtualBox
[  170.105065] proc_dir_entry 'bonding/bond%d' already registered
[  170.105613] Modules linked in: bonding(+) sunrpc ipv6 uinput microcode ppdev parport_pc parport joydev e1000 pcspkr i2c_piix4 i2c_core [last unloaded: bonding]
[  170.108397] Pid: 3457, comm: modprobe Not tainted 2.6.39-rc2+ #14
[  170.108935] Call Trace:
[  170.109382]  [&lt;c0438f3b&gt;] warn_slowpath_common+0x6a/0x7f
[  170.109911]  [&lt;c051a42a&gt;] ? proc_register+0x126/0x157
[  170.110329]  [&lt;c0438fc3&gt;] warn_slowpath_fmt+0x2b/0x2f
[  170.110846]  [&lt;c051a42a&gt;] proc_register+0x126/0x157
[  170.111870]  [&lt;c051a4dd&gt;] proc_create_data+0x82/0x98
[  170.112335]  [&lt;f94e6af6&gt;] bond_create_proc_entry+0x3f/0x73 [bonding]
[  170.112905]  [&lt;f94dd806&gt;] bond_init+0x77/0xa5 [bonding]
[  170.113319]  [&lt;c0721ac6&gt;] register_netdevice+0x8c/0x1d3
[  170.113848]  [&lt;f94e0e30&gt;] bond_create+0x6c/0x90 [bonding]
[  170.114322]  [&lt;f94f4763&gt;] bonding_init+0x763/0x7b1 [bonding]
[  170.114879]  [&lt;c0401240&gt;] do_one_initcall+0x76/0x122
[  170.115317]  [&lt;f94f4000&gt;] ? 0xf94f3fff
[  170.115799]  [&lt;c0463f1e&gt;] sys_init_module+0x1286/0x140d
[  170.116879]  [&lt;c07c6d9f&gt;] sysenter_do_call+0x12/0x28
[  170.117404] ---[ end trace 64e4fac3ae5fff1a ]---
[  170.117924] bond%d: Warning: failed to register to debugfs
[  170.128728] ------------[ cut here ]------------
[  170.129360] WARNING: at /home/pwp/net-next-2.6/fs/proc/generic.c:586 proc_register+0x126/0x157()
[  170.130323] Hardware name: VirtualBox
[  170.130797] proc_dir_entry 'bonding/bond%d' already registered
[  170.131315] Modules linked in: bonding(+) sunrpc ipv6 uinput microcode ppdev parport_pc parport joydev e1000 pcspkr i2c_piix4 i2c_core [last unloaded: bonding]
[  170.133731] Pid: 3457, comm: modprobe Tainted: G        W   2.6.39-rc2+ #14
[  170.134308] Call Trace:
[  170.134743]  [&lt;c0438f3b&gt;] warn_slowpath_common+0x6a/0x7f
[  170.135305]  [&lt;c051a42a&gt;] ? proc_register+0x126/0x157
[  170.135820]  [&lt;c0438fc3&gt;] warn_slowpath_fmt+0x2b/0x2f
[  170.137168]  [&lt;c051a42a&gt;] proc_register+0x126/0x157
[  170.137700]  [&lt;c051a4dd&gt;] proc_create_data+0x82/0x98
[  170.138174]  [&lt;f94e6af6&gt;] bond_create_proc_entry+0x3f/0x73 [bonding]
[  170.138745]  [&lt;f94dd806&gt;] bond_init+0x77/0xa5 [bonding]
[  170.139278]  [&lt;c0721ac6&gt;] register_netdevice+0x8c/0x1d3
[  170.139828]  [&lt;f94e0e30&gt;] bond_create+0x6c/0x90 [bonding]
[  170.140361]  [&lt;f94f4763&gt;] bonding_init+0x763/0x7b1 [bonding]
[  170.140927]  [&lt;c0401240&gt;] do_one_initcall+0x76/0x122
[  170.141494]  [&lt;f94f4000&gt;] ? 0xf94f3fff
[  170.141975]  [&lt;c0463f1e&gt;] sys_init_module+0x1286/0x140d
[  170.142463]  [&lt;c07c6d9f&gt;] sysenter_do_call+0x12/0x28
[  170.142974] ---[ end trace 64e4fac3ae5fff1b ]---
[  170.144949] bond%d: Warning: failed to register to debugfs

Signed-off-by: Weiping Pan &lt;panweiping3@gmail.com&gt;
Reviewed-by: Jiri Pirko &lt;jpirko@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
