DPDK patches and discussions
 help / color / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Yinan Wang <yinan.wang@intel.com>,
	Tiwei Bie <tiwei.bie@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [dpdk-dev] [PATCH v6] doc: clarify virtio PMD path selection
Date: Thu, 28 Nov 2019 15:30:21 +0100
Message-ID: <20191128143021.20928-1-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20191127151952.7770-1-yinan.wang@intel.com>

From: Yinan Wang <yinan.wang@intel.com>

Add virtio paths selection and usage introduction for better
virtio usability.

Signed-off-by: Yinan Wang <yinan.wang@intel.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
v6:
 - Move to Virtio NIC documentation

 doc/guides/nics/virtio.rst | 124 +++++++++++++++++++++++++++++++++++++
 1 file changed, 124 insertions(+)

diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst
index fb378a4b94..d1f5fb8986 100644
--- a/doc/guides/nics/virtio.rst
+++ b/doc/guides/nics/virtio.rst
@@ -402,3 +402,127 @@ Below devargs are supported by the virtio-user vdev:
 
     It is used to enable virtio device packed virtqueue feature.
     (Default: 0 (disabled))
+
+Virtio paths Selection and Usage
+--------------------------------
+
+Logically virtio-PMD has 9 paths based on the combination of virtio features
+(Rx mergeable, In-order, Packed virtqueue), below is an introduction of these
+features:
+
+*   `Rx mergeable <https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/
+    virtio-v1.1-cs01.html#x1-2140004>`_: With this feature negotiated, device
+    can receive large packets by combining individual descriptors.
+*   `In-order <https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/
+    virtio-v1.1-cs01.html#x1-690008>`_: Some devices always use descriptors
+    in the same order in which they have been made available, these
+    devices can offer the VIRTIO_F_IN_ORDER feature. With this feature negotiated,
+    driver will use descriptors in order.
+*   `Packed virtqueue <https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/
+    virtio-v1.1-cs01.html#x1-610007>`_: The structure of packed virtqueue is
+    different from split virtqueue, split virtqueue is composed of available ring,
+    used ring and descriptor table, while packed virtqueue is composed of descriptor
+    ring, driver event suppression and device event suppression. The idea behind
+    this is to improve performance by avoiding cache misses and make it easier
+    for hardware to implement.
+
+Virtio paths Selection
+~~~~~~~~~~~~~~~~~~~~~~
+
+If packed virtqueue is not negotiated, below split virtqueue paths will be selected
+according to below configuration:
+
+#. Split virtqueue mergeable path: If Rx mergeable is negotiated, in-order feature is
+   not negotiated, this path will be selected.
+#. Split virtqueue non-mergeable path: If Rx mergeable and in-order feature are not
+   negotiated, also Rx offload(s) are requested, this path will be selected.
+#. Split virtqueue in-order mergeable path: If Rx mergeable and in-order feature are
+   both negotiated, this path will be selected.
+#. Split virtqueue in-order non-mergeable path: If in-order feature is negotiated and
+   Rx mergeable is not negotiated, this path will be selected.
+#. Split virtqueue vectorized Rx path: If Rx mergeable is disabled and no Rx offload
+   requested, this path will be selected.
+
+If packed virtqueue is negotiated, below packed virtqueue paths will be selected
+according to below configuration:
+
+#. Packed virtqueue mergeable path: If Rx mergeable is negotiated, in-order feature
+   is not negotiated, this path will be selected.
+#. Packed virtqueue non-mergeable path: If Rx mergeable and in-order feature are not
+   negotiated, this path will be selected.
+#. Packed virtqueue in-order mergeable path: If in-order and Rx mergeable feature are
+   both negotiated, this path will be selected.
+#. Packed virtqueue in-order non-mergeable path: If in-order feature is negotiated and
+   Rx mergeable is not negotiated, this path will be selected.
+
+Rx/Tx callbacks of each Virtio path
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Refer to above description, virtio path and corresponding Rx/Tx callbacks will
+be selected automatically. Rx callbacks and Tx callbacks for each virtio path
+are shown in below table:
+
+.. table:: Virtio Paths and Callbacks
+
+   ============================================ ================================= ========================
+                 Virtio paths                            Rx callbacks                   Tx callbacks
+   ============================================ ================================= ========================
+   Split virtqueue mergeable path               virtio_recv_mergeable_pkts        virtio_xmit_pkts
+   Split virtqueue non-mergeable path           virtio_recv_pkts                  virtio_xmit_pkts
+   Split virtqueue in-order mergeable path      virtio_recv_pkts_inorder          virtio_xmit_pkts_inorder
+   Split virtqueue in-order non-mergeable path  virtio_recv_pkts_inorder          virtio_xmit_pkts_inorder
+   Split virtqueue vectorized Rx path           virtio_recv_pkts_vec              virtio_xmit_pkts
+   Packed virtqueue mergeable path              virtio_recv_mergeable_pkts_packed virtio_xmit_pkts_packed
+   Packed virtqueue non-meregable path          virtio_recv_pkts_packed           virtio_xmit_pkts_packed
+   Packed virtqueue in-order mergeable path     virtio_recv_mergeable_pkts_packed virtio_xmit_pkts_packed
+   Packed virtqueue in-order non-mergeable path virtio_recv_pkts_packed           virtio_xmit_pkts_packed
+   ============================================ ================================= ========================
+
+Virtio paths Support Status from Release to Release
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Virtio feature implementation:
+
+*   In-order feature is supported since DPDK 18.08 by adding new Rx/Tx callbacks
+    ``virtio_recv_pkts_inorder`` and ``virtio_xmit_pkts_inorder``.
+*   Packed virtqueue is supported since DPDK 19.02 by adding new Rx/Tx callbacks
+    ``virtio_recv_pkts_packed`` , ``virtio_recv_mergeable_pkts_packed`` and
+    ``virtio_xmit_pkts_packed``.
+
+All virtio paths support status are shown in below table:
+
+.. table:: Virtio Paths and Releases
+
+   ============================================ ============= ============= =============
+                  Virtio paths                  16.11 ~ 18.05 18.08 ~ 18.11 19.02 ~ 19.11
+   ============================================ ============= ============= =============
+   Split virtqueue mergeable path                     Y             Y             Y
+   Split virtqueue non-mergeable path                 Y             Y             Y
+   Split virtqueue vectorized Rx path                 Y             Y             Y
+   Split virtqueue simple Tx path                     Y             N             N
+   Split virtqueue in-order mergeable path                          Y             Y
+   Split virtqueue in-order non-mergeable path                      Y             Y
+   Packed virtqueue mergeable path                                                Y
+   Packed virtqueue non-mergeable path                                            Y
+   Packed virtqueue in-order mergeable path                                       Y
+   Packed virtqueue in-order non-mergeable path                                   Y
+   ============================================ ============= ============= =============
+
+QEMU Support Status
+~~~~~~~~~~~~~~~~~~~
+
+*   Qemu now supports three paths of split virtqueue: Split virtqueue mergeable path,
+    Split virtqueue non-mergeable path, Split virtqueue vectorized Rx path.
+*   Since qemu 4.2.0, Packed virtqueue mergeable path and Packed virtqueue non-mergeable
+    path can be supported.
+
+How to Debug
+~~~~~~~~~~~~
+
+If you meet performance drop or some other issues after upgrading the driver
+or configuration, below steps can help you identify which path you selected and
+root cause faster.
+
+#. Run vhost/virtio test case;
+#. Run "perf top" and check virtio Rx/Tx callback names;
+#. Identify which virtio path is selected refer to above table.
-- 
2.21.0


  parent reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 10:29 [dpdk-dev] [PATCH] " Yinan
2019-11-18  2:23 ` Stephen Hemminger
2019-11-25 15:49   ` Wang, Yinan
2019-11-18  9:55 ` Gavin Hu (Arm Technology China)
2019-11-26 16:08 ` [dpdk-dev] [PATCH v4] " Yinan
2019-11-27  2:43   ` Tiwei Bie
2019-11-26 21:30 ` [dpdk-dev] [PATCH] " Thomas Monjalon
2019-11-27 15:19 ` [dpdk-dev] [PATCH v5] " Yinan
2019-11-27  6:38   ` Tiwei Bie
2019-11-27  8:41   ` Maxime Coquelin
2019-11-28  0:14   ` Thomas Monjalon
2019-11-28 14:30   ` Maxime Coquelin [this message]
2019-11-28 18:17     ` [dpdk-dev] [PATCH v6] " Thomas Monjalon

Reply instructions:

You may reply publically 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=20191128143021.20928-1-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=tiwei.bie@intel.com \
    --cc=yinan.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

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox