DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] doc: virtio pmd versions
@ 2016-04-21  3:55 Zhihong Wang
  2016-06-09 12:35 ` Mcnamara, John
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Zhihong Wang @ 2016-04-21  3:55 UTC (permalink / raw)
  To: dev; +Cc: Zhihong Wang

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 <zhihong.wang@intel.com>
---
 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
+
-- 
2.5.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: virtio pmd versions
  2016-04-21  3:55 [dpdk-dev] [PATCH] doc: virtio pmd versions Zhihong Wang
@ 2016-06-09 12:35 ` Mcnamara, John
  2016-06-09 12:52   ` Richardson, Bruce
  2016-06-14 23:53 ` [dpdk-dev] [PATCH v2] " Zhihong Wang
  2016-07-01  3:28 ` [dpdk-dev] [PATCH v3] doc: virtio PMD Rx/Tx callbacks Zhihong Wang
  2 siblings, 1 reply; 11+ messages in thread
From: Mcnamara, John @ 2016-06-09 12:35 UTC (permalink / raw)
  To: Wang, Zhihong, dev; +Cc: Wang, Zhihong

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhihong Wang
> Sent: Thursday, April 21, 2016 4:55 AM
> To: dev@dpdk.org
> Cc: Wang, Zhihong <zhihong.wang@intel.com>
> Subject: [dpdk-dev] [PATCH] doc: virtio pmd versions
> 
> This patch explains all the versions of current virtio pmd implementation,
> what's the difference, and how to choose the right version.

Hi,

Thanks for the clarification docs. That should hopefully answer a frequently
asked question.

Some minor comments below.


> +
> +Virtio PMD Versions
> +-------------------
> +
> +Virtio driver has 3 versions of rx functions and 2 versions of tx
> functions.

In some places RX/TX is used and in some rx/tx. I would suggest the
uppercase versions throughout.



> +
> +RX functions:
> +
> +*   ``virtio_recv_pkts``:
> +
> +    Regular version without mergeable rx buffers support


Since these could be a numbered list I would suggest using "#." (numbered
list) instead of "*" (bullet list). Also it would be better without a blank
line between the name and the definition so that they appear on the same
line in the generated docs.


> +
> +    Simple version without mergeable rx buffers support, also fixes the
> + avail ring and uses vector instructions to optimize performance

s/avail/available in 2 places.

Also should that be "available ring size" or "number of available rings"
or something else?


> +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


The code/commandline needs to be indented 3-4 spaces to be rendered
correctly. I'd also suggest omitting "./x86_64-native-linuxapp-gcc/app/" and
just using "testpmd" since that commandline is target dependent. The command
would also fit on one line like that.

Thanks,

John.
-- 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: virtio pmd versions
  2016-06-09 12:35 ` Mcnamara, John
@ 2016-06-09 12:52   ` Richardson, Bruce
  2016-06-09 12:56     ` Mcnamara, John
  0 siblings, 1 reply; 11+ messages in thread
From: Richardson, Bruce @ 2016-06-09 12:52 UTC (permalink / raw)
  To: Mcnamara, John, Wang, Zhihong, dev; +Cc: Wang, Zhihong

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John
<snip>
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhihong Wang
<snip> 
> > +
> > +Virtio PMD Versions
> > +-------------------
> > +
> > +Virtio driver has 3 versions of rx functions and 2 versions of tx
> > functions.
> 
> In some places RX/TX is used and in some rx/tx. I would suggest the
> uppercase versions throughout.
> 

In the commit logs, the only valid contractions allowed by the check-git-log.sh script are Rx and Tx

bad=$(echo "$headlines" | grep -E --color=always \
        -e '\<(rx|tx|RX|TX)\>' \
	 ....

I would therefore suggest we follow the same rules for the docs for consistency.

/Bruce

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: virtio pmd versions
  2016-06-09 12:52   ` Richardson, Bruce
@ 2016-06-09 12:56     ` Mcnamara, John
  2016-06-15  6:59       ` Wang, Zhihong
  0 siblings, 1 reply; 11+ messages in thread
From: Mcnamara, John @ 2016-06-09 12:56 UTC (permalink / raw)
  To: Richardson, Bruce, Wang, Zhihong, dev; +Cc: Wang, Zhihong

> -----Original Message-----
> From: Richardson, Bruce
> Sent: Thursday, June 9, 2016 1:53 PM
> To: Mcnamara, John <john.mcnamara@intel.com>; Wang, Zhihong
> <zhihong.wang@intel.com>; dev@dpdk.org
> Cc: Wang, Zhihong <zhihong.wang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] doc: virtio pmd versions
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John
> <snip>
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhihong Wang
> <snip>
> > > +
> > > +Virtio PMD Versions
> > > +-------------------
> > > +
> > > +Virtio driver has 3 versions of rx functions and 2 versions of tx
> > > functions.
> >
> > In some places RX/TX is used and in some rx/tx. I would suggest the
> > uppercase versions throughout.
> >
> 
> In the commit logs, the only valid contractions allowed by the check-git-
> log.sh script are Rx and Tx
> 
> bad=$(echo "$headlines" | grep -E --color=always \
>         -e '\<(rx|tx|RX|TX)\>' \
> 	 ....
> 
> I would therefore suggest we follow the same rules for the docs for
> consistency.

Hi,

I don't mind what it is once we have consistency, so Rx/Tx is fine. Zhihong, 
please note.

John

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] [PATCH v2] doc: virtio pmd versions
  2016-04-21  3:55 [dpdk-dev] [PATCH] doc: virtio pmd versions Zhihong Wang
  2016-06-09 12:35 ` Mcnamara, John
@ 2016-06-14 23:53 ` Zhihong Wang
  2016-06-24 16:03   ` Mcnamara, John
  2016-06-29  3:27   ` Yuanhan Liu
  2016-07-01  3:28 ` [dpdk-dev] [PATCH v3] doc: virtio PMD Rx/Tx callbacks Zhihong Wang
  2 siblings, 2 replies; 11+ messages in thread
From: Zhihong Wang @ 2016-06-14 23:53 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, john.mcnamara, Zhihong Wang

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 <zhihong.wang@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: virtio pmd versions
  2016-06-09 12:56     ` Mcnamara, John
@ 2016-06-15  6:59       ` Wang, Zhihong
  0 siblings, 0 replies; 11+ messages in thread
From: Wang, Zhihong @ 2016-06-15  6:59 UTC (permalink / raw)
  To: Mcnamara, John, Richardson, Bruce, dev



> -----Original Message-----
> From: Mcnamara, John
> Sent: Thursday, June 9, 2016 8:56 PM
> To: Richardson, Bruce <bruce.richardson@intel.com>; Wang, Zhihong
> <zhihong.wang@intel.com>; dev@dpdk.org
> Cc: Wang, Zhihong <zhihong.wang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] doc: virtio pmd versions
> 
> > -----Original Message-----
> > From: Richardson, Bruce
> > Sent: Thursday, June 9, 2016 1:53 PM
> > To: Mcnamara, John <john.mcnamara@intel.com>; Wang, Zhihong
> > <zhihong.wang@intel.com>; dev@dpdk.org
> > Cc: Wang, Zhihong <zhihong.wang@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] doc: virtio pmd versions
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John
> > <snip>
> > >
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhihong Wang
> > <snip>
> > > > +
> > > > +Virtio PMD Versions
> > > > +-------------------
> > > > +
> > > > +Virtio driver has 3 versions of rx functions and 2 versions of tx
> > > > functions.
> > >
> > > In some places RX/TX is used and in some rx/tx. I would suggest the
> > > uppercase versions throughout.
> > >
> >
> > In the commit logs, the only valid contractions allowed by the check-git-
> > log.sh script are Rx and Tx
> >
> > bad=$(echo "$headlines" | grep -E --color=always \
> >         -e '\<(rx|tx|RX|TX)\>' \
> > 	 ....
> >
> > I would therefore suggest we follow the same rules for the docs for
> > consistency.
> 
> Hi,
> 
> I don't mind what it is once we have consistency, so Rx/Tx is fine. Zhihong,
> please note.

Thank you John and Bruce!
V2 has been sent, please take a look.

> 
> John
> 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v2] doc: virtio pmd versions
  2016-06-14 23:53 ` [dpdk-dev] [PATCH v2] " Zhihong Wang
@ 2016-06-24 16:03   ` Mcnamara, John
  2016-06-29  3:27   ` Yuanhan Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Mcnamara, John @ 2016-06-24 16:03 UTC (permalink / raw)
  To: Wang, Zhihong, dev; +Cc: Richardson, Bruce

> -----Original Message-----
> From: Wang, Zhihong
> Sent: Wednesday, June 15, 2016 12:53 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Mcnamara, John
> <john.mcnamara@intel.com>; Wang, Zhihong <zhihong.wang@intel.com>
> Subject: [PATCH v2] doc: virtio pmd versions
> 
> 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 <zhihong.wang@intel.com>


Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v2] doc: virtio pmd versions
  2016-06-14 23:53 ` [dpdk-dev] [PATCH v2] " Zhihong Wang
  2016-06-24 16:03   ` Mcnamara, John
@ 2016-06-29  3:27   ` Yuanhan Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Yuanhan Liu @ 2016-06-29  3:27 UTC (permalink / raw)
  To: Zhihong Wang; +Cc: dev, bruce.richardson, john.mcnamara

On Tue, Jun 14, 2016 at 07:53:17PM -0400, Zhihong Wang wrote:
> 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.

Change log should go ...
> 
> 
> Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
> ---

here..

>  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
> +-------------------

Using "versions" here is a bit confusing to me, especially virtio PMD
supports spec version 0.95 and 1.0. Apparently, that's not what you
are talking about, virtio pmd Rx/Tx callbacks is.

So, something like "Virtio PMD Rx/Tx callbacks" is what I would suggest.

> +
> +Virtio driver has 3 versions of Rx functions and 2 versions of Tx functions.

And I will avoid using "versions".

> +
> +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.

Just like coding and writing commit log, don't write long lines over 80
chars here.

Also I will use "vector" instead of "simple" here, as "vector" is more
easier to understand.

> +
> +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``.
> +

This paragraph says that vector Rx/Tx will be enabled when 0xf01 txq
flags is set.
> +
> +The simple version will only be enabled when:
> +
> +*   Mergeable Rx buffers is disabled.
> +
> +*   Single segment is specified.
> +
> +*   No offload support is needed.

However, you are making another statement that vector Rx/Tx will be used
when ....

That's confusing.

I'd combine the two together, to something like below:

    Vector Rx/Tx callbacks will be used when:
    
    * ``txq_flags`` is set to 0xf01, which implies
    
      * No multiple segments
      * No offload support
    
    * Mergeable Rx buffers is disabled.


	--yliu
> +
> +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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] [PATCH v3] doc: virtio PMD Rx/Tx callbacks
  2016-04-21  3:55 [dpdk-dev] [PATCH] doc: virtio pmd versions Zhihong Wang
  2016-06-09 12:35 ` Mcnamara, John
  2016-06-14 23:53 ` [dpdk-dev] [PATCH v2] " Zhihong Wang
@ 2016-07-01  3:28 ` Zhihong Wang
  2016-07-04  2:56   ` Yuanhan Liu
  2 siblings, 1 reply; 11+ messages in thread
From: Zhihong Wang @ 2016-07-01  3:28 UTC (permalink / raw)
  To: dev; +Cc: yuanhan.liu, bruce.richardson, john.mcnamara, Zhihong Wang

This patch explains current virtio PMD Rx/Tx callbacks, to help understand
what's the difference, and how to enable the right ones.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>

--------------
Changes in v3:

   1. Rephrase for clearer description.

--------------
Changes in v2:

   1. Changes on format and few descriptions.

---
 doc/guides/nics/virtio.rst | 75 ++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 69 insertions(+), 6 deletions(-)

diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst
index 06ca433..c6335d4 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,9 @@ 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 +184,9 @@ 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 +209,68 @@ 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 Rx/Tx Callbacks
+--------------------------
+
+Virtio driver has 3 Rx callbacks and 2 Tx callbacks.
+
+Rx callbacks:
+
+#. ``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``:
+   Vector version without mergeable Rx buffer support, also fixes the available
+   ring indexes and uses vector instructions to optimize performance.
+
+Tx callbacks:
+
+#. ``virtio_xmit_pkts``:
+   Regular version.
+
+#. ``virtio_xmit_pkts_simple``:
+   Vector version fixes the available ring indexes to optimize performance.
+
+
+By default, the non-vector callbacks 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``.
+
+
+Vector callbacks will be used when:
+
+*   ``txq_flags`` is set to ``VIRTIO_SIMPLE_FLAGS`` (0xF01), which implies:
+
+    *   Single segment is specified.
+
+    *   No offload support is needed.
+
+*   Mergeable Rx buffers is disabled.
+
+The corresponding callbacks are:
+
+*   For Rx: ``virtio_recv_pkts_vec``.
+
+*   For Tx: ``virtio_xmit_pkts_simple``.
+
+
+Example of using the vector 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v3] doc: virtio PMD Rx/Tx callbacks
  2016-07-01  3:28 ` [dpdk-dev] [PATCH v3] doc: virtio PMD Rx/Tx callbacks Zhihong Wang
@ 2016-07-04  2:56   ` Yuanhan Liu
  2016-07-04  3:00     ` Wang, Zhihong
  0 siblings, 1 reply; 11+ messages in thread
From: Yuanhan Liu @ 2016-07-04  2:56 UTC (permalink / raw)
  To: Zhihong Wang; +Cc: dev, bruce.richardson, john.mcnamara

On Thu, Jun 30, 2016 at 11:28:01PM -0400, Zhihong Wang wrote:
> This patch explains current virtio PMD Rx/Tx callbacks, to help understand
> what's the difference, and how to enable the right ones.
> 
> Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
> Acked-by: John McNamara <john.mcnamara@intel.com>

Applied to dpdk-next-virtio.

> --------------
> Changes in v3:

However, this is still wrong. It must start with 3 dashes, ---.

    $ man git am
    
         The patch is expected to be inline, directly following the
         message. Any line that is of the form:
    
         ·   three-dashes and end-of-line, or
    
         ·   a line that begins with "diff -", or
    
         ·   a line that begins with "Index: "
    
         is taken as the beginning of a patch, and the commit log message
         is terminated before the first occurrence of such a line.
    

This is just a note; I have fixed it while apply.

	--yliu

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v3] doc: virtio PMD Rx/Tx callbacks
  2016-07-04  2:56   ` Yuanhan Liu
@ 2016-07-04  3:00     ` Wang, Zhihong
  0 siblings, 0 replies; 11+ messages in thread
From: Wang, Zhihong @ 2016-07-04  3:00 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: dev, Richardson, Bruce, Mcnamara, John



> -----Original Message-----
> From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> Sent: Monday, July 4, 2016 10:57 AM
> To: Wang, Zhihong <zhihong.wang@intel.com>
> Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>; Mcnamara,
> John <john.mcnamara@intel.com>
> Subject: Re: [PATCH v3] doc: virtio PMD Rx/Tx callbacks
> 
> On Thu, Jun 30, 2016 at 11:28:01PM -0400, Zhihong Wang wrote:
> > This patch explains current virtio PMD Rx/Tx callbacks, to help understand
> > what's the difference, and how to enable the right ones.
> >
> > Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
> > Acked-by: John McNamara <john.mcnamara@intel.com>
> 
> Applied to dpdk-next-virtio.
> 
> > --------------
> > Changes in v3:
> 
> However, this is still wrong. It must start with 3 dashes, ---.
> 
>     $ man git am
> 
>          The patch is expected to be inline, directly following the
>          message. Any line that is of the form:
> 
>          *   three-dashes and end-of-line, or
> 
>          *   a line that begins with "diff -", or
> 
>          *   a line that begins with "Index: "
> 
>          is taken as the beginning of a patch, and the commit log message
>          is terminated before the first occurrence of such a line.
> 
> 
> This is just a note; I have fixed it while apply.

Noted. Thanks!

> 
> 	--yliu

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-07-04  3:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-21  3:55 [dpdk-dev] [PATCH] doc: virtio pmd versions Zhihong Wang
2016-06-09 12:35 ` Mcnamara, John
2016-06-09 12:52   ` Richardson, Bruce
2016-06-09 12:56     ` Mcnamara, John
2016-06-15  6:59       ` Wang, Zhihong
2016-06-14 23:53 ` [dpdk-dev] [PATCH v2] " Zhihong Wang
2016-06-24 16:03   ` Mcnamara, John
2016-06-29  3:27   ` Yuanhan Liu
2016-07-01  3:28 ` [dpdk-dev] [PATCH v3] doc: virtio PMD Rx/Tx callbacks Zhihong Wang
2016-07-04  2:56   ` Yuanhan Liu
2016-07-04  3:00     ` Wang, Zhihong

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).