From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id F19FDADED for ; Wed, 15 Jun 2016 08:58:49 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 14 Jun 2016 23:58:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,475,1459839600"; d="scan'208";a="1002240496" Received: from unknown (HELO dpdk5.sh.intel.com) ([10.239.129.244]) by fmsmga002.fm.intel.com with ESMTP; 14 Jun 2016 23:58:48 -0700 From: Zhihong Wang To: dev@dpdk.org Cc: bruce.richardson@intel.com, john.mcnamara@intel.com, Zhihong Wang Date: Tue, 14 Jun 2016 19:53:17 -0400 Message-Id: <1465948397-142613-1-git-send-email-zhihong.wang@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1461210924-104947-1-git-send-email-zhihong.wang@intel.com> References: <1461210924-104947-1-git-send-email-zhihong.wang@intel.com> Subject: [dpdk-dev] [PATCH v2] 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: , X-List-Received-Date: Wed, 15 Jun 2016 06:58:50 -0000 This patch explains all the versions of current virtio pmd implementation, what's the difference, and how to choose the right version. -------------- Changes in v2: 1. Changes on format and few descriptions. Signed-off-by: Zhihong Wang --- doc/guides/nics/virtio.rst | 64 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst index 06ca433..a4fef89 100644 --- a/doc/guides/nics/virtio.rst +++ b/doc/guides/nics/virtio.rst @@ -73,7 +73,7 @@ In this release, the virtio PMD driver provides the basic functionality of packe * It supports multicast packets and promiscuous mode. -* The descriptor number for the RX/TX queue is hard-coded to be 256 by qemu. +* The descriptor number for the Rx/Tx queue is hard-coded to be 256 by qemu. If given a different descriptor number by the upper application, the virtio PMD generates a warning and fall back to the hard-coded value. @@ -163,8 +163,8 @@ Host2VM communication example which means received packets come from vEth0, and transmitted packets is sent to vEth0. #. In the guest, bind the virtio device to the uio_pci_generic kernel module and start the forwarding application. - When the virtio port in guest bursts rx, it is getting packets from the raw socket's receive queue. - When the virtio port bursts tx, it is sending packet to the tx_q. + When the virtio port in guest bursts Rx, it is getting packets from the raw socket's receive queue. + When the virtio port bursts Tx, it is sending packet to the tx_q. .. code-block:: console @@ -183,7 +183,7 @@ Host2VM communication example The packet reception and transmission flow path is: - IXIA packet generator->82599 PF->KNI rx queue->KNI raw socket queue->Guest VM virtio port 0 rx burst->Guest VM virtio port 0 tx burst-> KNI tx queue->82599 PF-> IXIA packet generator + IXIA packet generator->82599 PF->KNI Rx queue->KNI raw socket queue->Guest VM virtio port 0 Rx burst->Guest VM virtio port 0 Tx burst-> KNI Tx queue->82599 PF-> IXIA packet generator Virtio with qemu virtio Back End -------------------------------- @@ -206,8 +206,60 @@ Virtio with qemu virtio Back End In this example, the packet reception flow path is: - IXIA packet generator->82599 PF->Linux Bridge->TAP0's socket queue-> Guest VM virtio port 0 rx burst-> Guest VM 82599 VF port1 tx burst-> IXIA packet generator + IXIA packet generator->82599 PF->Linux Bridge->TAP0's socket queue-> Guest VM virtio port 0 Rx burst-> Guest VM 82599 VF port1 Tx burst-> IXIA packet generator 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 + 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 buffer support. + +#. ``virtio_recv_mergeable_pkts``: + Regular version with mergeable Rx buffer support. + +#. ``virtio_recv_pkts_vec``: + Simple version without mergeable Rx buffer support, also fixes the available ring indexes and uses vector instructions to optimize performance. + +Tx functions: + +#. ``virtio_xmit_pkts``: + Regular version. + +#. ``virtio_xmit_pkts_simple``: + Simple version fixes the available ring indexes 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 the 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 of using the simple version of the virtio poll mode driver in ``testpmd``:: + + testpmd -c 0x7 -n 4 -- -i --txqflags=0xF01 --rxq=1 --txq=1 --nb-cores=1 -- 2.5.0