JustKernel

Ray Of Hope

QEMU Networking Vhost-user & Transport Infiniband – series 4, recipient path

Finally got the receive path working from app2 running on server2 to VM2. Now I can see the rx stats in “ifconfig eth0” increasing for every packet transmitted to it.

What was the problem:
The problem was with the handling of the available ring and used ring. Its a rx case and I was treating it as a tx case where in a host wants to sends a packet to the guest.

What I was doing wrong:I was adding a new entry to the available ring for new buffer.

What is correct: To receive data from a VirtIO device (host transfers to guest via VritIO device), the guest adds an empty buffer to the descriptor array (addr element, with the Write-Only flag set), and adds the index of the buffer to the Available ring, and increments the Available index field, and writes the Virtual Queue index to the Queue Notify I/O register. When the buffer has been filled, the device will write the buffer index to the Used ring and increment the Used index.

Other error that I got before success: guest kernel log : syslog |65534 buffers out of 65535 missing .
Reason and solution: I am transferring only 1 packet from host to guest and doing no batching, that can the reason guest virtio_driver is complaining. May be this is an optimization check.

static struct sk_buff *receive_mergeable(struct net_device *dev,
struct receive_queue *rq,
void *buf,
unsigned int len)
{
if (unlikely(!curr_skb))
goto err_skb;
num_buf =1 ; //somehow its getting num_buf to 65536. I hardcoded it to 1.. This solved the problem..
while (–num_buf) {
}

Reference links: http://dpdk.org/doc/guides/sample_app_ug/vhost.html
2) http://docs.oasis-open.org/virtio/virtio/v1.0/csprd01/virtio-v1.0-csprd01.pdf
3) http://wiki.osdev.org/Virtio
4) http://dpdk.org/doc/guides/sample_app_ug/vhost.html#
5) http://www.virtualopensystems.com/en/solutions/guides/snabbswitch-qemu/
Thanks
anshul_makkar@justkernel.com

Tags: , , , ,


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.