1.overview of eth_vecring
Last updated
Was this helpful?
Last updated
Was this helpful?
This chapter will briefly describe in what situation eth_vecring could be applied ,and the major structure of eth_vecring.
as mentioned moments ago,the eth_vecring is special for LXC container,but you many wonder why it's not for virtual machine ,for example ,vm booted by QEMU.
Yes ,it seems very common for virtual machine to use a virtual link ,and there seems no other common for vm to communicate with whatever outside in a networking way, I 've tried many ways before to find special ways to implement a high speed virtual link for VMs, finally ,it turns out to be not as good as I expected before doing that ,which disappointed me a lot. an obvious example is that I use zero copy based for packets exchanging between dpdk host pmd and dpdk guest pmd[-----------------] ,the max throughput per core is 12Mpps,even with this good-sounding result ,I find it useless ,because host and guest share the host hugepage filesystem, it's that difficult to make sure any side would not access the memory space by unknown reason .afterward ,I was told that dpdk official virtio pmd already reaches 9.9 Mpps per core ,it even involves memory copying ,which surprises so much: How they make it.the answer is vector processing .one of the core developers told me that .
Why not to design a new IPC ring buffer special for PMD and optimized using vector instruction sets? this idea haunted me for several days , and I do not know anything about X86_64 vector/stream instruction set at that time ,I think it should not be the problem ,I started doing that immediately .
I almost forget to tell the reason why I chose LXC as the platform ,many people would say,Oh,don't use any container ,it's not safe .NO,container is not for end users ,it's for trusted user,even it's not completely segregated ,and we know this ,but it's still safe.
and another reason is I do think container will have a bright future in NFV area.
the key to hosting NFV appliance is highly performed data plane ,containers which have least performance loss are supposed to be very good choice when you need a system-level hypervisor(someone would say a container is not a full-ledged vm hypervisor,but it is).
in order to exchange massive packets between host and container ,we need a shared memory ,in order to enhance memory access efficiently ,we use hugepage memory instead of Linux shm ,which will reduce tlb lookup miss rate greatly.
the following figure illustrates how the pmd looks like:
as you can see from this figure ,there are two channels ,one for inbound direction,the other for outbound,the PMD residing in host is master ,the other end is slave .the difference is when you need to put a packet into the ring buffer ,i.e. queue, the master should put it into inbound ring buffer ,fetch packets from outbound ring buffer ,while slave doing rx/tx on the crossing ring buffers as shown .