<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/9p, branch v3.16-rc7</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge tag 'for-linus-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs</title>
<updated>2014-04-11T21:14:57+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-04-11T21:14:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=582076ab16779208e7eb6ce712a9c0a6cc5bafe4'/>
<id>582076ab16779208e7eb6ce712a9c0a6cc5bafe4</id>
<content type='text'>
Pull 9p changes from Eric Van Hensbergen:
 "A bunch of updates and cleanup within the transport layer,
  particularly with a focus on RDMA"

* tag 'for-linus-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  9pnet_rdma: check token type before int conversion
  9pnet: trans_fd : allocate struct p9_trans_fd and struct p9_conn together.
  9pnet: p9_client-&gt;conn field is unused. Remove it.
  9P: Get rid of REQ_STATUS_FLSH
  9pnet_rdma: add cancelled()
  9pnet_rdma: update request status during send
  9P: Add cancelled() to the transport functions.
  net: Mark function as static in 9p/client.c
  9P: Add memory barriers to protect request fields over cb/rpc threads handoff
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull 9p changes from Eric Van Hensbergen:
 "A bunch of updates and cleanup within the transport layer,
  particularly with a focus on RDMA"

* tag 'for-linus-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  9pnet_rdma: check token type before int conversion
  9pnet: trans_fd : allocate struct p9_trans_fd and struct p9_conn together.
  9pnet: p9_client-&gt;conn field is unused. Remove it.
  9P: Get rid of REQ_STATUS_FLSH
  9pnet_rdma: add cancelled()
  9pnet_rdma: update request status during send
  9P: Add cancelled() to the transport functions.
  net: Mark function as static in 9p/client.c
  9P: Add memory barriers to protect request fields over cb/rpc threads handoff
</pre>
</div>
</content>
</entry>
<entry>
<title>9pnet_rdma: check token type before int conversion</title>
<updated>2014-03-25T21:38:19+00:00</updated>
<author>
<name>Simon Derr</name>
<email>simon.derr@bull.net</email>
</author>
<published>2014-03-11T09:14:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8a5daf1e2c199746767d94b4036638ba11d528b3'/>
<id>8a5daf1e2c199746767d94b4036638ba11d528b3</id>
<content type='text'>
When parsing options, make sure we have found a proper token before
doing a numeric conversion.

Without this check, the current code will end up following random
pointers that just happened to be on the stack when this function was
called, because match_token() will not touch the 'args' list unless a
valid token is found.

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When parsing options, make sure we have found a proper token before
doing a numeric conversion.

Without this check, the current code will end up following random
pointers that just happened to be on the stack when this function was
called, because match_token() will not touch the 'args' list unless a
valid token is found.

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>9pnet: trans_fd : allocate struct p9_trans_fd and struct p9_conn together.</title>
<updated>2014-03-25T21:38:17+00:00</updated>
<author>
<name>Simon Derr</name>
<email>simon.derr@bull.net</email>
</author>
<published>2014-03-11T09:13:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=263c582888d3cd2a5c8e32225140723ec31f1709'/>
<id>263c582888d3cd2a5c8e32225140723ec31f1709</id>
<content type='text'>
There is no point in allocating these structs separately.
Changing this makes the code a little simpler and saves a few bytes of
memory.

Reported-by: Herve Vico
Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no point in allocating these structs separately.
Changing this makes the code a little simpler and saves a few bytes of
memory.

Reported-by: Herve Vico
Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>9P: Get rid of REQ_STATUS_FLSH</title>
<updated>2014-03-25T21:38:15+00:00</updated>
<author>
<name>Simon Derr</name>
<email>simon.derr@bull.net</email>
</author>
<published>2014-03-10T15:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0bfd6845c0b5e3df3507d2b4d230478980e7f04a'/>
<id>0bfd6845c0b5e3df3507d2b4d230478980e7f04a</id>
<content type='text'>
This request state is mostly useless, and properly implementing it
for RDMA would require an extra lock to be taken in handle_recv()
and in rdma_cancel() to avoid this race:

    handle_recv()           rdma_cancel()
        .                     .
        .                   if req-&gt;state == SENT
    req-&gt;state = RCVD         .
        .                           req-&gt;state = FLSH

So just get rid of it.

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This request state is mostly useless, and properly implementing it
for RDMA would require an extra lock to be taken in handle_recv()
and in rdma_cancel() to avoid this race:

    handle_recv()           rdma_cancel()
        .                     .
        .                   if req-&gt;state == SENT
    req-&gt;state = RCVD         .
        .                           req-&gt;state = FLSH

So just get rid of it.

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>9pnet_rdma: add cancelled()</title>
<updated>2014-03-25T21:38:13+00:00</updated>
<author>
<name>Simon Derr</name>
<email>simon.derr@bull.net</email>
</author>
<published>2014-03-10T15:38:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=931700d26bf17c583805f52121a41231e64868f3'/>
<id>931700d26bf17c583805f52121a41231e64868f3</id>
<content type='text'>
Take into account posted recv buffers that will never receive their
reply.

The RDMA code posts a recv buffer for each request that it sends.
When a request is flushed, it is possible that this request will
never receive a reply, and that one recv buffer will stay unused on
the recv queue.

It is then possible, if this scenario happens several times, to have the
recv queue full, and have the 9pnet_rmda module unable to send new requests.

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Take into account posted recv buffers that will never receive their
reply.

The RDMA code posts a recv buffer for each request that it sends.
When a request is flushed, it is possible that this request will
never receive a reply, and that one recv buffer will stay unused on
the recv queue.

It is then possible, if this scenario happens several times, to have the
recv queue full, and have the 9pnet_rmda module unable to send new requests.

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>9pnet_rdma: update request status during send</title>
<updated>2014-03-25T21:38:12+00:00</updated>
<author>
<name>Simon Derr</name>
<email>simon.derr@bull.net</email>
</author>
<published>2014-03-10T15:38:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3f9d5b8dfdc7b013287caaa847b378912b013f77'/>
<id>3f9d5b8dfdc7b013287caaa847b378912b013f77</id>
<content type='text'>
This will be needed by the flush logic.

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will be needed by the flush logic.

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>9P: Add cancelled() to the transport functions.</title>
<updated>2014-03-25T21:38:11+00:00</updated>
<author>
<name>Simon Derr</name>
<email>simon.derr@bull.net</email>
</author>
<published>2014-03-10T15:38:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=afd8d65411551839b7ab14a539d00075b2793451'/>
<id>afd8d65411551839b7ab14a539d00075b2793451</id>
<content type='text'>
And move transport-specific code out of net/9p/client.c

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
And move transport-specific code out of net/9p/client.c

Signed-off-by: Simon Derr &lt;simon.derr@bull.net&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Mark function as static in 9p/client.c</title>
<updated>2014-03-25T21:38:09+00:00</updated>
<author>
<name>Rashika</name>
<email>rashika.kheria@gmail.com</email>
</author>
<published>2014-02-09T14:27:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=05a782d416944593ca0268d5718fe4b9cba5ef67'/>
<id>05a782d416944593ca0268d5718fe4b9cba5ef67</id>
<content type='text'>
Mark function as static in net/9p/client.c because it is not used
outside this file.

This eliminates the following warning in net/9p/client.c:
net/9p/client.c:207:18: warning: no previous prototype for ‘p9_fcall_alloc’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria &lt;rashika.kheria@gmail.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mark function as static in net/9p/client.c because it is not used
outside this file.

This eliminates the following warning in net/9p/client.c:
net/9p/client.c:207:18: warning: no previous prototype for ‘p9_fcall_alloc’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria &lt;rashika.kheria@gmail.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>9P: Add memory barriers to protect request fields over cb/rpc threads handoff</title>
<updated>2014-03-25T21:37:59+00:00</updated>
<author>
<name>Dominique Martinet</name>
<email>dominique.martinet@cea.fr</email>
</author>
<published>2014-01-17T17:31:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2b6e72ed747f68a038df616efd86744b3644d694'/>
<id>2b6e72ed747f68a038df616efd86744b3644d694</id>
<content type='text'>
We need barriers to guarantee this pattern works as intended:
[w] req-&gt;rc, 1		[r] req-&gt;status, 1
wmb			rmb
[w] req-&gt;status, 1	[r] req-&gt;rc

Where the wmb ensures that rc gets written before status,
and the rmb ensures that if you observe status == 1, rc is the new value.

Signed-off-by: Dominique Martinet &lt;dominique.martinet@cea.fr&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need barriers to guarantee this pattern works as intended:
[w] req-&gt;rc, 1		[r] req-&gt;status, 1
wmb			rmb
[w] req-&gt;status, 1	[r] req-&gt;rc

Where the wmb ensures that rc gets written before status,
and the rmb ensures that if you observe status == 1, rc is the new value.

Signed-off-by: Dominique Martinet &lt;dominique.martinet@cea.fr&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>9p/trans_virtio.c: Fix broken zero-copy on vmalloc() buffers</title>
<updated>2014-02-11T01:48:54+00:00</updated>
<author>
<name>Richard Yao</name>
<email>ryao@gentoo.org</email>
</author>
<published>2014-02-09T00:32:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b6f52ae2f0d32387bde2b89883e3b64d88b9bfe8'/>
<id>b6f52ae2f0d32387bde2b89883e3b64d88b9bfe8</id>
<content type='text'>
The 9p-virtio transport does zero copy on things larger than 1024 bytes
in size. It accomplishes this by returning the physical addresses of
pages to the virtio-pci device. At present, the translation is usually a
bit shift.

That approach produces an invalid page address when we read/write to
vmalloc buffers, such as those used for Linux kernel modules. Any
attempt to load a Linux kernel module from 9p-virtio produces the
following stack.

[&lt;ffffffff814878ce&gt;] p9_virtio_zc_request+0x45e/0x510
[&lt;ffffffff814814ed&gt;] p9_client_zc_rpc.constprop.16+0xfd/0x4f0
[&lt;ffffffff814839dd&gt;] p9_client_read+0x15d/0x240
[&lt;ffffffff811c8440&gt;] v9fs_fid_readn+0x50/0xa0
[&lt;ffffffff811c84a0&gt;] v9fs_file_readn+0x10/0x20
[&lt;ffffffff811c84e7&gt;] v9fs_file_read+0x37/0x70
[&lt;ffffffff8114e3fb&gt;] vfs_read+0x9b/0x160
[&lt;ffffffff81153571&gt;] kernel_read+0x41/0x60
[&lt;ffffffff810c83ab&gt;] copy_module_from_fd.isra.34+0xfb/0x180

Subsequently, QEMU will die printing:

qemu-system-x86_64: virtio: trying to map MMIO memory

This patch enables 9p-virtio to correctly handle this case. This not
only enables us to load Linux kernel modules off virtfs, but also
enables ZFS file-based vdevs on virtfs to be used without killing QEMU.

Special thanks to both Avi Kivity and Alexander Graf for their
interpretation of QEMU backtraces. Without their guidence, tracking down
this bug would have taken much longer. Also, special thanks to Linus
Torvalds for his insightful explanation of why this should use
is_vmalloc_addr() instead of is_vmalloc_or_module_addr():

https://lkml.org/lkml/2014/2/8/272

Signed-off-by: Richard Yao &lt;ryao@gentoo.org&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>
The 9p-virtio transport does zero copy on things larger than 1024 bytes
in size. It accomplishes this by returning the physical addresses of
pages to the virtio-pci device. At present, the translation is usually a
bit shift.

That approach produces an invalid page address when we read/write to
vmalloc buffers, such as those used for Linux kernel modules. Any
attempt to load a Linux kernel module from 9p-virtio produces the
following stack.

[&lt;ffffffff814878ce&gt;] p9_virtio_zc_request+0x45e/0x510
[&lt;ffffffff814814ed&gt;] p9_client_zc_rpc.constprop.16+0xfd/0x4f0
[&lt;ffffffff814839dd&gt;] p9_client_read+0x15d/0x240
[&lt;ffffffff811c8440&gt;] v9fs_fid_readn+0x50/0xa0
[&lt;ffffffff811c84a0&gt;] v9fs_file_readn+0x10/0x20
[&lt;ffffffff811c84e7&gt;] v9fs_file_read+0x37/0x70
[&lt;ffffffff8114e3fb&gt;] vfs_read+0x9b/0x160
[&lt;ffffffff81153571&gt;] kernel_read+0x41/0x60
[&lt;ffffffff810c83ab&gt;] copy_module_from_fd.isra.34+0xfb/0x180

Subsequently, QEMU will die printing:

qemu-system-x86_64: virtio: trying to map MMIO memory

This patch enables 9p-virtio to correctly handle this case. This not
only enables us to load Linux kernel modules off virtfs, but also
enables ZFS file-based vdevs on virtfs to be used without killing QEMU.

Special thanks to both Avi Kivity and Alexander Graf for their
interpretation of QEMU backtraces. Without their guidence, tracking down
this bug would have taken much longer. Also, special thanks to Linus
Torvalds for his insightful explanation of why this should use
is_vmalloc_addr() instead of is_vmalloc_or_module_addr():

https://lkml.org/lkml/2014/2/8/272

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