diff mbox series

[v2,5/6] doc: add list of supported Field IDs to modify

Message ID 20210324150439.9247-6-akozyrev@nvidia.com (mailing list archive)
State Superseded
Delegated to: Raslan Darawsheh
Headers show
Series modify field action enhancements | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Alexander Kozyrev March 24, 2021, 3:04 p.m. UTC
Include the rte_flow_field_id enumeration into the
documentation to provide the full list of all supported
Field IDs available for the MODIFY_FIELD RTE action.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 doc/guides/prog_guide/rte_flow.rst | 45 ++++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 2 deletions(-)

Comments

Slava Ovsiienko March 30, 2021, 7:10 a.m. UTC | #1
> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Wednesday, March 24, 2021 17:05
> To: dev@dpdk.org
> Cc: Raslan Darawsheh <rasland@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Ori Kam
> <orika@nvidia.com>
> Subject: [PATCH v2 5/6] doc: add list of supported Field IDs to modify
> 
> Include the rte_flow_field_id enumeration into the documentation to
> provide the full list of all supported Field IDs available for the MODIFY_FIELD
> RTE action.
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Ferruh Yigit March 31, 2021, 3:53 p.m. UTC | #2
On 3/24/2021 3:04 PM, Alexander Kozyrev wrote:
> Include the rte_flow_field_id enumeration into the
> documentation to provide the full list of all supported
> Field IDs available for the MODIFY_FIELD RTE action.
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> ---
>   doc/guides/prog_guide/rte_flow.rst | 45 ++++++++++++++++++++++++++++--
>   1 file changed, 43 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 62a57919eb..4265b7bfb8 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -2784,6 +2784,41 @@ can be used as both source and destination fields as set by ``field``.
>   The immediate value ``RTE_FLOW_FIELD_VALUE`` (or a pointer to it
>   ``RTE_FLOW_FIELD_POINTER``) is allowed as a source only.
>   ``RTE_FLOW_FIELD_START`` is used to point to the beginning of a packet.
> +See ``enum rte_flow_field_id`` for the list of supported fields:
> +
> +.. code-block:: c
> +
> +   enum rte_flow_field_id {
> +        RTE_FLOW_FIELD_START = 0,       /**< Start of a packet. */
> +        RTE_FLOW_FIELD_MAC_DST,         /**< Destination MAC Address. */
> +        RTE_FLOW_FIELD_MAC_SRC,         /**< Source MAC Address. */
> +        RTE_FLOW_FIELD_VLAN_TYPE,       /**< 802.1Q Tag Identifier. */
> +        RTE_FLOW_FIELD_VLAN_ID,         /**< 802.1Q VLAN Identifier. */
> +        RTE_FLOW_FIELD_MAC_TYPE,        /**< EtherType. */
> +        RTE_FLOW_FIELD_IPV4_DSCP,       /**< IPv4 DSCP. */
> +        RTE_FLOW_FIELD_IPV4_TTL,        /**< IPv4 Time To Live. */
> +        RTE_FLOW_FIELD_IPV4_SRC,        /**< IPv4 Source Address. */
> +        RTE_FLOW_FIELD_IPV4_DST,        /**< IPv4 Destination Address. */
> +        RTE_FLOW_FIELD_IPV6_DSCP,       /**< IPv6 DSCP. */
> +        RTE_FLOW_FIELD_IPV6_HOPLIMIT,   /**< IPv6 Hop Limit. */
> +        RTE_FLOW_FIELD_IPV6_SRC,        /**< IPv6 Source Address. */
> +        RTE_FLOW_FIELD_IPV6_DST,        /**< IPv6 Destination Address. */
> +        RTE_FLOW_FIELD_TCP_PORT_SRC,    /**< TCP Source Port Number. */
> +        RTE_FLOW_FIELD_TCP_PORT_DST,    /**< TCP Destination Port Number. */
> +        RTE_FLOW_FIELD_TCP_SEQ_NUM,     /**< TCP Sequence Number. */
> +        RTE_FLOW_FIELD_TCP_ACK_NUM,     /**< TCP Acknowledgment Number. */
> +        RTE_FLOW_FIELD_TCP_FLAGS,       /**< TCP Flags. */
> +        RTE_FLOW_FIELD_UDP_PORT_SRC,    /**< UDP Source Port Number. */
> +        RTE_FLOW_FIELD_UDP_PORT_DST,    /**< UDP Destination Port Number. */
> +        RTE_FLOW_FIELD_VXLAN_VNI,       /**< VXLAN Network Identifier. */
> +        RTE_FLOW_FIELD_GENEVE_VNI,      /**< GENEVE Network Identifier. */
> +        RTE_FLOW_FIELD_GTP_TEID,        /**< GTP Tunnel Endpoint Identifier. */
> +        RTE_FLOW_FIELD_TAG,             /**< Tag value. */
> +        RTE_FLOW_FIELD_MARK,            /**< Mark value. */
> +        RTE_FLOW_FIELD_META,            /**< Metadata value. */
> +        RTE_FLOW_FIELD_POINTER,         /**< Memory pointer. */
> +        RTE_FLOW_FIELD_VALUE,           /**< Immediate value. */
> +   };

The code in the documentation proved to be problem in long term, they get out of 
date most of the times. So what do you think to just keep the reference to 
``enum rte_flow_field_id`` but drop the code block?

Dropping the patch in next-net, it can be sent later separately.
Alexander Kozyrev April 8, 2021, 3:20 a.m. UTC | #3
Makes sense, Ferruh, I've send v2 without code snippet. Would you mind to take a look?

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Wednesday, March 31, 2021 11:53
> To: Alexander Kozyrev <akozyrev@nvidia.com>; dev@dpdk.org
> Cc: Raslan Darawsheh <rasland@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Ori Kam
> <orika@nvidia.com>
> Subject: Re: [dpdk-dev] [PATCH v2 5/6] doc: add list of supported Field IDs to
> modify
> 
> On 3/24/2021 3:04 PM, Alexander Kozyrev wrote:
> > Include the rte_flow_field_id enumeration into the
> > documentation to provide the full list of all supported
> > Field IDs available for the MODIFY_FIELD RTE action.
> >
> > Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> > ---
> >   doc/guides/prog_guide/rte_flow.rst | 45
> ++++++++++++++++++++++++++++--
> >   1 file changed, 43 insertions(+), 2 deletions(-)
> >
> > diff --git a/doc/guides/prog_guide/rte_flow.rst
> b/doc/guides/prog_guide/rte_flow.rst
> > index 62a57919eb..4265b7bfb8 100644
> > --- a/doc/guides/prog_guide/rte_flow.rst
> > +++ b/doc/guides/prog_guide/rte_flow.rst
> > @@ -2784,6 +2784,41 @@ can be used as both source and destination
> fields as set by ``field``.
> >   The immediate value ``RTE_FLOW_FIELD_VALUE`` (or a pointer to it
> >   ``RTE_FLOW_FIELD_POINTER``) is allowed as a source only.
> >   ``RTE_FLOW_FIELD_START`` is used to point to the beginning of a packet.
> > +See ``enum rte_flow_field_id`` for the list of supported fields:
> > +
> > +.. code-block:: c
> > +
> > +   enum rte_flow_field_id {
> > +        RTE_FLOW_FIELD_START = 0,       /**< Start of a packet. */
> > +        RTE_FLOW_FIELD_MAC_DST,         /**< Destination MAC Address. */
> > +        RTE_FLOW_FIELD_MAC_SRC,         /**< Source MAC Address. */
> > +        RTE_FLOW_FIELD_VLAN_TYPE,       /**< 802.1Q Tag Identifier. */
> > +        RTE_FLOW_FIELD_VLAN_ID,         /**< 802.1Q VLAN Identifier. */
> > +        RTE_FLOW_FIELD_MAC_TYPE,        /**< EtherType. */
> > +        RTE_FLOW_FIELD_IPV4_DSCP,       /**< IPv4 DSCP. */
> > +        RTE_FLOW_FIELD_IPV4_TTL,        /**< IPv4 Time To Live. */
> > +        RTE_FLOW_FIELD_IPV4_SRC,        /**< IPv4 Source Address. */
> > +        RTE_FLOW_FIELD_IPV4_DST,        /**< IPv4 Destination Address. */
> > +        RTE_FLOW_FIELD_IPV6_DSCP,       /**< IPv6 DSCP. */
> > +        RTE_FLOW_FIELD_IPV6_HOPLIMIT,   /**< IPv6 Hop Limit. */
> > +        RTE_FLOW_FIELD_IPV6_SRC,        /**< IPv6 Source Address. */
> > +        RTE_FLOW_FIELD_IPV6_DST,        /**< IPv6 Destination Address. */
> > +        RTE_FLOW_FIELD_TCP_PORT_SRC,    /**< TCP Source Port Number.
> */
> > +        RTE_FLOW_FIELD_TCP_PORT_DST,    /**< TCP Destination Port
> Number. */
> > +        RTE_FLOW_FIELD_TCP_SEQ_NUM,     /**< TCP Sequence Number. */
> > +        RTE_FLOW_FIELD_TCP_ACK_NUM,     /**< TCP Acknowledgment
> Number. */
> > +        RTE_FLOW_FIELD_TCP_FLAGS,       /**< TCP Flags. */
> > +        RTE_FLOW_FIELD_UDP_PORT_SRC,    /**< UDP Source Port Number.
> */
> > +        RTE_FLOW_FIELD_UDP_PORT_DST,    /**< UDP Destination Port
> Number. */
> > +        RTE_FLOW_FIELD_VXLAN_VNI,       /**< VXLAN Network Identifier. */
> > +        RTE_FLOW_FIELD_GENEVE_VNI,      /**< GENEVE Network Identifier.
> */
> > +        RTE_FLOW_FIELD_GTP_TEID,        /**< GTP Tunnel Endpoint
> Identifier. */
> > +        RTE_FLOW_FIELD_TAG,             /**< Tag value. */
> > +        RTE_FLOW_FIELD_MARK,            /**< Mark value. */
> > +        RTE_FLOW_FIELD_META,            /**< Metadata value. */
> > +        RTE_FLOW_FIELD_POINTER,         /**< Memory pointer. */
> > +        RTE_FLOW_FIELD_VALUE,           /**< Immediate value. */
> > +   };
> 
> The code in the documentation proved to be problem in long term, they get
> out of
> date most of the times. So what do you think to just keep the reference to
> ``enum rte_flow_field_id`` but drop the code block?
> 
> Dropping the patch in next-net, it can be sent later separately.
diff mbox series

Patch

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 62a57919eb..4265b7bfb8 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -2784,6 +2784,41 @@  can be used as both source and destination fields as set by ``field``.
 The immediate value ``RTE_FLOW_FIELD_VALUE`` (or a pointer to it
 ``RTE_FLOW_FIELD_POINTER``) is allowed as a source only.
 ``RTE_FLOW_FIELD_START`` is used to point to the beginning of a packet.
+See ``enum rte_flow_field_id`` for the list of supported fields:
+
+.. code-block:: c
+
+   enum rte_flow_field_id {
+        RTE_FLOW_FIELD_START = 0,       /**< Start of a packet. */
+        RTE_FLOW_FIELD_MAC_DST,         /**< Destination MAC Address. */
+        RTE_FLOW_FIELD_MAC_SRC,         /**< Source MAC Address. */
+        RTE_FLOW_FIELD_VLAN_TYPE,       /**< 802.1Q Tag Identifier. */
+        RTE_FLOW_FIELD_VLAN_ID,         /**< 802.1Q VLAN Identifier. */
+        RTE_FLOW_FIELD_MAC_TYPE,        /**< EtherType. */
+        RTE_FLOW_FIELD_IPV4_DSCP,       /**< IPv4 DSCP. */
+        RTE_FLOW_FIELD_IPV4_TTL,        /**< IPv4 Time To Live. */
+        RTE_FLOW_FIELD_IPV4_SRC,        /**< IPv4 Source Address. */
+        RTE_FLOW_FIELD_IPV4_DST,        /**< IPv4 Destination Address. */
+        RTE_FLOW_FIELD_IPV6_DSCP,       /**< IPv6 DSCP. */
+        RTE_FLOW_FIELD_IPV6_HOPLIMIT,   /**< IPv6 Hop Limit. */
+        RTE_FLOW_FIELD_IPV6_SRC,        /**< IPv6 Source Address. */
+        RTE_FLOW_FIELD_IPV6_DST,        /**< IPv6 Destination Address. */
+        RTE_FLOW_FIELD_TCP_PORT_SRC,    /**< TCP Source Port Number. */
+        RTE_FLOW_FIELD_TCP_PORT_DST,    /**< TCP Destination Port Number. */
+        RTE_FLOW_FIELD_TCP_SEQ_NUM,     /**< TCP Sequence Number. */
+        RTE_FLOW_FIELD_TCP_ACK_NUM,     /**< TCP Acknowledgment Number. */
+        RTE_FLOW_FIELD_TCP_FLAGS,       /**< TCP Flags. */
+        RTE_FLOW_FIELD_UDP_PORT_SRC,    /**< UDP Source Port Number. */
+        RTE_FLOW_FIELD_UDP_PORT_DST,    /**< UDP Destination Port Number. */
+        RTE_FLOW_FIELD_VXLAN_VNI,       /**< VXLAN Network Identifier. */
+        RTE_FLOW_FIELD_GENEVE_VNI,      /**< GENEVE Network Identifier. */
+        RTE_FLOW_FIELD_GTP_TEID,        /**< GTP Tunnel Endpoint Identifier. */
+        RTE_FLOW_FIELD_TAG,             /**< Tag value. */
+        RTE_FLOW_FIELD_MARK,            /**< Mark value. */
+        RTE_FLOW_FIELD_META,            /**< Metadata value. */
+        RTE_FLOW_FIELD_POINTER,         /**< Memory pointer. */
+        RTE_FLOW_FIELD_VALUE,           /**< Immediate value. */
+   };
 
 ``op`` selects the operation to perform on a destination field.
 - ``set`` copies the data from ``src`` field to ``dst`` field.
@@ -2817,12 +2852,15 @@  for ``RTE_FLOW_FIELD_VALUE`` and ``RTE_FLOW_FIELD_POINTER`` respectively.
 
 .. table:: MODIFY_FIELD
 
-   +-----------------------------------------+
+   +---------------+-------------------------+
    | Field         | Value                   |
    +===============+=========================+
    | ``op``        | operation to perform    |
+   +---------------+-------------------------+
    | ``dst``       | destination field       |
+   +---------------+-------------------------+
    | ``src``       | source field            |
+   +---------------+-------------------------+
    | ``width``     | number of bits to use   |
    +---------------+-------------------------+
 
@@ -2830,12 +2868,15 @@  for ``RTE_FLOW_FIELD_VALUE`` and ``RTE_FLOW_FIELD_POINTER`` respectively.
 
 .. table:: destination/source field definition
 
-   +--------------------------------------------------------------------------+
+   +---------------+----------------------------------------------------------+
    | Field         | Value                                                    |
    +===============+==========================================================+
    | ``field``     | ID: packet field, mark, meta, tag, immediate, pointer    |
+   +---------------+----------------------------------------------------------+
    | ``level``     | encapsulation level of a packet field or tag array index |
+   +---------------+----------------------------------------------------------+
    | ``offset``    | number of bits to skip at the beginning                  |
+   +---------------+----------------------------------------------------------+
    | ``value``     | immediate value or a pointer to this value               |
    +---------------+----------------------------------------------------------+