[dpdk-dev] [PATCH v3 18/21] net/virtio: add support for mergeable buffers with packed virtqueues
Tiwei Bie
tiwei.bie at intel.com
Sun Apr 8 08:02:46 CEST 2018
On Thu, Apr 05, 2018 at 12:10:28PM +0200, Jens Freimann wrote:
> Implement support for receiving merged buffers in virtio when packed virtqueues
> are enabled.
>
> Signed-off-by: Jens Freimann <jfreimann at redhat.com>
> ---
> drivers/net/virtio/virtio_ethdev.c | 10 ++--
> drivers/net/virtio/virtio_rxtx.c | 107 +++++++++++++++++++++++++++++++++----
> drivers/net/virtio/virtqueue.h | 1 +
> 3 files changed, 104 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 7367d9c5d..a3c3376d7 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1322,15 +1322,15 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev)
> {
> struct virtio_hw *hw = eth_dev->data->dev_private;
>
> - /* workarount for packed vqs which don't support mrg_rxbuf at this point */
> - if (vtpci_packed_queue(hw) && vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) {
> - eth_dev->rx_pkt_burst = &virtio_recv_pkts_packed;
> - } else if (hw->use_simple_rx) {
> + if (hw->use_simple_rx) {
> PMD_INIT_LOG(INFO, "virtio: using simple Rx path on port %u",
> eth_dev->data->port_id);
> eth_dev->rx_pkt_burst = virtio_recv_pkts_vec;
The logic isn't right here. It means when hw->use_simple_rx
is true, virtio_recv_pkts_vec() will be selected as the rx
function for packed ring. But virtio_recv_pkts_vec() doesn't
support packed ring now.
> } else if (vtpci_packed_queue(hw)) {
> - eth_dev->rx_pkt_burst = &virtio_recv_pkts_packed;
> + if (vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF))
> + eth_dev->rx_pkt_burst = &virtio_recv_mergeable_pkts;
> + else
> + eth_dev->rx_pkt_burst = &virtio_recv_pkts_packed;
> } else if (vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) {
> PMD_INIT_LOG(INFO,
> "virtio: using mergeable buffer Rx path on port %u",
[...]
More information about the dev
mailing list