<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/macvtap.c, branch v3.2.40</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/net/macvtap.c?h=v3.2.40</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/net/macvtap.c?h=v3.2.40'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-07-25T03:11:04Z</updated>
<entry>
<title>macvtap: zerocopy: validate vectors before building skb</title>
<updated>2012-07-25T03:11:04Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2012-05-02T03:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1be535a022a9c0b9a55cab2993ee29e05c4ead0b'/>
<id>urn:sha1:1be535a022a9c0b9a55cab2993ee29e05c4ead0b</id>
<content type='text'>
commit b92946e2919134ebe2a4083e4302236295ea2a73 upstream.

There're several reasons that the vectors need to be validated:

- Return error when caller provides vectors whose num is greater than UIO_MAXIOV.
- Linearize part of skb when userspace provides vectors grater than MAX_SKB_FRAGS.
- Return error when userspace provides vectors whose total length may exceed
- MAX_SKB_FRAGS * PAGE_SIZE.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>macvtap: zerocopy: set SKBTX_DEV_ZEROCOPY only when skb is built successfully</title>
<updated>2012-07-25T03:11:04Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2012-05-02T03:42:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cc64214d05941d09bb9f80051a1949a7223b8ab7'/>
<id>urn:sha1:cc64214d05941d09bb9f80051a1949a7223b8ab7</id>
<content type='text'>
commit 01d6657b388438def19c8baaea28e742b6ed32ec upstream.

Current the SKBTX_DEV_ZEROCOPY is set unconditionally after
zerocopy_sg_from_iovec(), this would lead NULL pointer when macvtap
fails to build zerocopy skb because destructor_arg was not
initialized. Solve this by set this flag after the skb were built
successfully.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>macvtap: zerocopy: put page when fail to get all requested user pages</title>
<updated>2012-07-25T03:11:03Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2012-05-02T03:41:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e9214638ead441c15b48f40c3b459aede77c2662'/>
<id>urn:sha1:e9214638ead441c15b48f40c3b459aede77c2662</id>
<content type='text'>
commit 02ce04bb3d28c3333231f43bca677228dbc686fe upstream.

When get_user_pages_fast() fails to get all requested pages, we could not use
kfree_skb() to free it as it has not been put in the skb fragments. So we need
to call put_page() instead.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>macvtap: zerocopy: fix truesize underestimation</title>
<updated>2012-07-25T03:11:03Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2012-05-02T03:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=14180f501e674f1bbe352d37c962ede4d8f679d4'/>
<id>urn:sha1:14180f501e674f1bbe352d37c962ede4d8f679d4</id>
<content type='text'>
commit 4ef67ebedffa44ed9939b34708ac2fee06d2f65f upstream.

As the skb fragment were pinned/built from user pages, we should
account the page instead of length for truesize.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>macvtap: zerocopy: fix offset calculation when building skb</title>
<updated>2012-07-25T03:11:02Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2012-05-02T03:41:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c1b5b21b540f22a8e008d30545c044a6c949b47b'/>
<id>urn:sha1:c1b5b21b540f22a8e008d30545c044a6c949b47b</id>
<content type='text'>
commit 3afc9621f15701c557e60f61eba9242bac2771dd upstream.

This patch fixes the offset calculation when building skb:

- offset1 were used as skb data offset not vector offset
- reset offset to zero only when we advance to next vector

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>macvtap: Fix the minor device number allocation</title>
<updated>2011-10-21T06:53:07Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2011-10-20T04:29:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e09eff7fc1c6f011f7bdb304e10d2ceef08c88ab'/>
<id>urn:sha1:e09eff7fc1c6f011f7bdb304e10d2ceef08c88ab</id>
<content type='text'>
On systems that create and delete lots of dynamic devices the
31bit linux ifindex fails to fit in the 16bit macvtap minor,
resulting in unusable macvtap devices.  I have systems running
automated tests that that hit this condition in just a few days.

Use a linux idr allocator to track which mavtap minor numbers
are available and and to track the association between macvtap
minor numbers and macvtap network devices.

Remove the unnecessary unneccessary check to see if the network
device we have found is indeed a macvtap device.  With macvtap
specific data structures it is impossible to find any other
kind of networking device.

Increase the macvtap minor range from 65536 to the full 20 bits
that is supported by linux device numbers.  It doesn't solve the
original problem but there is no penalty for a larger minor
device range.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>macvtap: Rewrite macvtap_newlink so the error handling works.</title>
<updated>2011-10-21T06:53:07Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2011-10-20T04:28:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9bf1907f4293d61d5a283d18c4ad28d048261797'/>
<id>urn:sha1:9bf1907f4293d61d5a283d18c4ad28d048261797</id>
<content type='text'>
Place macvlan_common_newlink at the end of macvtap_newlink because
failing in newlink after registering your network device is not
supported.

Move device_create into a netdevice creation notifier.   The network device
notifier is the only hook that is called after the network device has been
registered with the device layer and before register_network_device returns
success.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>macvtap: Don't leak unreceived packets when we delete a macvtap device.</title>
<updated>2011-10-21T06:53:07Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2011-10-20T04:27:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2259fef0bb80a8fc842b5690b89a640464df2859'/>
<id>urn:sha1:2259fef0bb80a8fc842b5690b89a640464df2859</id>
<content type='text'>
To avoid leaking packets in the receive queue.  Add a socket destructor
that will run whenever destroy a macvtap socket.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>macvtap: Fix macvtap_open races in the zero copy enable code.</title>
<updated>2011-10-21T06:53:07Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2011-10-20T04:26:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=047af9cfedfa357e1497e327eaa893253ca51971'/>
<id>urn:sha1:047af9cfedfa357e1497e327eaa893253ca51971</id>
<content type='text'>
To see if it is appropriate to enable the macvtap zero copy feature
don't test the lowerdev network device flags.   Instead test the
macvtap network device flags which are a direct copy of the lowerdev
flags.  This is important because nothing holds a reference to lowerdev
and on a very bad day we lowerdev could be a pointer to stale memory.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>macvtap: Close a race between macvtap_open and macvtap_dellink.</title>
<updated>2011-10-21T06:53:06Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2011-10-20T04:26:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=99f34b38cdc8f75a4b9adb5a617b118253b3efe1'/>
<id>urn:sha1:99f34b38cdc8f75a4b9adb5a617b118253b3efe1</id>
<content type='text'>
There is a small window in macvtap_open between looking up a
networking device and calling macvtap_set_queue in which
macvtap_del_queues called from macvtap_dellink.   After
calling macvtap_del_queues it is totally incorrect to
allow macvtap_set_queue to proceed so prevent success by
reporting that all of the available queues are in use.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
