[v2] ethdev: add TCP/IP modify field IDs

Message ID 20230908034941.66782-1-suanmingm@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] ethdev: add TCP/IP modify field IDs |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Suanming Mou Sept. 8, 2023, 3:49 a.m. UTC
  Currently, get TCP/IP header or data length information from traffic
is missing in the modify field IDs. This commit adds the missing
TCP data_offset, IPv4 IHL/total_len, IPv6 payload_len to modify filed
IDs. This allows users be able to manager more TCP/IP fields.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
---

v2: fix typo tcp_date_off -> tcp_data_off

---
 app/test-pmd/cmdline_flow.c | 1 +
 lib/ethdev/rte_flow.h       | 4 ++++
 2 files changed, 5 insertions(+)
  

Comments

Ferruh Yigit Oct. 10, 2023, 10:24 a.m. UTC | #1
On 9/8/2023 4:49 AM, Suanming Mou wrote:
> Currently, get TCP/IP header or data length information from traffic
> is missing in the modify field IDs. This commit adds the missing
> TCP data_offset, IPv4 IHL/total_len, IPv6 payload_len to modify filed
> IDs. This allows users be able to manager more TCP/IP fields.
> 
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> ---
> 
> v2: fix typo tcp_date_off -> tcp_data_off
> 
> ---
>  app/test-pmd/cmdline_flow.c | 1 +
>  lib/ethdev/rte_flow.h       | 4 ++++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 94827bcc4a..310068ce88 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -937,6 +937,7 @@ static const char *const modify_field_ids[] = {
>  	"flex_item",
>  	"hash_result",
>  	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
> +	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
>  	NULL
>  };
>  
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index 2ebb76dbc0..43ba51da6e 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -3875,6 +3875,10 @@ enum rte_flow_field_id {
>  	RTE_FLOW_FIELD_GENEVE_OPT_CLASS,/**< GENEVE option class. */
>  	RTE_FLOW_FIELD_GENEVE_OPT_DATA,	/**< GENEVE option data. */
>  	RTE_FLOW_FIELD_MPLS,		/**< MPLS header. */
> +	RTE_FLOW_FIELD_TCP_DATA_OFFSET,	/**< TCP data offset. */
> +	RTE_FLOW_FIELD_IPV4_IHL,	/**< IPv4 IHL. */
> +	RTE_FLOW_FIELD_IPV4_TOTAL_LEN,	/**< IPv4 total length. */
> +	RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN	/**< IPv6 payload length. */
>  };
>  
>  /**

Hi Suanming,

Patch looks good. But, testpmd modify flow action support seems not
documented at all, can you please first add it [1], later update that
document with this patch?

Also can you please check if `rte_flow.rst` also needs to be updated or not?


[1]: `doc/guides/testpmd_app_ug/testpmd_funcs.rst`, `Flow rules
management` section
  
Suanming Mou Oct. 11, 2023, 12:11 a.m. UTC | #2
Hi,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: Tuesday, October 10, 2023 6:24 PM
> To: Suanming Mou <suanmingm@nvidia.com>; Ori Kam <orika@nvidia.com>;
> Aman Singh <aman.deep.singh@intel.com>; Yuying Zhang
> <yuying.zhang@intel.com>; NBU-Contact-Thomas Monjalon (EXTERNAL)
> <thomas@monjalon.net>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH v2] ethdev: add TCP/IP modify field IDs
> 
> On 9/8/2023 4:49 AM, Suanming Mou wrote:
> > Currently, get TCP/IP header or data length information from traffic
> > is missing in the modify field IDs. This commit adds the missing TCP
> > data_offset, IPv4 IHL/total_len, IPv6 payload_len to modify filed IDs.
> > This allows users be able to manager more TCP/IP fields.
> >
> > Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> > ---
> >
> > v2: fix typo tcp_date_off -> tcp_data_off
> >
> > ---
> >  app/test-pmd/cmdline_flow.c | 1 +
> >  lib/ethdev/rte_flow.h       | 4 ++++
> >  2 files changed, 5 insertions(+)
> >
> 
> Hi Suanming,
> 
> Patch looks good. But, testpmd modify flow action support seems not
> documented at all, can you please first add it [1], later update that document with
> this patch?
> 
> Also can you please check if `rte_flow.rst` also needs to be updated or not?

Sure, will check and update.
Thanks
> 
> 
> [1]: `doc/guides/testpmd_app_ug/testpmd_funcs.rst`, `Flow rules management`
> section
  
Suanming Mou Oct. 11, 2023, 8:58 a.m. UTC | #3
Hi,

> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Wednesday, October 11, 2023 8:11 AM
> To: Ferruh Yigit <ferruh.yigit@amd.com>; Ori Kam <orika@nvidia.com>; Aman
> Singh <aman.deep.singh@intel.com>; Yuying Zhang <yuying.zhang@intel.com>;
> NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>; Andrew
> Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v2] ethdev: add TCP/IP modify field IDs
> 
> Hi,
> 
> > -----Original Message-----
> > From: Ferruh Yigit <ferruh.yigit@amd.com>
> > Sent: Tuesday, October 10, 2023 6:24 PM
> > To: Suanming Mou <suanmingm@nvidia.com>; Ori Kam <orika@nvidia.com>;
> > Aman Singh <aman.deep.singh@intel.com>; Yuying Zhang
> > <yuying.zhang@intel.com>; NBU-Contact-Thomas Monjalon (EXTERNAL)
> > <thomas@monjalon.net>; Andrew Rybchenko
> > <andrew.rybchenko@oktetlabs.ru>
> > Cc: dev@dpdk.org
> > Subject: Re: [PATCH v2] ethdev: add TCP/IP modify field IDs
> >
> > On 9/8/2023 4:49 AM, Suanming Mou wrote:
> > > Currently, get TCP/IP header or data length information from traffic
> > > is missing in the modify field IDs. This commit adds the missing TCP
> > > data_offset, IPv4 IHL/total_len, IPv6 payload_len to modify filed IDs.
> > > This allows users be able to manager more TCP/IP fields.
> > >
> > > Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> > > ---
> > >
> > > v2: fix typo tcp_date_off -> tcp_data_off
> > >
> > > ---
> > >  app/test-pmd/cmdline_flow.c | 1 +
> > >  lib/ethdev/rte_flow.h       | 4 ++++
> > >  2 files changed, 5 insertions(+)
> > >
> >
> > Hi Suanming,
> >
> > Patch looks good. But, testpmd modify flow action support seems not
> > documented at all, can you please first add it [1], later update that
> > document with this patch?
> >
> > Also can you please check if `rte_flow.rst` also needs to be updated or not?
> 
> Sure, will check and update.

`rte_flow.rst` has the modify_field action description in `Action: ``MODIFY_FIELD``` section.
Will update only the ` testpmd_funcs.rst`.

> Thanks
> >
> >
> > [1]: `doc/guides/testpmd_app_ug/testpmd_funcs.rst`, `Flow rules
> > management` section
  

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 94827bcc4a..310068ce88 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -937,6 +937,7 @@  static const char *const modify_field_ids[] = {
 	"flex_item",
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
+	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
 	NULL
 };
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 2ebb76dbc0..43ba51da6e 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3875,6 +3875,10 @@  enum rte_flow_field_id {
 	RTE_FLOW_FIELD_GENEVE_OPT_CLASS,/**< GENEVE option class. */
 	RTE_FLOW_FIELD_GENEVE_OPT_DATA,	/**< GENEVE option data. */
 	RTE_FLOW_FIELD_MPLS,		/**< MPLS header. */
+	RTE_FLOW_FIELD_TCP_DATA_OFFSET,	/**< TCP data offset. */
+	RTE_FLOW_FIELD_IPV4_IHL,	/**< IPv4 IHL. */
+	RTE_FLOW_FIELD_IPV4_TOTAL_LEN,	/**< IPv4 total length. */
+	RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN	/**< IPv6 payload length. */
 };
 
 /**