From patchwork Thu Apr 21 03:55:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihong Wang X-Patchwork-Id: 12177 X-Patchwork-Delegate: yuanhan.liu@linux.intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 46C8B1BBE; Thu, 21 Apr 2016 13:00:48 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E949A11D4 for ; Thu, 21 Apr 2016 13:00:46 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 21 Apr 2016 04:00:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,512,1455004800"; d="scan'208";a="789292731" Received: from unknown (HELO dpdk5.sh.intel.com) ([10.239.129.244]) by orsmga003.jf.intel.com with ESMTP; 21 Apr 2016 04:00:38 -0700 From: Zhihong Wang To: dev@dpdk.org Cc: Zhihong Wang Date: Wed, 20 Apr 2016 23:55:24 -0400 Message-Id: <1461210924-104947-1-git-send-email-zhihong.wang@intel.com> X-Mailer: git-send-email 2.5.0 Subject: [dpdk-dev] [PATCH] doc: virtio pmd versions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch explains all the versions of current virtio pmd implementation, what's the difference, and how to choose the right version. Signed-off-by: Zhihong Wang --- doc/guides/nics/virtio.rst | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst index 06ca433..43ba686 100644 --- a/doc/guides/nics/virtio.rst +++ b/doc/guides/nics/virtio.rst @@ -211,3 +211,60 @@ In this example, the packet reception flow path is: The packet transmission flow is: IXIA packet generator-> Guest VM 82599 VF port1 rx burst-> Guest VM virtio port 0 tx burst-> tap -> Linux Bridge->82599 PF-> IXIA packet generator + +Virtio PMD Versions +------------------- + +Virtio driver has 3 versions of rx functions and 2 versions of tx functions. + +RX functions: + +* ``virtio_recv_pkts``: + + Regular version without mergeable rx buffers support + +* ``virtio_recv_mergeable_pkts``: + + Regular version with mergeable rx buffers support + +* ``virtio_recv_pkts_vec``: + + Simple version without mergeable rx buffers support, also fixes the avail ring and uses vector instructions to optimize performance + +TX functions: + +* ``virtio_xmit_pkts``: + + Regular version + +* ``virtio_xmit_pkts_simple``: + + Simple version fixes the avail ring to optimize performance + +By default, the non-vector versions are used: + +* For rx: If mergeable rx buffers is disabled then ``virtio_recv_pkts`` is used; otherwise ``virtio_recv_mergeable_pkts`` + +* For tx: ``virtio_xmit_pkts`` + +Setting ``txq_flags`` to ``VIRTIO_SIMPLE_FLAGS`` (0xf01) enables the simple version of virtio poll mode driver: + +* For rx: ``virtio_recv_pkts_vec`` + +* For tx: ``virtio_xmit_pkts_simple`` + +The simple version will only be enabled when: + +* Mergeable rx buffers is disabled + +* Single segment is specified + +* No offload support is needed + +Example to use the simple version of virtio poll mode driver in testpmd: + +.. code-block:: console + +./x86_64-native-linuxapp-gcc/app/testpmd -c 0x7 -n 4 + -- -i --txqflags=0xf01 --rxq=1 --txq=1 --nb-cores=1 +