Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-06-01 Thread Luigi Rizzo
Works me. I can now receive at 1.15 Mpps, slightly faster than my previous patch which generated unnecessary writes to the signalling socket. Tested-by: Luigi Rizzo On Thu, May 31, 2012 at 12:03 PM, Paolo Bonzini wrote: > Il 31/05/2012 10:23, Jan Kiszka ha scritto: > >> > @@ -922,6 +923,7 @@ s

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Stefan Weil
Hi Paolo, I suggest using false / true instead of 0 / 1 for the boolean values, see my comments below. Regards, Stefan Am 31.05.2012 12:03, schrieb Paolo Bonzini: [...] -void qemu_net_queue_flush(NetQueue *queue) +bool qemu_net_queue_flush(NetQueue *queue) { while (!QTAILQ_EMPTY(&qu

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Paolo Bonzini
Il 31/05/2012 13:43, Stefano Stabellini ha scritto: >> > No, it's not that. I was talking about feature-rx-notify. But I >> > remembered wrong, that feature is advertised by the front-end, not the >> > back-end. > Yes, that's right. > > >> > IIRC there is only one event channel per Xen network

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Stefano Stabellini
On Thu, 31 May 2012, Paolo Bonzini wrote: > Il 31/05/2012 13:06, Stefano Stabellini ha scritto: > >> > For Xen I think this is not possible at the moment because it doesn't > >> > implement rx notification. > > > > Why do you say that? Xen supports the iothread and CONFIG_EVENTFD. > > No, it's n

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Paolo Bonzini
Il 31/05/2012 13:06, Stefano Stabellini ha scritto: >> > For Xen I think this is not possible at the moment because it doesn't >> > implement rx notification. > > Why do you say that? Xen supports the iothread and CONFIG_EVENTFD. No, it's not that. I was talking about feature-rx-notify. But I

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Stefano Stabellini
On Thu, 31 May 2012, Paolo Bonzini wrote: > Il 31/05/2012 00:53, Luigi Rizzo ha scritto: > > The image contains my fast packet generator "pkt-gen" (a stock > > traffic generator such as netperf etc. is too slow to show the > > problem). pkt-gen can send about 1Mpps in this configuration using > > -

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Paolo Bonzini
Il 31/05/2012 12:40, Jan Kiszka ha scritto: > On 2012-05-31 12:03, Paolo Bonzini wrote: >> Il 31/05/2012 10:23, Jan Kiszka ha scritto: > @@ -922,6 +923,7 @@ set_rdt(E1000State *s, int index, uint32_t val) > { > s->check_rxov = 0; > s->mac_reg[index] = val & 0x; >

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Jan Kiszka
On 2012-05-31 12:03, Paolo Bonzini wrote: > Il 31/05/2012 10:23, Jan Kiszka ha scritto: @@ -922,6 +923,7 @@ set_rdt(E1000State *s, int index, uint32_t val) { s->check_rxov = 0; s->mac_reg[index] = val & 0x; +qemu_notify_event(); >> This still looks like t

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Paolo Bonzini
Il 31/05/2012 10:23, Jan Kiszka ha scritto: >> > @@ -922,6 +923,7 @@ set_rdt(E1000State *s, int index, uint32_t val) >> > { >> > s->check_rxov = 0; >> > s->mac_reg[index] = val & 0x; >> > +qemu_notify_event(); > This still looks like the wrong tool: Packets that can't be delivere

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Jan Kiszka
On 2012-05-31 10:32, Luigi Rizzo wrote: > On Thu, May 31, 2012 at 10:23 AM, Jan Kiszka wrote: > >> On 2012-05-31 09:38, Paolo Bonzini wrote >> > ... > >> >> This still looks like the wrong tool: Packets that can't be delivered >> are queued. So we need to flush the queue and clear the blocked de

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Luigi Rizzo
On Thu, May 31, 2012 at 10:23 AM, Jan Kiszka wrote: > On 2012-05-31 09:38, Paolo Bonzini wrote > ... > > This still looks like the wrong tool: Packets that can't be delivered > are queued. So we need to flush the queue and clear the blocked delivery > there. qemu_flush_queued_packets appears mor

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Jan Kiszka
On 2012-05-31 10:23, Luigi Rizzo wrote: > But i think it would be more robust to make fewer assumptions on > what the guest does, and send the notify on all register writes > (those are relatively rare in a driver, and the datapath touches > exactly the registers we ought to be interested in), > an

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Jan Kiszka
On 2012-05-31 09:38, Paolo Bonzini wrote: > Il 31/05/2012 00:53, Luigi Rizzo ha scritto: >> The image contains my fast packet generator "pkt-gen" (a stock >> traffic generator such as netperf etc. is too slow to show the >> problem). pkt-gen can send about 1Mpps in this configuration using >> -net

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Luigi Rizzo
On Thu, May 31, 2012 at 9:38 AM, Paolo Bonzini wrote: > Il 31/05/2012 00:53, Luigi Rizzo ha scritto: > > The image contains my fast packet generator "pkt-gen" (a stock > > traffic generator such as netperf etc. is too slow to show the > > problem). pkt-gen can send about 1Mpps in this configurati

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-31 Thread Paolo Bonzini
Il 31/05/2012 00:53, Luigi Rizzo ha scritto: > The image contains my fast packet generator "pkt-gen" (a stock > traffic generator such as netperf etc. is too slow to show the > problem). pkt-gen can send about 1Mpps in this configuration using > -net netmap in the backend. The qemu process in this

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-30 Thread Luigi Rizzo
On Thu, May 31, 2012 at 12:11 AM, Jan Kiszka wrote: > On 2012-05-30 23:55, Luigi Rizzo wrote: > > you can take the freebsd image from the netmap page in my link and run it > > in qemu, and then run the pkt-gen program in the image in either > > send or receive mode. But this is overkill, as you h

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-30 Thread Jan Kiszka
On 2012-05-30 23:55, Luigi Rizzo wrote: > you can take the freebsd image from the netmap page in my link and run it > in qemu, and then run the pkt-gen program in the image in either > send or receive mode. But this is overkill, as you have described the > problem exactly in your post: when the gue

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-30 Thread Luigi Rizzo
On Wed, May 30, 2012 at 11:39 PM, Jan Kiszka wrote: > Please keep CCs. > > ok > On 2012-05-30 23:23, Luigi Rizzo wrote: > >> On Wed, May 30, 2012 at 10:23:11PM +0200, Luigi Rizzo wrote: > > ... > >>> The problem was fixed by the following one-line addition to > >>> hw/e1000.c :: e1000_mmio_writ

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-30 Thread Jan Kiszka
Please keep CCs. On 2012-05-30 23:23, Luigi Rizzo wrote: >> On Wed, May 30, 2012 at 10:23:11PM +0200, Luigi Rizzo wrote: > ... >>> The problem was fixed by the following one-line addition to >>> hw/e1000.c :: e1000_mmio_write() , to wakeup the qemu mainloop and >>> check that some buffers might be

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-30 Thread Luigi Rizzo
> On Wed, May 30, 2012 at 10:23:11PM +0200, Luigi Rizzo wrote: ... > > The problem was fixed by the following one-line addition to > > hw/e1000.c :: e1000_mmio_write() , to wakeup the qemu mainloop and > > check that some buffers might be available. > > > > --- hw/e1000.c.orig 2012-02-17 20:4

Re: [Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-30 Thread Jan Kiszka
On 2012-05-30 22:23, Luigi Rizzo wrote: > Hi, > while testing qemu with netmap (see [Note 1] for details) on e1000 > emulation, i noticed that my sender program using a custom backend > [Note 2] could reach 1 Mpps (million packets per second) but on the > receive side i was limited to 50 Kpps (and

[Qemu-devel] Proposed patch: huge RX speedup for hw/e1000.c

2012-05-30 Thread Luigi Rizzo
Hi, while testing qemu with netmap (see [Note 1] for details) on e1000 emulation, i noticed that my sender program using a custom backend [Note 2] could reach 1 Mpps (million packets per second) but on the receive side i was limited to 50 Kpps (and CPU always below 5%). The problem was fixed by th