<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/net/macvtap.c, branch v3.12</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2013-08-26T20:37:08+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2013-08-26T20:37:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b05930f5d1c7d5873cb050261d21789a99de9d48'/>
<id>b05930f5d1c7d5873cb050261d21789a99de9d48</id>
<content type='text'>
Conflicts:
	drivers/net/wireless/iwlwifi/pcie/trans.c
	include/linux/inetdevice.h

The inetdevice.h conflict involves moving the IPV4_DEVCONF values
into a UAPI header, overlapping additions of some new entries.

The iwlwifi conflict is a context overlap.

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/wireless/iwlwifi/pcie/trans.c
	include/linux/inetdevice.h

The inetdevice.h conflict involves moving the IPV4_DEVCONF values
into a UAPI header, overlapping additions of some new entries.

The iwlwifi conflict is a context overlap.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>macvtap: Ignore tap features when VNET_HDR is off</title>
<updated>2013-08-20T20:09:12+00:00</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2013-08-16T19:25:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e5733321d5a94cc9a202ea85c4aabe09571217e6'/>
<id>e5733321d5a94cc9a202ea85c4aabe09571217e6</id>
<content type='text'>
When the user turns off VNET_HDR support on the
macvtap device, there is no way to provide any
offload information to the user.  So, it's safer
to ignore offload setting then depend on the user
setting them correctly.

Signed-off-by: Vlad Yasevich &lt;vyasevic@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>
When the user turns off VNET_HDR support on the
macvtap device, there is no way to provide any
offload information to the user.  So, it's safer
to ignore offload setting then depend on the user
setting them correctly.

Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>macvtap: Correctly set tap features when IFF_VNET_HDR is disabled.</title>
<updated>2013-08-20T20:09:11+00:00</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2013-08-16T19:25:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e558b0188bb7e35ffc4d35253c6b9ea491f3b996'/>
<id>e558b0188bb7e35ffc4d35253c6b9ea491f3b996</id>
<content type='text'>
When the user turns off IFF_VNET_HDR flag, attempts to change
offload features via TUNSETOFFLOAD do not work.  This could cause
GSO packets to be delivered to the user when the user is
not prepared to handle them.

To solve, allow processing of TUNSETOFFLOAD when IFF_VNET_HDR is
disabled.

Signed-off-by: Vlad Yasevich &lt;vyasevic@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>
When the user turns off IFF_VNET_HDR flag, attempts to change
offload features via TUNSETOFFLOAD do not work.  This could cause
GSO packets to be delivered to the user when the user is
not prepared to handle them.

To solve, allow processing of TUNSETOFFLOAD when IFF_VNET_HDR is
disabled.

Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>macvtap: simplify usage of tap_features</title>
<updated>2013-08-20T20:09:11+00:00</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2013-08-16T19:25:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a567dd6252263c8147b7269df5d03d9e31463e11'/>
<id>a567dd6252263c8147b7269df5d03d9e31463e11</id>
<content type='text'>
In macvtap, tap_features specific the features of that the user
has specified via ioctl().  If we treat macvtap as a macvlan+tap
then we could all the tap a pseudo-device and give it other features
like SG and GSO.  Then we can stop using the features of lower
device (macvlan) when forwarding the traffic the tap.

This solves the issue of possible checksum offload mismatch between
tap feature and macvlan features.

Signed-off-by: Vlad Yasevich &lt;vyasevic@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 macvtap, tap_features specific the features of that the user
has specified via ioctl().  If we treat macvtap as a macvlan+tap
then we could all the tap a pseudo-device and give it other features
like SG and GSO.  Then we can stop using the features of lower
device (macvlan) when forwarding the traffic the tap.

This solves the issue of possible checksum offload mismatch between
tap feature and macvlan features.

Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.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>2013-08-16T22:37:26+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2013-08-16T22:37:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2ff1cf12c9fe70e75e600404e6a4274b19d293ed'/>
<id>2ff1cf12c9fe70e75e600404e6a4274b19d293ed</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>macvtap: fix two races</title>
<updated>2013-08-12T04:48:58+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-08-08T15:06:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=29d7919692e591c2f0e1f743a7f6c613c1266ece'/>
<id>29d7919692e591c2f0e1f743a7f6c613c1266ece</id>
<content type='text'>
Since commit ac4e4af1e59e1 ("macvtap: Consistently use rcu functions"),
Thomas gets two different warnings :

BUG: using smp_processor_id() in preemptible [00000000] code: vhost-45891/45892
caller is macvtap_do_read+0x45c/0x600 [macvtap]
CPU: 1 PID: 45892 Comm: vhost-45891 Not tainted 3.11.0-bisecttest #13
Call Trace:
([&lt;00000000001126ee&gt;] show_trace+0x126/0x144)
 [&lt;00000000001127d2&gt;] show_stack+0xc6/0xd4
 [&lt;000000000068bcec&gt;] dump_stack+0x74/0xd8
 [&lt;0000000000481066&gt;] debug_smp_processor_id+0xf6/0x114
 [&lt;000003ff802e9a18&gt;] macvtap_do_read+0x45c/0x600 [macvtap]
 [&lt;000003ff802e9c1c&gt;] macvtap_recvmsg+0x60/0x88 [macvtap]
 [&lt;000003ff80318c5e&gt;] handle_rx+0x5b2/0x800 [vhost_net]
 [&lt;000003ff8028f77c&gt;] vhost_worker+0x15c/0x1c4 [vhost]
 [&lt;000000000015f3ac&gt;] kthread+0xd8/0xe4
 [&lt;00000000006934a6&gt;] kernel_thread_starter+0x6/0xc
 [&lt;00000000006934a0&gt;] kernel_thread_starter+0x0/0xc

And

BUG: using smp_processor_id() in preemptible [00000000] code: vhost-45897/45898
caller is macvlan_start_xmit+0x10a/0x1b4 [macvlan]
CPU: 1 PID: 45898 Comm: vhost-45897 Not tainted 3.11.0-bisecttest #16
Call Trace:
([&lt;00000000001126ee&gt;] show_trace+0x126/0x144)
 [&lt;00000000001127d2&gt;] show_stack+0xc6/0xd4
 [&lt;000000000068bdb8&gt;] dump_stack+0x74/0xd4
 [&lt;0000000000481132&gt;] debug_smp_processor_id+0xf6/0x114
 [&lt;000003ff802b72ca&gt;] macvlan_start_xmit+0x10a/0x1b4 [macvlan]
 [&lt;000003ff802ea69a&gt;] macvtap_get_user+0x982/0xbc4 [macvtap]
 [&lt;000003ff802ea92a&gt;] macvtap_sendmsg+0x4e/0x60 [macvtap]
 [&lt;000003ff8031947c&gt;] handle_tx+0x494/0x5ec [vhost_net]
 [&lt;000003ff8028f77c&gt;] vhost_worker+0x15c/0x1c4 [vhost]
 [&lt;000000000015f3ac&gt;] kthread+0xd8/0xe4
 [&lt;000000000069356e&gt;] kernel_thread_starter+0x6/0xc
 [&lt;0000000000693568&gt;] kernel_thread_starter+0x0/0xc
2 locks held by vhost-45897/45898:
 #0:  (&amp;vq-&gt;mutex){+.+.+.}, at: [&lt;000003ff8031903c&gt;] handle_tx+0x54/0x5ec [vhost_net]
 #1:  (rcu_read_lock){.+.+..}, at: [&lt;000003ff802ea53c&gt;] macvtap_get_user+0x824/0xbc4 [macvtap]

In the first case, macvtap_put_user() calls macvlan_count_rx()
in a preempt-able context, and this is not allowed.

In the second case, macvtap_get_user() calls
macvlan_start_xmit() with BH enabled, and this is not allowed.

Reported-by: Thomas Huth &lt;thuth@linux.vnet.ibm.com&gt;
Bisected-by: Thomas Huth &lt;thuth@linux.vnet.ibm.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Tested-by: Thomas Huth &lt;thuth@linux.vnet.ibm.com&gt;
Cc: Vlad Yasevich &lt;vyasevic@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>
Since commit ac4e4af1e59e1 ("macvtap: Consistently use rcu functions"),
Thomas gets two different warnings :

BUG: using smp_processor_id() in preemptible [00000000] code: vhost-45891/45892
caller is macvtap_do_read+0x45c/0x600 [macvtap]
CPU: 1 PID: 45892 Comm: vhost-45891 Not tainted 3.11.0-bisecttest #13
Call Trace:
([&lt;00000000001126ee&gt;] show_trace+0x126/0x144)
 [&lt;00000000001127d2&gt;] show_stack+0xc6/0xd4
 [&lt;000000000068bcec&gt;] dump_stack+0x74/0xd8
 [&lt;0000000000481066&gt;] debug_smp_processor_id+0xf6/0x114
 [&lt;000003ff802e9a18&gt;] macvtap_do_read+0x45c/0x600 [macvtap]
 [&lt;000003ff802e9c1c&gt;] macvtap_recvmsg+0x60/0x88 [macvtap]
 [&lt;000003ff80318c5e&gt;] handle_rx+0x5b2/0x800 [vhost_net]
 [&lt;000003ff8028f77c&gt;] vhost_worker+0x15c/0x1c4 [vhost]
 [&lt;000000000015f3ac&gt;] kthread+0xd8/0xe4
 [&lt;00000000006934a6&gt;] kernel_thread_starter+0x6/0xc
 [&lt;00000000006934a0&gt;] kernel_thread_starter+0x0/0xc

And

BUG: using smp_processor_id() in preemptible [00000000] code: vhost-45897/45898
caller is macvlan_start_xmit+0x10a/0x1b4 [macvlan]
CPU: 1 PID: 45898 Comm: vhost-45897 Not tainted 3.11.0-bisecttest #16
Call Trace:
([&lt;00000000001126ee&gt;] show_trace+0x126/0x144)
 [&lt;00000000001127d2&gt;] show_stack+0xc6/0xd4
 [&lt;000000000068bdb8&gt;] dump_stack+0x74/0xd4
 [&lt;0000000000481132&gt;] debug_smp_processor_id+0xf6/0x114
 [&lt;000003ff802b72ca&gt;] macvlan_start_xmit+0x10a/0x1b4 [macvlan]
 [&lt;000003ff802ea69a&gt;] macvtap_get_user+0x982/0xbc4 [macvtap]
 [&lt;000003ff802ea92a&gt;] macvtap_sendmsg+0x4e/0x60 [macvtap]
 [&lt;000003ff8031947c&gt;] handle_tx+0x494/0x5ec [vhost_net]
 [&lt;000003ff8028f77c&gt;] vhost_worker+0x15c/0x1c4 [vhost]
 [&lt;000000000015f3ac&gt;] kthread+0xd8/0xe4
 [&lt;000000000069356e&gt;] kernel_thread_starter+0x6/0xc
 [&lt;0000000000693568&gt;] kernel_thread_starter+0x0/0xc
2 locks held by vhost-45897/45898:
 #0:  (&amp;vq-&gt;mutex){+.+.+.}, at: [&lt;000003ff8031903c&gt;] handle_tx+0x54/0x5ec [vhost_net]
 #1:  (rcu_read_lock){.+.+..}, at: [&lt;000003ff802ea53c&gt;] macvtap_get_user+0x824/0xbc4 [macvtap]

In the first case, macvtap_put_user() calls macvlan_count_rx()
in a preempt-able context, and this is not allowed.

In the second case, macvtap_get_user() calls
macvlan_start_xmit() with BH enabled, and this is not allowed.

Reported-by: Thomas Huth &lt;thuth@linux.vnet.ibm.com&gt;
Bisected-by: Thomas Huth &lt;thuth@linux.vnet.ibm.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Tested-by: Thomas Huth &lt;thuth@linux.vnet.ibm.com&gt;
Cc: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: attempt high order allocations in sock_alloc_send_pskb()</title>
<updated>2013-08-10T08:16:44+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-08-08T21:38:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=28d6427109d13b0f447cba5761f88d3548e83605'/>
<id>28d6427109d13b0f447cba5761f88d3548e83605</id>
<content type='text'>
Adding paged frags skbs to af_unix sockets introduced a performance
regression on large sends because of additional page allocations, even
if each skb could carry at least 100% more payload than before.

We can instruct sock_alloc_send_pskb() to attempt high order
allocations.

Most of the time, it does a single page allocation instead of 8.

I added an additional parameter to sock_alloc_send_pskb() to
let other users to opt-in for this new feature on followup patches.

Tested:

Before patch :

$ netperf -t STREAM_STREAM
STREAM STREAM TEST
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 2304  212992  212992    10.00    46861.15

After patch :

$ netperf -t STREAM_STREAM
STREAM STREAM TEST
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 2304  212992  212992    10.00    57981.11

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: David Rientjes &lt;rientjes@google.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>
Adding paged frags skbs to af_unix sockets introduced a performance
regression on large sends because of additional page allocations, even
if each skb could carry at least 100% more payload than before.

We can instruct sock_alloc_send_pskb() to attempt high order
allocations.

Most of the time, it does a single page allocation instead of 8.

I added an additional parameter to sock_alloc_send_pskb() to
let other users to opt-in for this new feature on followup patches.

Tested:

Before patch :

$ netperf -t STREAM_STREAM
STREAM STREAM TEST
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 2304  212992  212992    10.00    46861.15

After patch :

$ netperf -t STREAM_STREAM
STREAM STREAM TEST
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 2304  212992  212992    10.00    57981.11

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: move zerocopy_sg_from_iovec() to net/core/datagram.c</title>
<updated>2013-08-07T23:52:34+00:00</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2013-08-06T09:45:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c3bdeb5c7cc073ccf5ff9624642022a8613a956e'/>
<id>c3bdeb5c7cc073ccf5ff9624642022a8613a956e</id>
<content type='text'>
To let it be reused and reduce code duplication. Also document this function.

Signed-off-by: Jason Wang &lt;jasowang@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>
To let it be reused and reduce code duplication. Also document this function.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: move iov_pages() to net/core/iovec.c</title>
<updated>2013-08-07T23:52:33+00:00</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2013-08-06T09:45:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b4bf07771faaf959b0a916d35b1b930c030e30a8'/>
<id>b4bf07771faaf959b0a916d35b1b930c030e30a8</id>
<content type='text'>
To let it be reused and reduce code duplication.

Signed-off-by: Jason Wang &lt;jasowang@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>
To let it be reused and reduce code duplication.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>macvtap: do not zerocopy if iov needs more pages than MAX_SKB_FRAGS</title>
<updated>2013-07-18T20:04:25+00:00</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2013-07-18T02:55:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ece793fcfc417b3925844be88a6a6dc82ae8f7c6'/>
<id>ece793fcfc417b3925844be88a6a6dc82ae8f7c6</id>
<content type='text'>
We try to linearize part of the skb when the number of iov is greater than
MAX_SKB_FRAGS. This is not enough since each single vector may occupy more than
one pages, so zerocopy_sg_fromiovec() may still fail and may break the guest
network.

Solve this problem by calculate the pages needed for iov before trying to do
zerocopy and switch to use copy instead of zerocopy if it needs more than
MAX_SKB_FRAGS.

This is done through introducing a new helper to count the pages for iov, and
call uarg-&gt;callback() manually when switching from zerocopy to copy to notify
vhost.

We can do further optimization on top.

This bug were introduced from b92946e2919134ebe2a4083e4302236295ea2a73
(macvtap: zerocopy: validate vectors before building skb).

Cc: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jason Wang &lt;jasowang@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>
We try to linearize part of the skb when the number of iov is greater than
MAX_SKB_FRAGS. This is not enough since each single vector may occupy more than
one pages, so zerocopy_sg_fromiovec() may still fail and may break the guest
network.

Solve this problem by calculate the pages needed for iov before trying to do
zerocopy and switch to use copy instead of zerocopy if it needs more than
MAX_SKB_FRAGS.

This is done through introducing a new helper to count the pages for iov, and
call uarg-&gt;callback() manually when switching from zerocopy to copy to notify
vhost.

We can do further optimization on top.

This bug were introduced from b92946e2919134ebe2a4083e4302236295ea2a73
(macvtap: zerocopy: validate vectors before building skb).

Cc: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
