Re: [RFC PATCH] virtio: virtio ring layout optimization and vectorization rx
From: Xie, Huawei <hidden>
Date: 2015-09-22 09:30:01
On 9/22/2015 4:38 PM, Thomas Monjalon wrote:
2015-09-18 00:17, Huawei Xie:quoted
--- a/config/common_linuxapp +++ b/config/common_linuxapp@@ -241,6 +241,7 @@ CONFIG_RTE_LIBRTE_ENIC_DEBUG=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_VIRTIO_SIMPLE=y CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_INIT=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n-1quoted
@@ -1150,6 +1158,14 @@ rx_func_get(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = &virtio_recv_mergeable_pkts; else eth_dev->rx_pkt_burst = &virtio_recv_pkts; + +#ifdef RTE_VIRTIO_SIMPLE + if (!vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) { + printf("use simple rxtx\n"); + eth_dev->rx_pkt_burst = &virtio_recv_pkts_simple; + eth_dev->tx_pkt_burst = &virtio_xmit_pkts_simple; + } +#endifI thought it was clear we must avoid #ifdef for configuration. Please check how to add a runtime flag. Or better: keep only one path which works everywhere and well optimized.
Thomas, i have this in mind when i am developing this feature and i plan to discuss this with you. In theory, the best solution would be using run time flag and the result would be normally we always choose the optimized path. The situation in real world is, in my mind, this feature isn't mature enough(Of course this doesn't mean it has known issues). One good solution in kernel community is experimental features. Could we also have experimental/development tag? I would like to put this as experimental/development feature temporarily, turn it off by default and continue to improve it. The advantage is we have it in tree and every developers could pull it and help improve it. Also, it is the base for continuous vhost optimization. We should have a performance optimized driver for the device side optimization. Cced some developers to see their opinion. Thoughts?