<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/net/core/netpoll.c, branch linux-3.6.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>netpoll: revert 6bdb7fe3104 and fix be_poll() instead</title>
<updated>2012-08-29T19:03:23+00:00</updated>
<author>
<name>Amerigo Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2012-08-24T21:41:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=072a9c48600409d72aeb0d5b29fbb75861a06631'/>
<id>072a9c48600409d72aeb0d5b29fbb75861a06631</id>
<content type='text'>
Against -net.

In the patch "netpoll: re-enable irq in poll_napi()", I tried to
fix the following warning:

[100718.051041] ------------[ cut here ]------------
[100718.051048] WARNING: at kernel/softirq.c:159 local_bh_enable_ip+0x7d/0xb0()
(Not tainted)
[100718.051049] Hardware name: ProLiant BL460c G7
...
[100718.051068] Call Trace:
[100718.051073]  [&lt;ffffffff8106b747&gt;] ? warn_slowpath_common+0x87/0xc0
[100718.051075]  [&lt;ffffffff8106b79a&gt;] ? warn_slowpath_null+0x1a/0x20
[100718.051077]  [&lt;ffffffff810747ed&gt;] ? local_bh_enable_ip+0x7d/0xb0
[100718.051080]  [&lt;ffffffff8150041b&gt;] ? _spin_unlock_bh+0x1b/0x20
[100718.051085]  [&lt;ffffffffa00ee974&gt;] ? be_process_mcc+0x74/0x230 [be2net]
[100718.051088]  [&lt;ffffffffa00ea68c&gt;] ? be_poll_tx_mcc+0x16c/0x290 [be2net]
[100718.051090]  [&lt;ffffffff8144fe76&gt;] ? netpoll_poll_dev+0xd6/0x490
[100718.051095]  [&lt;ffffffffa01d24a5&gt;] ? bond_poll_controller+0x75/0x80 [bonding]
[100718.051097]  [&lt;ffffffff8144fde5&gt;] ? netpoll_poll_dev+0x45/0x490
[100718.051100]  [&lt;ffffffff81161b19&gt;] ? ksize+0x19/0x80
[100718.051102]  [&lt;ffffffff81450437&gt;] ? netpoll_send_skb_on_dev+0x157/0x240

by reenabling IRQ before calling -&gt;poll, but it seems more
problems are introduced after that patch:

http://ozlabs.org/~akpm/stuff/IMG_20120824_122054.jpg
http://marc.info/?l=linux-netdev&amp;m=134563282530588&amp;w=2

So it is safe to fix be2net driver code directly.

This patch reverts the offending commit and fixes be_poll() by
avoid disabling BH there, this is okay because be_poll()
can be called either by poll_napi() which already disables
IRQ, or by net_rx_action() which already disables BH.

Reported-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Reported-by: Sylvain Munaut &lt;s.munaut@whatever-company.com&gt;
Cc: Sylvain Munaut &lt;s.munaut@whatever-company.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Sathya Perla &lt;sathya.perla@emulex.com&gt;
Cc: Subbu Seetharaman &lt;subbu.seetharaman@emulex.com&gt;
Cc: Ajit Khaparde &lt;ajit.khaparde@emulex.com&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Tested-by: Sylvain Munaut &lt;s.munaut@whatever-company.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>
Against -net.

In the patch "netpoll: re-enable irq in poll_napi()", I tried to
fix the following warning:

[100718.051041] ------------[ cut here ]------------
[100718.051048] WARNING: at kernel/softirq.c:159 local_bh_enable_ip+0x7d/0xb0()
(Not tainted)
[100718.051049] Hardware name: ProLiant BL460c G7
...
[100718.051068] Call Trace:
[100718.051073]  [&lt;ffffffff8106b747&gt;] ? warn_slowpath_common+0x87/0xc0
[100718.051075]  [&lt;ffffffff8106b79a&gt;] ? warn_slowpath_null+0x1a/0x20
[100718.051077]  [&lt;ffffffff810747ed&gt;] ? local_bh_enable_ip+0x7d/0xb0
[100718.051080]  [&lt;ffffffff8150041b&gt;] ? _spin_unlock_bh+0x1b/0x20
[100718.051085]  [&lt;ffffffffa00ee974&gt;] ? be_process_mcc+0x74/0x230 [be2net]
[100718.051088]  [&lt;ffffffffa00ea68c&gt;] ? be_poll_tx_mcc+0x16c/0x290 [be2net]
[100718.051090]  [&lt;ffffffff8144fe76&gt;] ? netpoll_poll_dev+0xd6/0x490
[100718.051095]  [&lt;ffffffffa01d24a5&gt;] ? bond_poll_controller+0x75/0x80 [bonding]
[100718.051097]  [&lt;ffffffff8144fde5&gt;] ? netpoll_poll_dev+0x45/0x490
[100718.051100]  [&lt;ffffffff81161b19&gt;] ? ksize+0x19/0x80
[100718.051102]  [&lt;ffffffff81450437&gt;] ? netpoll_send_skb_on_dev+0x157/0x240

by reenabling IRQ before calling -&gt;poll, but it seems more
problems are introduced after that patch:

http://ozlabs.org/~akpm/stuff/IMG_20120824_122054.jpg
http://marc.info/?l=linux-netdev&amp;m=134563282530588&amp;w=2

So it is safe to fix be2net driver code directly.

This patch reverts the offending commit and fixes be_poll() by
avoid disabling BH there, this is okay because be_poll()
can be called either by poll_napi() which already disables
IRQ, or by net_rx_action() which already disables BH.

Reported-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Reported-by: Sylvain Munaut &lt;s.munaut@whatever-company.com&gt;
Cc: Sylvain Munaut &lt;s.munaut@whatever-company.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Sathya Perla &lt;sathya.perla@emulex.com&gt;
Cc: Subbu Seetharaman &lt;subbu.seetharaman@emulex.com&gt;
Cc: Ajit Khaparde &lt;ajit.khaparde@emulex.com&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Tested-by: Sylvain Munaut &lt;s.munaut@whatever-company.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: re-enable irq in poll_napi()</title>
<updated>2012-08-14T21:33:33+00:00</updated>
<author>
<name>Amerigo Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2012-08-10T01:24:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6bdb7fe31046ac50b47e83c35cd6c6b6160a475d'/>
<id>6bdb7fe31046ac50b47e83c35cd6c6b6160a475d</id>
<content type='text'>
napi-&gt;poll() needs IRQ enabled, so we have to re-enable IRQ before
calling it.

Cc: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@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>
napi-&gt;poll() needs IRQ enabled, so we have to re-enable IRQ before
calling it.

Cc: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: handle vlan tags in netpoll tx and rx path</title>
<updated>2012-08-14T21:33:32+00:00</updated>
<author>
<name>Amerigo Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2012-08-10T01:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=689971b44613883ee74ae9c1b31a864aaa3a8e17'/>
<id>689971b44613883ee74ae9c1b31a864aaa3a8e17</id>
<content type='text'>
Without this patch, I can't get netconsole logs remotely over
vlan. The reason is probably we don't handle vlan tags in either
netpoll tx or rx path.

I am not sure if I use these vlan functions correctly, at
least this patch works.

Cc: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Cc: Patrick McHardy &lt;kaber@trash.net&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@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>
Without this patch, I can't get netconsole logs remotely over
vlan. The reason is probably we don't handle vlan tags in either
netpoll tx or rx path.

I am not sure if I use these vlan functions correctly, at
least this patch works.

Cc: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Cc: Patrick McHardy &lt;kaber@trash.net&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: take rcu_read_lock_bh() in netpoll_send_skb_on_dev()</title>
<updated>2012-08-14T21:33:31+00:00</updated>
<author>
<name>Amerigo Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2012-08-10T01:24:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2899656b494dcd118123af1126826b115c8ea6f9'/>
<id>2899656b494dcd118123af1126826b115c8ea6f9</id>
<content type='text'>
This patch fixes several problems in the call path of
netpoll_send_skb_on_dev():

1. Disable IRQ's before calling netpoll_send_skb_on_dev().

2. All the callees of netpoll_send_skb_on_dev() should use
   rcu_dereference_bh() to dereference -&gt;npinfo.

3. Rename arp_reply() to netpoll_arp_reply(), the former is too generic.

Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@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>
This patch fixes several problems in the call path of
netpoll_send_skb_on_dev():

1. Disable IRQ's before calling netpoll_send_skb_on_dev().

2. All the callees of netpoll_send_skb_on_dev() should use
   rcu_dereference_bh() to dereference -&gt;npinfo.

3. Rename arp_reply() to netpoll_arp_reply(), the former is too generic.

Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: take rcu_read_lock_bh() in netpoll_rx()</title>
<updated>2012-08-14T21:33:31+00:00</updated>
<author>
<name>Amerigo Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2012-08-10T01:24:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=57c5d46191e75312934c00eba65b13a31ca95120'/>
<id>57c5d46191e75312934c00eba65b13a31ca95120</id>
<content type='text'>
In __netpoll_rx(), it dereferences -&gt;npinfo without rcu_dereference_bh(),
this patch fixes it by using the 'npinfo' passed from netpoll_rx()
where it is already dereferenced with rcu_dereference_bh().

Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@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 __netpoll_rx(), it dereferences -&gt;npinfo without rcu_dereference_bh(),
this patch fixes it by using the 'npinfo' passed from netpoll_rx()
where it is already dereferenced with rcu_dereference_bh().

Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: make __netpoll_cleanup non-block</title>
<updated>2012-08-14T21:33:30+00:00</updated>
<author>
<name>Amerigo Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2012-08-10T01:24:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=38e6bc185d9544dfad1774b3f8902a0b061aea25'/>
<id>38e6bc185d9544dfad1774b3f8902a0b061aea25</id>
<content type='text'>
Like the previous patch, slave_disable_netpoll() and __netpoll_cleanup()
may be called with read_lock() held too, so we should make them
non-block, by moving the cleanup and kfree() to call_rcu_bh() callbacks.

Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@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>
Like the previous patch, slave_disable_netpoll() and __netpoll_cleanup()
may be called with read_lock() held too, so we should make them
non-block, by moving the cleanup and kfree() to call_rcu_bh() callbacks.

Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: use GFP_ATOMIC in slave_enable_netpoll() and __netpoll_setup()</title>
<updated>2012-08-14T21:33:30+00:00</updated>
<author>
<name>Amerigo Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2012-08-10T01:24:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=47be03a28cc6c80e3aa2b3e8ed6d960ff0c5c0af'/>
<id>47be03a28cc6c80e3aa2b3e8ed6d960ff0c5c0af</id>
<content type='text'>
slave_enable_netpoll() and __netpoll_setup() may be called
with read_lock() held, so should use GFP_ATOMIC to allocate
memory. Eric suggested to pass gfp flags to __netpoll_setup().

Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Cong Wang &lt;amwang@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>
slave_enable_netpoll() and __netpoll_setup() may be called
with read_lock() held, so should use GFP_ATOMIC to allocate
memory. Eric suggested to pass gfp flags to __netpoll_setup().

Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: move np-&gt;dev and np-&gt;dev_name init into __netpoll_setup()</title>
<updated>2012-07-17T16:02:36+00:00</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@resnulli.us</email>
</author>
<published>2012-07-17T05:22:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=30fdd8a082a00126a6feec994e43e8dc12f5bccb'/>
<id>30fdd8a082a00126a6feec994e43e8dc12f5bccb</id>
<content type='text'>
Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&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>
Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: fix netpoll_send_udp() bugs</title>
<updated>2012-06-13T22:57:31+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-06-12T19:30:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=954fba0274058d27c7c07b5ea07c41b3b7477894'/>
<id>954fba0274058d27c7c07b5ea07c41b3b7477894</id>
<content type='text'>
Bogdan Hamciuc diagnosed and fixed following bug in netpoll_send_udp() :

"skb-&gt;len += len;" instead of "skb_put(skb, len);"

Meaning that _if_ a network driver needs to call skb_realloc_headroom(),
only packet headers would be copied, leaving garbage in the payload.

However the skb_realloc_headroom() must be avoided as much as possible
since it requires memory and netpoll tries hard to work even if memory
is exhausted (using a pool of preallocated skbs)

It appears netpoll_send_udp() reserved 16 bytes for the ethernet header,
which happens to work for typicall drivers but not all.

Right thing is to use LL_RESERVED_SPACE(dev)
(And also add dev-&gt;needed_tailroom of tailroom)

This patch combines both fixes.

Many thanks to Bogdan for raising this issue.

Reported-by: Bogdan Hamciuc &lt;bogdan.hamciuc@freescale.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Tested-by: Bogdan Hamciuc &lt;bogdan.hamciuc@freescale.com&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Reviewed-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Reviewed-by: Cong Wang &lt;xiyou.wangcong@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>
Bogdan Hamciuc diagnosed and fixed following bug in netpoll_send_udp() :

"skb-&gt;len += len;" instead of "skb_put(skb, len);"

Meaning that _if_ a network driver needs to call skb_realloc_headroom(),
only packet headers would be copied, leaving garbage in the payload.

However the skb_realloc_headroom() must be avoided as much as possible
since it requires memory and netpoll tries hard to work even if memory
is exhausted (using a pool of preallocated skbs)

It appears netpoll_send_udp() reserved 16 bytes for the ethernet header,
which happens to work for typicall drivers but not all.

Right thing is to use LL_RESERVED_SPACE(dev)
(And also add dev-&gt;needed_tailroom of tailroom)

This patch combines both fixes.

Many thanks to Bogdan for raising this issue.

Reported-by: Bogdan Hamciuc &lt;bogdan.hamciuc@freescale.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Tested-by: Bogdan Hamciuc &lt;bogdan.hamciuc@freescale.com&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Reviewed-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Reviewed-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2012-02-19T21:03:15+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-02-19T21:03:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=32efe08d77f5902ce7315fc9003c010ffffb8268'/>
<id>32efe08d77f5902ce7315fc9003c010ffffb8268</id>
<content type='text'>
Conflicts:
	drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c

Small minor conflict in bnx2x, wherein one commit changed how
statistics were stored in software, and another commit
fixed endianness bugs wrt. reading the values provided by
the chip in memory.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c

Small minor conflict in bnx2x, wherein one commit changed how
statistics were stored in software, and another commit
fixed endianness bugs wrt. reading the values provided by
the chip in memory.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
