DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: "Pierre Pfister (ppfister)" <ppfister@cisco.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] virtio: tx with can_push when VERSION_1 is set
Date: Tue, 8 Nov 2016 10:44:34 +0100	[thread overview]
Message-ID: <46762894-5016-f634-c355-77af881685e6@redhat.com> (raw)
In-Reply-To: <82834CFE-767C-41B0-9327-E64B8210E076@cisco.com>

Hi Pierre,

On 11/08/2016 10:31 AM, Pierre Pfister (ppfister) wrote:
> Current virtio driver advertises VERSION_1 support,
> but does not handle device's VERSION_1 support when
> sending packets (it looks for ANY_LAYOUT feature,
> which is absent).
>
> This patch enables 'can_push' in tx path when VERSION_1
> is advertised by the device.
>
> This significantly improves small packets forwarding rate
> towards devices advertising VERSION_1 feature.
I think it depends whether offloading is enabled or not.
If no offloading enabled, I measured significant drop.
Indeed, when no offloading is enabled, the Tx path in Virtio
does not access the virtio header before your patch, as the header is 
memset to zero at device init time.
With your patch, it gets memset to zero at every transmit in the hot
path.

With offloading enabled, it does makes sense though, as the header will
be accessed.

This patch is for v17.02 anyway, and we may provide a way to enable and
disable features at Virtio PMD init time by this release.

Thanks,
Maxime

>
> Signed-off-by: Pierre Pfister <ppfister@cisco.com>
> ---
>  drivers/net/virtio/virtio_rxtx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
> index 724517e..2fe0338 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -925,7 +925,8 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
>                 }
>
>                 /* optimize ring usage */
> -               if (vtpci_with_feature(hw, VIRTIO_F_ANY_LAYOUT) &&
> +               if ((vtpci_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
> +                     vtpci_with_feature(hw, VIRTIO_F_VERSION_1)) &&
>                     rte_mbuf_refcnt_read(txm) == 1 &&
>                     RTE_MBUF_DIRECT(txm) &&
>                     txm->nb_segs == 1 &&
> --
> 2.7.4 (Apple Git-66)
>

  reply	other threads:[~2016-11-08  9:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08  9:31 Pierre Pfister (ppfister)
2016-11-08  9:44 ` Maxime Coquelin [this message]
2016-11-09 12:42   ` Pierre Pfister (ppfister)
2016-11-09 14:42     ` Maxime Coquelin
2016-11-09 14:51     ` Maxime Coquelin
2016-11-22  9:54       ` Pierre Pfister (ppfister)
2016-11-22 13:17         ` Maxime Coquelin
2016-11-30  9:09           ` Pierre Pfister (ppfister)
2016-11-30  9:18             ` [dpdk-dev] [PATCH v2] " Pierre Pfister (ppfister)
2016-11-30 10:19               ` Yuanhan Liu
2016-12-07  9:42               ` Yuanhan Liu

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=46762894-5016-f634-c355-77af881685e6@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ppfister@cisco.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).