DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Jens Freimann <jfreimann@redhat.com>, dev@dpdk.org
Cc: tiwei.bie@intel.com, Gavin.Hu@arm.com
Subject: Re: [dpdk-dev] [PATCH v13 05/10] net/virtio: implement transmit path for packed queues
Date: Mon, 17 Dec 2018 17:35:19 +0100	[thread overview]
Message-ID: <66061ea8-a880-974e-9236-f0c60bf49e2c@redhat.com> (raw)
In-Reply-To: <20181214155916.1142-6-jfreimann@redhat.com>



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 <jfreimann@redhat.com>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>   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 <maxime.coquelin@redhat.com>

Thanks,
Maxime

  reply	other threads:[~2018-12-17 16:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 15:59 [dpdk-dev] [PATCH v13 00/10] implement packed virtqueues Jens Freimann
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 01/10] net/virtio: add packed virtqueue defines Jens Freimann
2018-12-17 15:45   ` Maxime Coquelin
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 02/10] net/virtio: add packed virtqueue helpers Jens Freimann
2018-12-17 16:09   ` Maxime Coquelin
2018-12-17 16:30   ` Maxime Coquelin
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 03/10] net/virtio: vring init for packed queues Jens Freimann
2018-12-17 16:15   ` Maxime Coquelin
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 04/10] net/virtio: dump packed virtqueue data Jens Freimann
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 05/10] net/virtio: implement transmit path for packed queues Jens Freimann
2018-12-17 16:35   ` Maxime Coquelin [this message]
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 06/10] net/virtio: implement receive " Jens Freimann
2018-12-17 16:46   ` Maxime Coquelin
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 07/10] net/virtio: add virtio send command packed queue support Jens Freimann
2018-12-17 16:48   ` Maxime Coquelin
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 08/10] net/virtio-user: add option to use packed queues Jens Freimann
2018-12-17 16:49   ` Maxime Coquelin
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 09/10] net/virtio-user: fail if q used with packed vq Jens Freimann
2018-12-17 16:52   ` Maxime Coquelin
2018-12-17 19:27     ` Jens Freimann
2018-12-14 15:59 ` [dpdk-dev] [PATCH v13 10/10] net/virtio: enable packed virtqueues by default Jens Freimann
2018-12-17 16:52   ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66061ea8-a880-974e-9236-f0c60bf49e2c@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=Gavin.Hu@arm.com \
    --cc=dev@dpdk.org \
    --cc=jfreimann@redhat.com \
    --cc=tiwei.bie@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).