OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [snabb-devel] Re: [virtio-dev] Writing a Virtio-net device in Lua (Snabb Switch)


On 16 February 2014 18:27, Michael S. Tsirkin <mst@redhat.com> wrote:
I wonder whether Lua provides low level memory barriers
used for virtio ring operation.
They are required for correctness on SMP systems.

Currently we use the x86 MFENCE instruction for memory barriers. (We target x86 exclusively.)

However I suspect we don't actually need this barrier for x86 SMP. Is that right?

LuaJIT makes it pretty easy for us to mix in C/asm code and data structures: http://luajit.org/ext_ffi_tutorial.html

With recent drivers, you might get smaller buffers as well,
starting with
Commit 2613af0ed18a ("virtio_net: migrate mergeable rx buffers to page frag
allocators")

See also
virtio-net: auto-tune mergeable rx buffer size for improved
performance

which changes the size dynamically.

Thanks for the tip!

> I believe that I can send packets to VMs using multiple buffers, and
> that I can say how many bytes of each buffer should be used, but cannot use
> offsets (data must start at the beginning of the buffer).

Yes.

Cool. I think this is flexible enough to accomplish what we want.

> Are INDIRECT descriptors a good choice for me? I don't use it today and I don't
> know if it would bring any advantages. If it would in practice give me more
> buffers from the VM then that would be positive. (I seem to only get 256
> buffers from qemu.)

In our testing it's an advantage for guest to external but not
external to guest.

Thanks for that tip, too!

Great to know about this forum. I'm sure we will have some more questions...

Cheers,
-Luke




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]