From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH v3 18/21] net/virtio: add support for mergeable buffers with packed virtqueues Date: Sun, 8 Apr 2018 14:02:46 +0800 Message-ID: <20180408060246.4nphbb2uuzmmio2u@debian> References: <20180405101031.26468-1-jfreimann@redhat.com> <20180405101031.26468-19-jfreimann@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: dev@dpdk.org, yliu@fridaylinux.org, maxime.coquelin@redhat.com, mst@redhat.com To: Jens Freimann Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 0EF9D1BB1C for ; Sun, 8 Apr 2018 08:04:49 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20180405101031.26468-19-jfreimann@redhat.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > --- > 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", [...]