numam-dpdk/lib/librte_vhost
Yuanhan Liu 932a00b85a vhost: refactor mergeable Rx
Current virtio_dev_merge_rx() implementation just looks like the
old rte_vhost_dequeue_burst(), full of twisted logic, that you
can see same code block in quite many different places.

However, the logic of virtio_dev_merge_rx() is quite similar to
virtio_dev_rx().  The big difference is that the mergeable one
could allocate more than one available entries to hold the data.
Fetching all available entries to vec_buf at once makes the
difference a bit bigger then.

The refactored code looks like below:

	while (mbuf_has_not_drained_totally || mbuf_has_next) {
		if (this_desc_has_no_room) {
			this_desc = fetch_next_from_vec_buf();

			if (it is the last of a desc chain)
				update_used_ring();
		}

		if (this_mbuf_has_drained_totally)
			mbuf = fetch_next_mbuf();

		COPY(this_desc, this_mbuf);
	}

This patch reduces quite many lines of code, therefore, make it much
more readable.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-03-14 23:56:41 +01:00
..
eventfd_link vhost: fix kernel module insertion 2015-11-24 21:34:11 +01:00
libvirt vhost: fix qemu shutdown 2015-09-24 14:57:36 +02:00
vhost_cuse vhost: remove device operations pointers 2016-02-19 19:33:31 +01:00
vhost_user vhost: broadcast RARP by injecting in receiving mbuf array 2016-02-29 16:55:30 +01:00
Makefile mk: fix vhost shared library dependencies 2016-03-13 20:27:26 +01:00
rte_vhost_version.map vhost: cleanup unix socket 2015-06-30 17:49:08 +02:00
rte_virtio_net.h vhost: fix build with kernel < 3.5 2016-03-11 16:46:18 +01:00
vhost_rxtx.c vhost: refactor mergeable Rx 2016-03-14 23:56:41 +01:00
vhost-net.h vhost: remove device operations pointers 2016-02-19 19:33:31 +01:00
virtio-net.c vhost: fix queue pair reallocation 2016-03-11 16:49:20 +01:00
virtio-net.h vhost: implement cuse memory table 2015-02-24 01:38:14 +01:00