From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v3 07/21] net/virtio: implement transmit path for packed queues Date: Fri, 6 Apr 2018 09:56:06 +0200 Message-ID: <00b1cffc-4d0f-30d8-289a-babfdcfa2f7a@redhat.com> References: <20180405101031.26468-1-jfreimann@redhat.com> <20180405101031.26468-8-jfreimann@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: tiwei.bie@intel.com, yliu@fridaylinux.org, mst@redhat.com To: Jens Freimann , dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id DDD181CC9B for ; Fri, 6 Apr 2018 09:56:13 +0200 (CEST) In-Reply-To: <20180405101031.26468-8-jfreimann@redhat.com> Content-Language: en-US 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 04/05/2018 12:10 PM, Jens Freimann wrote: > This implements the transmit path for devices with > support for Virtio 1.1. > > Add the feature bit for Virtio 1.1 and enable code to > add buffers to vring and mark descriptors as available. > > This is based on a patch by Yuanhan Liu. > > Signed-off-by: Jens Freiman > --- > drivers/net/virtio/virtio_ethdev.c | 8 ++- > drivers/net/virtio/virtio_ethdev.h | 3 ++ > drivers/net/virtio/virtio_rxtx.c | 102 ++++++++++++++++++++++++++++++++++++- > 3 files changed, 111 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index cccefafe9..089a161ac 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -383,6 +383,8 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx) > vq->hw = hw; > vq->vq_queue_index = vtpci_queue_idx; > vq->vq_nentries = vq_size; > + if (vtpci_packed_queue(hw)) > + vq->vq_ring.avail_wrap_counter = 1; > > /* > * Reserve a memzone for vring elements > @@ -1328,7 +1330,11 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev) > eth_dev->rx_pkt_burst = &virtio_recv_pkts; > } > > - if (hw->use_simple_tx) { > + if (vtpci_packed_queue(hw)) { > + PMD_INIT_LOG(INFO, "virtio: using virtio 1.1 Tx path on port %u", > + eth_dev->data->port_id); > + eth_dev->tx_pkt_burst = virtio_xmit_pkts_packed; > + } else if (hw->use_simple_tx) { > PMD_INIT_LOG(INFO, "virtio: using simple Tx path on port %u", > eth_dev->data->port_id); > eth_dev->tx_pkt_burst = virtio_xmit_pkts_simple; > diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h > index bb40064ea..d457013cb 100644 > --- a/drivers/net/virtio/virtio_ethdev.h > +++ b/drivers/net/virtio/virtio_ethdev.h > @@ -36,6 +36,7 @@ > 1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE | \ > 1u << VIRTIO_RING_F_INDIRECT_DESC | \ > 1ULL << VIRTIO_F_VERSION_1 | \ > + 1ULL << VIRTIO_F_RING_PACKED | \ Should it really advertise VIRTIO_F_RING_PACKED unconditionally, as it is not yet fully supported? (non-pow2, indirect descs, etc...) > 1ULL << VIRTIO_F_IOMMU_PLATFORM) > > #define VIRTIO_PMD_SUPPORTED_GUEST_FEATURES \