Re: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit

2009-06-02 Thread David Miller
From: Patrick Ohly patrick.o...@intel.com Date: Mon, 01 Jun 2009 21:47:22 +0200 On Fri, 2009-05-29 at 23:44 +0930, Rusty Russell wrote: This patch adds skb_orphan to the start of dev_hard_start_xmit(): it can be premature in the NETDEV_TX_BUSY case, but that's uncommon. Would it be possible

Re: [PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.

2009-06-02 Thread Mark McLoughlin
On Fri, 2009-05-29 at 23:46 +0930, Rusty Russell wrote: This effectively reverts 99ffc696d10b28580fe93441d627cf290ac4484c virtio: wean net driver off NETDEV_TX_BUSY. The complexity of queuing an skb (setting a tasklet to re-xmit) is questionable, It certainly adds some subtle complexities

Re: [PATCH 3/4] virtio_net: don't free buffers in xmit ring

2009-06-02 Thread Mark McLoughlin
On Fri, 2009-05-29 at 23:46 +0930, Rusty Russell wrote: The virtio_net driver is complicated by the two methods of freeing old xmit buffers (in addition to freeing old ones at the start of the xmit path). The original code used a 1/10 second timer attached to xmit_free(), reset on every

Re: [PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.

2009-06-02 Thread Herbert Xu
On Fri, May 29, 2009 at 11:46:04PM +0930, Rusty Russell wrote: This effectively reverts 99ffc696d10b28580fe93441d627cf290ac4484c virtio: wean net driver off NETDEV_TX_BUSY. The complexity of queuing an skb (setting a tasklet to re-xmit) is questionable, especially once we get rid of the

Re: [PATCH 3/4] virtio_net: don't free buffers in xmit ring

2009-06-02 Thread Mark McLoughlin
On Tue, 2009-06-02 at 09:13 +0100, Mark McLoughlin wrote: On Fri, 2009-05-29 at 23:46 +0930, Rusty Russell wrote: The virtio_net driver is complicated by the two methods of freeing old xmit buffers (in addition to freeing old ones at the start of the xmit path). The original code used

Re: [PATCH 3/4] virtio_net: don't free buffers in xmit ring

2009-06-02 Thread Rusty Russell
On Tue, 2 Jun 2009 05:43:42 pm Mark McLoughlin wrote: On Fri, 2009-05-29 at 23:46 +0930, Rusty Russell wrote: The virtio_net driver is complicated by the two methods of freeing old xmit buffers (in addition to freeing old ones at the start of the xmit path). The original code used a

Re: [PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.

2009-06-02 Thread Rusty Russell
On Tue, 2 Jun 2009 06:35:52 pm Herbert Xu wrote: On Fri, May 29, 2009 at 11:46:04PM +0930, Rusty Russell wrote: This effectively reverts 99ffc696d10b28580fe93441d627cf290ac4484c virtio: wean net driver off NETDEV_TX_BUSY. The complexity of queuing an skb (setting a tasklet to re-xmit) is

Re: [PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.

2009-06-02 Thread Rusty Russell
On Tue, 2 Jun 2009 05:37:30 pm Mark McLoughlin wrote: On Fri, 2009-05-29 at 23:46 +0930, Rusty Russell wrote: This effectively reverts 99ffc696d10b28580fe93441d627cf290ac4484c virtio: wean net driver off NETDEV_TX_BUSY. The complexity of queuing an skb (setting a tasklet to re-xmit) is

Re: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit

2009-06-02 Thread Rusty Russell
On Tue, 2 Jun 2009 04:55:53 pm David Miller wrote: From: Patrick Ohly patrick.o...@intel.com Date: Mon, 01 Jun 2009 21:47:22 +0200 On Fri, 2009-05-29 at 23:44 +0930, Rusty Russell wrote: This patch adds skb_orphan to the start of dev_hard_start_xmit(): it can be premature in the

Re: [PATCH 3/4] virtio_net: don't free buffers in xmit ring

2009-06-02 Thread Rusty Russell
On Tue, 2 Jun 2009 09:11:42 pm Mark McLoughlin wrote: On Tue, 2009-06-02 at 09:13 +0100, Mark McLoughlin wrote: I think skb_orphan() is enough to prevent this, is it? Oops, I meant: I don't think skb_orphan() is enough to prevent this, is it? Yes, point taken. No, it's not. We could

[PATCHv2 00/13] qemu: MSI-X support

2009-06-02 Thread Michael S. Tsirkin
Resending. Incorporated a minor fix pointed out by Isaku Yamahata. Here is the port of MSI-X support patches to upstream qemu. Please comment or commit. This patchset adds generic support for MSI-X, adds implementation in APIC, and uses MSI-X in virtio-net. At Paul's suggestion, I use stl_phy to

[PATCHv2 01/13] qemu: make default_write_config use mask table

2009-06-02 Thread Michael S. Tsirkin
Change much of hw/pci to use symbolic constants and a table-driven design: add a mask table with writable bits set and readonly bits unset. Detect change by comparing original and new registers. This makes it easy to support capabilities where read-only/writeable bit layout differs between

[PATCHv2 06/13] qemu: add flag to disable MSI-X by default

2009-06-02 Thread Michael S. Tsirkin
Add global flag to disable MSI-X by default. This is useful primarily to make images loadable by older qemu (without msix). Even when MSI-X is disabled by flag, you can still load images that have MSI-X enabled. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/msix.c |3 +++

[PATCHv2 11/13] qemu: request 3 vectors in virtio-net

2009-06-02 Thread Michael S. Tsirkin
Request up to 3 vectors in virtio-net. Actual bindings might supply less. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/virtio-net.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 60aa6da..6118fe3 100644 ---

[PATCHv2 08/13] qemu: add support for resizing regions

2009-06-02 Thread Michael S. Tsirkin
Make it possible to resize PCI regions. This will be used by virtio with MSI-X, where the region size depends on whether MSI-X is enabled, and can change across load/save. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/pci.c | 54

Re: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit

2009-06-02 Thread Patrick Ohly
On Fri, 2009-05-29 at 23:44 +0930, Rusty Russell wrote: This patch adds skb_orphan to the start of dev_hard_start_xmit(): it can be premature in the NETDEV_TX_BUSY case, but that's uncommon. Would it be possible to make the new skb_orphan() at the start of dev_hard_start_xmit() conditionally so

[PATCHv2 05/13] qemu: MSI-X support functions

2009-06-02 Thread Michael S. Tsirkin
Add functions implementing MSI-X support. First user will be virtio-pci. Note that platform must set a flag to declare MSI supported. For PC this will be set by APIC. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- Makefile.target |2 +- hw/msix.c | 423

[PATCHv2 10/13] qemu: MSI-X support in virtio PCI

2009-06-02 Thread Michael S. Tsirkin
This enables actual support for MSI-X in virtio PCI. First user will be virtio-net. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/virtio-pci.c | 152 -- 1 files changed, 112 insertions(+), 40 deletions(-) diff --git

[PATCHv2 12/13] qemu: virtio save/load bindings

2009-06-02 Thread Michael S. Tsirkin
Implement bindings for virtio save/load. Use them in virtio pci. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- hw/virtio-pci.c | 49 - hw/virtio.c | 31 ++- hw/virtio.h |4 3 files changed,

Re: find_vqs operation starting at arbitrary index

2009-06-02 Thread Michael S. Tsirkin
On Tue, Jun 02, 2009 at 08:53:07AM +0930, Rusty Russell wrote: On Mon, 1 Jun 2009 05:33:48 pm Amit Shah wrote: Hello, The recent find_vqs operation doesn't allow for a vq to be found at an arbitrary location; it's meant to be called once at startup to find all possible queues and never

Re: find_vqs operation starting at arbitrary index

2009-06-02 Thread Amit Shah
On (Tue) Jun 02 2009 [19:32:27], Michael S. Tsirkin wrote: On Tue, Jun 02, 2009 at 08:53:07AM +0930, Rusty Russell wrote: On Mon, 1 Jun 2009 05:33:48 pm Amit Shah wrote: Hello, The recent find_vqs operation doesn't allow for a vq to be found at an arbitrary location; it's meant to

Re: find_vqs operation starting at arbitrary index

2009-06-02 Thread Michael S. Tsirkin
On Tue, Jun 02, 2009 at 10:39:16PM +0530, Amit Shah wrote: On (Tue) Jun 02 2009 [19:32:27], Michael S. Tsirkin wrote: On Tue, Jun 02, 2009 at 08:53:07AM +0930, Rusty Russell wrote: On Mon, 1 Jun 2009 05:33:48 pm Amit Shah wrote: Hello, The recent find_vqs operation doesn't allow

Re: [PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.

2009-06-02 Thread Herbert Xu
On Tue, Jun 02, 2009 at 11:25:57PM +0930, Rusty Russell wrote: Or, we could just return NETDEV_TX_BUSY;. I like that :) No you should fix it so that you check the queue status after transmitting a packet so we never get into this state in the first place. NETDEV_TX_BUSY is just passing the

Re: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit

2009-06-02 Thread David Miller
From: Rusty Russell ru...@rustcorp.com.au Date: Tue, 2 Jun 2009 23:38:29 +0930 On Tue, 2 Jun 2009 04:55:53 pm David Miller wrote: From: Patrick Ohly patrick.o...@intel.com Date: Mon, 01 Jun 2009 21:47:22 +0200 On Fri, 2009-05-29 at 23:44 +0930, Rusty Russell wrote: This patch adds