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>
DPDK is a set of libraries and drivers for fast packet processing. It supports many processor architectures and both FreeBSD and Linux. The DPDK uses the Open Source BSD license for the core libraries and drivers. The kernel components are GPLv2 licensed. Please check the doc directory for release notes, API documentation, and sample application information. For questions and usage discussions, subscribe to: users@dpdk.org Report bugs and issues to the development mailing list: dev@dpdk.org
Description
Languages
C
99.1%
Meson
0.5%
Python
0.2%
Shell
0.1%