From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 9D74D4CB5 for ; Mon, 17 Dec 2018 17:35:26 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2B9D81254; Mon, 17 Dec 2018 16:35:25 +0000 (UTC) Received: from [10.36.112.10] (unknown [10.36.112.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 870C418BB8; Mon, 17 Dec 2018 16:35:21 +0000 (UTC) To: Jens Freimann , dev@dpdk.org Cc: tiwei.bie@intel.com, Gavin.Hu@arm.com References: <20181214155916.1142-1-jfreimann@redhat.com> <20181214155916.1142-6-jfreimann@redhat.com> From: Maxime Coquelin Message-ID: <66061ea8-a880-974e-9236-f0c60bf49e2c@redhat.com> Date: Mon, 17 Dec 2018 17:35:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181214155916.1142-6-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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 17 Dec 2018 16:35:26 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v13 05/10] 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: Mon, 17 Dec 2018 16:35:27 -0000 On 12/14/18 4:59 PM, Jens Freimann wrote: > This implements the transmit path for devices with > support for packed virtqueues. > > Signed-off-by: Jens Freiman > Signed-off-by: Tiwei Bie > --- > drivers/net/virtio/virtio_ethdev.c | 57 ++++--- > drivers/net/virtio/virtio_ethdev.h | 2 + > drivers/net/virtio/virtio_rxtx.c | 236 ++++++++++++++++++++++++++++- > drivers/net/virtio/virtqueue.h | 20 ++- > 4 files changed, 293 insertions(+), 22 deletions(-) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index e6ba1282b..9f1b72e56 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -390,6 +390,9 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx) > if (vtpci_packed_queue(hw)) { > vq->avail_wrap_counter = 1; > vq->used_wrap_counter = 1; > + vq->avail_used_flags = > + VRING_DESC_F_AVAIL(vq->avail_wrap_counter) | > + VRING_DESC_F_USED(!vq->avail_wrap_counter); > } > > /* > @@ -497,17 +500,26 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx) > memset(txr, 0, vq_size * sizeof(*txr)); > for (i = 0; i < vq_size; i++) { > struct vring_desc *start_dp = txr[i].tx_indir; > - > - vring_desc_init_split(start_dp, > - RTE_DIM(txr[i].tx_indir)); > + struct vring_packed_desc *start_dp_packed = > + txr[i].tx_indir_pq; > > /* first indirect descriptor is always the tx header */ > - start_dp->addr = txvq->virtio_net_hdr_mem > - + i * sizeof(*txr) > - + offsetof(struct virtio_tx_region, tx_hdr); > - > - start_dp->len = hw->vtnet_hdr_size; > - start_dp->flags = VRING_DESC_F_NEXT; > + if (vtpci_packed_queue(hw)) { > + start_dp_packed->addr = txvq->virtio_net_hdr_mem > + + i * sizeof(*txr) > + + offsetof(struct virtio_tx_region, > + tx_hdr); > + start_dp_packed->len = hw->vtnet_hdr_size; > + } else { > + vring_desc_init_split(start_dp, > + RTE_DIM(txr[i].tx_indir)); > + start_dp->addr = txvq->virtio_net_hdr_mem > + + i * sizeof(*txr) > + + offsetof(struct virtio_tx_region, > + tx_hdr); > + start_dp->len = hw->vtnet_hdr_size; > + start_dp->flags = VRING_DESC_F_NEXT; > + } > } > } > > @@ -1336,6 +1348,23 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev) > { > struct virtio_hw *hw = eth_dev->data->dev_private; > > + if (vtpci_packed_queue(hw)) { > + PMD_INIT_LOG(INFO, > + "virtio: using packed ring standard Tx path on port %u", > + eth_dev->data->port_id); > + eth_dev->tx_pkt_burst = virtio_xmit_pkts_packed; > + } else { > + if (hw->use_inorder_tx) { > + PMD_INIT_LOG(INFO, "virtio: using inorder Tx path on port %u", > + eth_dev->data->port_id); > + eth_dev->tx_pkt_burst = virtio_xmit_pkts_inorder; > + } else { > + PMD_INIT_LOG(INFO, "virtio: using standard Tx path on port %u", > + eth_dev->data->port_id); > + eth_dev->tx_pkt_burst = virtio_xmit_pkts; > + } > + } > + > if (hw->use_simple_rx) { > PMD_INIT_LOG(INFO, "virtio: using simple Rx path on port %u", > eth_dev->data->port_id); > @@ -1356,15 +1385,7 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev) > eth_dev->rx_pkt_burst = &virtio_recv_pkts; > } > > - if (hw->use_inorder_tx) { > - PMD_INIT_LOG(INFO, "virtio: using inorder Tx path on port %u", > - eth_dev->data->port_id); > - eth_dev->tx_pkt_burst = virtio_xmit_pkts_inorder; > - } else { > - PMD_INIT_LOG(INFO, "virtio: using standard Tx path on port %u", > - eth_dev->data->port_id); > - eth_dev->tx_pkt_burst = virtio_xmit_pkts; > - } > + Trailing new line? Apart from that, it looks good to me: Reviewed-by: Maxime coquelin Thanks, Maxime