[dpdk-dev,v4,3/3] doc: add details on ethdev offloads API

Message ID 6b4402ed833f9edb53c907e77f38130434d8b40a.1505630554.git.shahafs@mellanox.com (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Shahaf Shuler Sept. 17, 2017, 6:54 a.m. UTC
  Add the programmers guide details on the new offloads API introduced
by commits:

commit f649472cad9d ("ethdev: introduce Rx queue offloads API")
commit ecb46b66cda5 ("ethdev: introduce Tx queue offloads API")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 doc/guides/prog_guide/poll_mode_drv.rst | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
  

Comments

Andrew Rybchenko Sept. 18, 2017, 7:51 a.m. UTC | #1
On 09/17/2017 09:54 AM, Shahaf Shuler wrote:
> Add the programmers guide details on the new offloads API introduced
> by commits:
>
> commit f649472cad9d ("ethdev: introduce Rx queue offloads API")
> commit ecb46b66cda5 ("ethdev: introduce Tx queue offloads API")
>
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>   doc/guides/prog_guide/poll_mode_drv.rst | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
>
> diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst
> index 8922e39f4..03092ae98 100644
> --- a/doc/guides/prog_guide/poll_mode_drv.rst
> +++ b/doc/guides/prog_guide/poll_mode_drv.rst

<...>

> +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 shell return with error.

Typo "shell"
  
John McNamara Sept. 18, 2017, 1:40 p.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Sunday, September 17, 2017 7:55 AM
> To: thomas@monjalon.net; jerin.jacob@caviumnetworks.com; Ananyev,
> Konstantin <konstantin.ananyev@intel.com>; arybchenko@solarflare.com
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v4 3/3] doc: add details on ethdev offloads API
> 
> Add the programmers guide details on the new offloads API introduced by
> commits:
> 
> commit f649472cad9d ("ethdev: introduce Rx queue offloads API") commit
> ecb46b66cda5 ("ethdev: introduce Tx queue offloads API")
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>


> ...

> +Per-Port and Per-Queue Offloads
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +On DPDK 17.11, a new offloads API was introduced.

It is best to omit this line.


There are a number of small grammatical errors in the rest of the text.
Probably something like this would be better:

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``.
In such cases it is not required to set other bitfield offloads in the ``rxmode`` struct.
For an application to use the Rx offloads API it should set the ``ignore_offload_bitfield`` bit in the ``rte_eth_rxmode`` struct.

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

Patch

diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst
index 8922e39f4..03092ae98 100644
--- a/doc/guides/prog_guide/poll_mode_drv.rst
+++ b/doc/guides/prog_guide/poll_mode_drv.rst
@@ -310,6 +310,23 @@  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
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+On DPDK 17.11, a new offloads API was introduced.
+
+In the new API, offloads are divided into per-port and per-queue offloads.
+The different offloads capabilities can be queried by ``rte_eth_dev_info_get()``. Offloads which is supported 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 on ``rte_eth_dev_configure``. Per-queue offload configuration is set on ``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 shell return with 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 application to use this Tx offloads API it should set the ``ETH_TXQ_FLAGS_IGNORE`` flag on ``txq_flags`` field located in ``rte_eth_txconf`` struct. On such case it is not required to set other flags on ``txq_flags``.
+For application to use this Rx offloads API it should set the ``ignore_offload_bitfield`` bit in ``rte_eth_rxmode`` struct. On such case it is not required to set other bitfield offloads on ``rxmode`` struct.
+
 Poll Mode Driver API
 --------------------