From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Apr 2018 23:04:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,422,1517904000"; d="scan'208";a="189565465" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.164]) by orsmga004.jf.intel.com with ESMTP; 07 Apr 2018 23:04:47 -0700 Date: Sun, 8 Apr 2018 14:02:46 +0800 From: Tiwei Bie To: Jens Freimann Cc: dev@dpdk.org, yliu@fridaylinux.org, maxime.coquelin@redhat.com, mst@redhat.com 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 Content-Disposition: inline In-Reply-To: <20180405101031.26468-19-jfreimann@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v3 18/21] net/virtio: add support for mergeable buffers with packed virtqueues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 06:04:51 -0000 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", [...]