<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/virtio/virtio_pci.c, branch tegra-10.9.9</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>virtio-pci: fix per-vq MSI-X request logic</title>
<updated>2009-10-28T22:20:36+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2009-10-22T13:06:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0b22bd0ba0d500ab40e7673c591c594ec5447342'/>
<id>0b22bd0ba0d500ab40e7673c591c594ec5447342</id>
<content type='text'>
Commit f68d24082e22ccee3077d11aeb6dc5354f0ca7f1
in 2.6.32-rc1 broke requesting IRQs for per-VQ MSI-X vectors:
- vector number was used instead of the vector itself
- we try to request an IRQ for VQ which does not
  have a callback handler

This is a regression that causes warnings in kernel log,
potentially lower performance as we need to scan vq list,
and might cause system failure if the interrupt
requested is in fact needed by another system.

This was not noticed earlier because in most cases
we were falling back on shared interrupt for all vqs.

The warnings often look like this:

virtio-pci 0000:00:03.0: irq 26 for MSI/MSI-X
virtio-pci 0000:00:03.0: irq 27 for MSI/MSI-X
virtio-pci 0000:00:03.0: irq 28 for MSI/MSI-X
IRQ handler type mismatch for IRQ 1
current handler: i8042
Pid: 2400, comm: modprobe Tainted: G        W
2.6.32-rc3-11952-gf3ed8d8-dirty #1
Call Trace:
 [&lt;ffffffff81072aed&gt;] ? __setup_irq+0x299/0x304
 [&lt;ffffffff81072ff3&gt;] ? request_threaded_irq+0x144/0x1c1
 [&lt;ffffffff813455af&gt;] ? vring_interrupt+0x0/0x30
 [&lt;ffffffff81346598&gt;] ? vp_try_to_find_vqs+0x583/0x5c7
 [&lt;ffffffffa0015188&gt;] ? skb_recv_done+0x0/0x34 [virtio_net]
 [&lt;ffffffff81346609&gt;] ? vp_find_vqs+0x2d/0x83
 [&lt;ffffffff81345d00&gt;] ? vp_get+0x3c/0x4e
 [&lt;ffffffffa0016373&gt;] ? virtnet_probe+0x2f1/0x428 [virtio_net]
 [&lt;ffffffffa0015188&gt;] ? skb_recv_done+0x0/0x34 [virtio_net]
 [&lt;ffffffffa00150d8&gt;] ? skb_xmit_done+0x0/0x39 [virtio_net]
 [&lt;ffffffff8110ab92&gt;] ? sysfs_do_create_link+0xcb/0x116
 [&lt;ffffffff81345cc2&gt;] ? vp_get_status+0x14/0x16
 [&lt;ffffffff81345464&gt;] ? virtio_dev_probe+0xa9/0xc8
 [&lt;ffffffff8122b11c&gt;] ? driver_probe_device+0x8d/0x128
 [&lt;ffffffff8122b206&gt;] ? __driver_attach+0x4f/0x6f
 [&lt;ffffffff8122b1b7&gt;] ? __driver_attach+0x0/0x6f
 [&lt;ffffffff8122a9f9&gt;] ? bus_for_each_dev+0x43/0x74
 [&lt;ffffffff8122a374&gt;] ? bus_add_driver+0xea/0x22d
 [&lt;ffffffff8122b4a3&gt;] ? driver_register+0xa7/0x111
 [&lt;ffffffffa001a000&gt;] ? init+0x0/0xc [virtio_net]
 [&lt;ffffffff81009051&gt;] ? do_one_initcall+0x50/0x148
 [&lt;ffffffff8106e117&gt;] ? sys_init_module+0xc5/0x21a
 [&lt;ffffffff8100af02&gt;] ? system_call_fastpath+0x16/0x1b
virtio-pci 0000:00:03.0: irq 26 for MSI/MSI-X
virtio-pci 0000:00:03.0: irq 27 for MSI/MSI-X

Reported-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Reported-by: Shirley Ma &lt;xma@us.ibm.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit f68d24082e22ccee3077d11aeb6dc5354f0ca7f1
in 2.6.32-rc1 broke requesting IRQs for per-VQ MSI-X vectors:
- vector number was used instead of the vector itself
- we try to request an IRQ for VQ which does not
  have a callback handler

This is a regression that causes warnings in kernel log,
potentially lower performance as we need to scan vq list,
and might cause system failure if the interrupt
requested is in fact needed by another system.

This was not noticed earlier because in most cases
we were falling back on shared interrupt for all vqs.

The warnings often look like this:

virtio-pci 0000:00:03.0: irq 26 for MSI/MSI-X
virtio-pci 0000:00:03.0: irq 27 for MSI/MSI-X
virtio-pci 0000:00:03.0: irq 28 for MSI/MSI-X
IRQ handler type mismatch for IRQ 1
current handler: i8042
Pid: 2400, comm: modprobe Tainted: G        W
2.6.32-rc3-11952-gf3ed8d8-dirty #1
Call Trace:
 [&lt;ffffffff81072aed&gt;] ? __setup_irq+0x299/0x304
 [&lt;ffffffff81072ff3&gt;] ? request_threaded_irq+0x144/0x1c1
 [&lt;ffffffff813455af&gt;] ? vring_interrupt+0x0/0x30
 [&lt;ffffffff81346598&gt;] ? vp_try_to_find_vqs+0x583/0x5c7
 [&lt;ffffffffa0015188&gt;] ? skb_recv_done+0x0/0x34 [virtio_net]
 [&lt;ffffffff81346609&gt;] ? vp_find_vqs+0x2d/0x83
 [&lt;ffffffff81345d00&gt;] ? vp_get+0x3c/0x4e
 [&lt;ffffffffa0016373&gt;] ? virtnet_probe+0x2f1/0x428 [virtio_net]
 [&lt;ffffffffa0015188&gt;] ? skb_recv_done+0x0/0x34 [virtio_net]
 [&lt;ffffffffa00150d8&gt;] ? skb_xmit_done+0x0/0x39 [virtio_net]
 [&lt;ffffffff8110ab92&gt;] ? sysfs_do_create_link+0xcb/0x116
 [&lt;ffffffff81345cc2&gt;] ? vp_get_status+0x14/0x16
 [&lt;ffffffff81345464&gt;] ? virtio_dev_probe+0xa9/0xc8
 [&lt;ffffffff8122b11c&gt;] ? driver_probe_device+0x8d/0x128
 [&lt;ffffffff8122b206&gt;] ? __driver_attach+0x4f/0x6f
 [&lt;ffffffff8122b1b7&gt;] ? __driver_attach+0x0/0x6f
 [&lt;ffffffff8122a9f9&gt;] ? bus_for_each_dev+0x43/0x74
 [&lt;ffffffff8122a374&gt;] ? bus_add_driver+0xea/0x22d
 [&lt;ffffffff8122b4a3&gt;] ? driver_register+0xa7/0x111
 [&lt;ffffffffa001a000&gt;] ? init+0x0/0xc [virtio_net]
 [&lt;ffffffff81009051&gt;] ? do_one_initcall+0x50/0x148
 [&lt;ffffffff8106e117&gt;] ? sys_init_module+0xc5/0x21a
 [&lt;ffffffff8100af02&gt;] ? system_call_fastpath+0x16/0x1b
virtio-pci 0000:00:03.0: irq 26 for MSI/MSI-X
virtio-pci 0000:00:03.0: irq 27 for MSI/MSI-X

Reported-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Reported-by: Shirley Ma &lt;xma@us.ibm.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_pci: minor MSI-X cleanups</title>
<updated>2009-09-23T12:56:31+00:00</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-09-24T04:26:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f68d24082e22ccee3077d11aeb6dc5354f0ca7f1'/>
<id>f68d24082e22ccee3077d11aeb6dc5354f0ca7f1</id>
<content type='text'>
1) Rename vp_request_vectors to vp_request_msix_vectors, and take
   non-MSI-X case out to caller.
2) Comment weird pci_enable_msix API
3) Rename vp_find_vq to setup_vq.
4) Fix spaces to tabs
5) Make nvectors calc internal to vp_try_to_find_vqs()
6) Rename vector to msix_vector for more clarity.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1) Rename vp_request_vectors to vp_request_msix_vectors, and take
   non-MSI-X case out to caller.
2) Comment weird pci_enable_msix API
3) Rename vp_find_vq to setup_vq.
4) Fix spaces to tabs
5) Make nvectors calc internal to vp_try_to_find_vqs()
6) Rename vector to msix_vector for more clarity.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: refactor find_vqs</title>
<updated>2009-07-30T06:33:45+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2009-07-26T12:48:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e969fed542cae08cb11d666efac4f7c5d624d09f'/>
<id>e969fed542cae08cb11d666efac4f7c5d624d09f</id>
<content type='text'>
This refactors find_vqs, making it more readable and robust, and fixing
two regressions from 2.6.30:
- double free_irq causing BUG_ON on device removal
- probe failure when vq can't be assigned to msi-x vector
  (reported on old host kernels)

Tested-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This refactors find_vqs, making it more readable and robust, and fixing
two regressions from 2.6.30:
- double free_irq causing BUG_ON on device removal
- probe failure when vq can't be assigned to msi-x vector
  (reported on old host kernels)

Tested-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: delete vq from list</title>
<updated>2009-07-30T06:33:44+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2009-07-26T12:48:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f6c82507030d61e15928d5cad946d3eac1c4a384'/>
<id>f6c82507030d61e15928d5cad946d3eac1c4a384</id>
<content type='text'>
This makes delete vq the reverse of find vq.
This is required to make it possible to retry find_vqs
after a failure, otherwise the list gets corrupted.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes delete vq the reverse of find vq.
This is required to make it possible to retry find_vqs
after a failure, otherwise the list gets corrupted.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: fix memory leak on device removal</title>
<updated>2009-07-30T06:33:44+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2009-07-23T11:57:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ff52c3fc7188855ede75d87b022271f0da309e5b'/>
<id>ff52c3fc7188855ede75d87b022271f0da309e5b</id>
<content type='text'>
Make vp_free_vectors do the reverse of vq_request_vectors.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make vp_free_vectors do the reverse of vq_request_vectors.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio-pci: correctly unregister root device on error</title>
<updated>2009-07-17T12:17:47+00:00</updated>
<author>
<name>Mark McLoughlin</name>
<email>markmc@redhat.com</email>
</author>
<published>2009-07-07T07:26:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4b892e6582e3a4fe01f623aea386907270d5bf83'/>
<id>4b892e6582e3a4fe01f623aea386907270d5bf83</id>
<content type='text'>
If pci_register_driver() fails we're incorrectly unregistering the root
device with device_unregister() rather than root_device_unregister().

Reported-by: Don Zickus &lt;dzickus@redhat.com&gt;
Signed-off-by: Mark McLoughlin &lt;markmc@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If pci_register_driver() fails we're incorrectly unregistering the root
device with device_unregister() rather than root_device_unregister().

Reported-by: Don Zickus &lt;dzickus@redhat.com&gt;
Signed-off-by: Mark McLoughlin &lt;markmc@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_pci: optional MSI-X support</title>
<updated>2009-06-12T12:46:37+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2009-05-14T10:55:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=82af8ce84ed65d2fb6d8c017d3f2bbbf161061fb'/>
<id>82af8ce84ed65d2fb6d8c017d3f2bbbf161061fb</id>
<content type='text'>
This implements optional MSI-X support in virtio_pci.
MSI-X is used whenever the host supports at least 2 MSI-X
vectors: 1 for configuration changes and 1 for virtqueues.
Per-virtqueue vectors are allocated if enough vectors
available.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Anthony Liguori &lt;aliguori@us.ibm.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt; (+ whitespace, style)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implements optional MSI-X support in virtio_pci.
MSI-X is used whenever the host supports at least 2 MSI-X
vectors: 1 for configuration changes and 1 for virtqueues.
Per-virtqueue vectors are allocated if enough vectors
available.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Anthony Liguori &lt;aliguori@us.ibm.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt; (+ whitespace, style)
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio_pci: split up vp_interrupt</title>
<updated>2009-06-12T12:46:37+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2009-05-14T10:55:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=77cf524654a886e0fbbf03b16b44f048deef7b0c'/>
<id>77cf524654a886e0fbbf03b16b44f048deef7b0c</id>
<content type='text'>
This reorganizes virtio-pci code in vp_interrupt slightly, so that
it's easier to add per-vq MSI support on top.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reorganizes virtio-pci code in vp_interrupt slightly, so that
it's easier to add per-vq MSI support on top.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: find_vqs/del_vqs virtio operations</title>
<updated>2009-06-12T12:46:36+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2009-06-13T04:16:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d2a7ddda9ffb1c8961abff6714b0f1eb925c120f'/>
<id>d2a7ddda9ffb1c8961abff6714b0f1eb925c120f</id>
<content type='text'>
This replaces find_vq/del_vq with find_vqs/del_vqs virtio operations,
and updates all drivers. This is needed for MSI support, because MSI
needs to know the total number of vectors upfront.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt; (+ lguest/9p compile fixes)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This replaces find_vq/del_vq with find_vqs/del_vqs virtio operations,
and updates all drivers. This is needed for MSI support, because MSI
needs to know the total number of vectors upfront.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt; (+ lguest/9p compile fixes)
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: add names to virtqueue struct, mapping from devices to queues.</title>
<updated>2009-06-12T12:46:36+00:00</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-06-13T04:16:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9499f5e7ed5224c40706f0cec6542a9916bc7606'/>
<id>9499f5e7ed5224c40706f0cec6542a9916bc7606</id>
<content type='text'>
Add a linked list of all virtqueues for a virtio device: this helps for
debugging and is also needed for upcoming interface change.

Also, add a "name" field for clearer debug messages.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a linked list of all virtqueues for a virtio device: this helps for
debugging and is also needed for upcoming interface change.

Also, add a "name" field for clearer debug messages.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
</feed>
