[dpdk-dev,v6,4/4] doc: add details on ethdev offloads API

Message ID 44e451f86e4582815767cf75b4e0f01f5cc60b5f.1507104596.git.shahafs@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Shahaf Shuler Oct. 4, 2017, 8:18 a.m. UTC
  Add the programmers guide details on the new offloads API introduced
by commits:

commit 67a1a59b597f ("ethdev: introduce Rx queue offloads API")
commit f883eb32e2d4 ("ethdev: introduce Tx queue offloads API")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Reviewed-by: John McNamara <john.mcnamara@intel.com>
---
 doc/guides/prog_guide/poll_mode_drv.rst | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
  

Comments

John McNamara Oct. 4, 2017, 1:46 p.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Wednesday, October 4, 2017 9:18 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> thomas@monjalon.net; arybchenko@solarflare.com;
> jerin.jacob@caviumnetworks.com; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v6 4/4] doc: add details on ethdev offloads API
> 
> Add the programmers guide details on the new offloads API introduced by
> commits:
> 
> commit 67a1a59b597f ("ethdev: introduce Rx queue offloads API") commit
> f883eb32e2d4 ("ethdev: introduce Tx queue offloads API")
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> Reviewed-by: John McNamara <john.mcnamara@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>
  
Patil, Harish March 15, 2018, 1:58 a.m. UTC | #2
-----Original Message-----
From: dev <dev-bounces@dpdk.org> on behalf of Shahaf Shuler

<shahafs@mellanox.com>
Date: Wednesday, October 4, 2017 at 1:18 AM
To: "konstantin.ananyev@intel.com" <konstantin.ananyev@intel.com>,
"thomas@monjalon.net" <thomas@monjalon.net>, "arybchenko@solarflare.com"
<arybchenko@solarflare.com>, "Jacob,  Jerin"
<Jerin.JacobKollanukkaran@cavium.com>, "ferruh.yigit@intel.com"
<ferruh.yigit@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v6 4/4] doc: add details on ethdev offloads API

>Add the programmers guide details on the new offloads API introduced

>by commits:

>

>commit 67a1a59b597f ("ethdev: introduce Rx queue offloads API")

>commit f883eb32e2d4 ("ethdev: introduce Tx queue offloads API")

>

>Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

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

>---

> doc/guides/prog_guide/poll_mode_drv.rst | 20 ++++++++++++++++++++

> 1 file changed, 20 insertions(+)

>

>diff --git a/doc/guides/prog_guide/poll_mode_drv.rst

>b/doc/guides/prog_guide/poll_mode_drv.rst

>index 8922e39f4..423170997 100644

>--- a/doc/guides/prog_guide/poll_mode_drv.rst

>+++ b/doc/guides/prog_guide/poll_mode_drv.rst

>@@ -310,6 +310,26 @@ exported by each PMD. The list of flags and their

>precise meaning is

> described in the mbuf API documentation and in the in :ref:`Mbuf Library

> <Mbuf_Library>`, section "Meta Information".

> 

>+Per-Port and Per-Queue Offloads

>+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>+

>+In the DPDK offload API, offloads are divided into per-port and

>per-queue offloads.

>+The different offloads capabilities can be queried using

>``rte_eth_dev_info_get()``.

>+Supported offloads can be either per-port or per-queue.

>+

>+Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or

>``DEV_RX_OFFLOAD_*`` flags.

>+Per-port offload configuration is set using ``rte_eth_dev_configure``.

>+Per-queue offload configuration is set using ``rte_eth_rx_queue_setup``

>and ``rte_eth_tx_queue_setup``.

>+To enable per-port offload, the offload should be set on both device

>configuration and queue setup.

>+In case of a mixed configuration the queue setup shall return with an

>error.

>+To enable per-queue offload, the offload can be set only on the queue

>setup.

>+Offloads which are not enabled are disabled by default.

>+

>+For an application to use the Tx offloads API it should set the

>``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in

>``rte_eth_txconf`` struct.

>+In such cases it is not required to set other flags in ``txq_flags``.

>+For an application to use the Rx offloads API it should set the

>``ignore_offload_bitfield`` bit in the ``rte_eth_rxmode`` struct.

>+In such cases it is not required to set other bitfield offloads in the

>``rxmode`` struct.

>+

> Poll Mode Driver API

> --------------------

> 

>-- 

>2.12.0

>

Hi Shahaf,
Have a minor question here.
In the documentation it is stated that:
"To enable per-port offload, the offload should be set on both device
configuration and queue setup.”
Our NIC supports only port-level offloads. So my understanding is that to
enable per-port offload we just have to fill in
rx_offload_capa/tx_offload_capa in dev_infos_get() routine. So I didn’t
understand what is meant by ' both device configuration and queue setup’
here.
Pls let me know.
Thanks.



>
  
Shahaf Shuler March 15, 2018, 6:05 a.m. UTC | #3
Thursday, March 15, 2018 3:58 AM, Patil, Harish:
> >2.12.0

> >

> Hi Shahaf,

> Have a minor question here.

> In the documentation it is stated that:

> "To enable per-port offload, the offload should be set on both device

> configuration and queue setup.”

> Our NIC supports only port-level offloads. So my understanding is that to

> enable per-port offload we just have to fill in

> rx_offload_capa/tx_offload_capa in dev_infos_get() routine. So I didn’t

> understand what is meant by ' both device configuration and queue setup’

> here.

> Pls let me know.

> Thanks.


It means on the [tx]rx_queue_setup the application should set the port offloads also in the queue offloads. This is the API for the application, and there is an ongoing discussion to remove this limitation, see [1].

You may add a routine to verify that (on the queue setup), or ignore completely the queue offloads configuration .

[1] http://dpdk.org/ml/archives/dev/2018-March/092684.html

> 

> 

> 

> >
  

Patch

diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst
index 8922e39f4..423170997 100644
--- a/doc/guides/prog_guide/poll_mode_drv.rst
+++ b/doc/guides/prog_guide/poll_mode_drv.rst
@@ -310,6 +310,26 @@  exported by each PMD. The list of flags and their precise meaning is
 described in the mbuf API documentation and in the in :ref:`Mbuf Library
 <Mbuf_Library>`, section "Meta Information".
 
+Per-Port and Per-Queue Offloads
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In the DPDK offload API, offloads are divided into per-port and per-queue offloads.
+The different offloads capabilities can be queried using ``rte_eth_dev_info_get()``.
+Supported offloads can be either per-port or per-queue.
+
+Offloads are enabled using the existing ``DEV_TX_OFFLOAD_*`` or ``DEV_RX_OFFLOAD_*`` flags.
+Per-port offload configuration is set using ``rte_eth_dev_configure``.
+Per-queue offload configuration is set using ``rte_eth_rx_queue_setup`` and ``rte_eth_tx_queue_setup``.
+To enable per-port offload, the offload should be set on both device configuration and queue setup.
+In case of a mixed configuration the queue setup shall return with an error.
+To enable per-queue offload, the offload can be set only on the queue setup.
+Offloads which are not enabled are disabled by default.
+
+For an application to use the Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag in the ``txq_flags`` field located in ``rte_eth_txconf`` struct.
+In such cases it is not required to set other flags in ``txq_flags``.
+For an application to use the Rx offloads API it should set the ``ignore_offload_bitfield`` bit in the ``rte_eth_rxmode`` struct.
+In such cases it is not required to set other bitfield offloads in the ``rxmode`` struct.
+
 Poll Mode Driver API
 --------------------