DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tiwei Bie <tiwei.bie@intel.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
	Zhihong Wang <zhihong.wang@intel.com>,
	dev@dpdk.org, Dilshod Urazov <Dilshod.Urazov@oktetlabs.ru>,
	stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] net/virtio: add Tx preparation
Date: Wed, 5 Jun 2019 09:41:17 +0800	[thread overview]
Message-ID: <20190605014117.GA20728@___> (raw)
In-Reply-To: <1559587805-1637-1-git-send-email-arybchenko@solarflare.com>

Hi,

Thanks for the patch!

On Mon, Jun 03, 2019 at 07:50:05PM +0100, Andrew Rybchenko wrote:
[...]
>  uint16_t
> +virtio_xmit_pkts_prepare(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts,
> +			uint16_t nb_pkts)
> +{
> +	uint16_t nb_tx;
> +	int error;
> +
> +	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
> +		struct rte_mbuf *m = tx_pkts[nb_tx];
> +
> +#ifdef RTE_LIBRTE_ETHDEV_DEBUG
> +		error = rte_validate_tx_offload(m);
> +		if (unlikely(error)) {
> +			rte_errno = -error;
> +			break;
> +		}
> +#endif
> +
> +		error = rte_net_intel_cksum_prepare(m);
> +		if (unlikely(error)) {
> +			rte_errno = -error;

It's a bit confusing here.
Based on the API doc of rte_eth_tx_prepare():

https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/lib/librte_ethdev/rte_ethdev.h#L4360-L4362

It should set negative value to rte_errno when error happens,
and that's also what some other PMDs do, e.g.:

https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/drivers/net/iavf/iavf_rxtx.c#L1701
https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/drivers/net/iavf/iavf_rxtx.c#L1725
https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/drivers/net/vmxnet3/vmxnet3_rxtx.c#L364

But some PMDs and rte_eth_tx_prepare() itself don't do this:

https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/lib/librte_ethdev/rte_ethdev.h#L4377
https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/lib/librte_ethdev/rte_ethdev.h#L4387


> +			break;
> +		}
> +
> +		if (m->ol_flags & PKT_TX_TCP_SEG)
> +			virtio_tso_fix_cksum(m);
> +	}
> +
> +	return nb_tx;
> +}
> +
> +uint16_t
>  virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,
>  			uint16_t nb_pkts)
>  {
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2019-06-05  1:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 18:50 Andrew Rybchenko
2019-06-05  1:41 ` Tiwei Bie [this message]
2019-06-05  7:28   ` Andrew Rybchenko
2019-06-05  9:37     ` Tiwei Bie
2019-06-16 10:17 ` [dpdk-dev] [PATCH v3 1/2] " Andrew Rybchenko
2019-06-16 10:17   ` [dpdk-dev] [PATCH v3 2/2] net/virtio: move VLAN tag insertion to Tx prepare Andrew Rybchenko
2019-06-17  8:54     ` Tiwei Bie
2019-06-17 11:35       ` Andrew Rybchenko
2019-06-17  8:52   ` [dpdk-dev] [PATCH v3 1/2] net/virtio: add Tx preparation Tiwei Bie
2019-06-17 11:31 ` [dpdk-dev] [PATCH v4 " Andrew Rybchenko
2019-06-17 11:31   ` [dpdk-dev] [PATCH v4 2/2] net/virtio: move VLAN tag insertion to Tx prepare Andrew Rybchenko
2019-06-18  4:42     ` Tiwei Bie
2019-06-20  9:58     ` Maxime Coquelin
2019-06-20  9:58   ` [dpdk-dev] [PATCH v4 1/2] net/virtio: add Tx preparation 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=20190605014117.GA20728@___ \
    --to=tiwei.bie@intel.com \
    --cc=Dilshod.Urazov@oktetlabs.ru \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=zhihong.wang@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).