From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B2C9402291E; Fri, 6 Apr 2018 07:56:13 +0000 (UTC) Received: from [10.36.112.46] (ovpn-112-46.ams2.redhat.com [10.36.112.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED9D110B009F; Fri, 6 Apr 2018 07:56:07 +0000 (UTC) To: Jens Freimann , dev@dpdk.org Cc: tiwei.bie@intel.com, yliu@fridaylinux.org, mst@redhat.com References: <20180405101031.26468-1-jfreimann@redhat.com> <20180405101031.26468-8-jfreimann@redhat.com> From: Maxime Coquelin Message-ID: <00b1cffc-4d0f-30d8-289a-babfdcfa2f7a@redhat.com> Date: Fri, 6 Apr 2018 09:56:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180405101031.26468-8-jfreimann@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 06 Apr 2018 07:56:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 06 Apr 2018 07:56:13 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH v3 07/21] net/virtio: implement transmit path for packed queues 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: Fri, 06 Apr 2018 07:56:14 -0000 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 \