[v5,2/3] ethdev: add modify IPv6 protocol field

Message ID 20230201113511.2362188-3-rongweil@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series add IPv6 routing extension support |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Rongwei Liu Feb. 1, 2023, 11:35 a.m. UTC
  Add IPv6 protocol modify field definition.

Add new modify field destination type string: "ipv6_proto".

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 3 ++-
 lib/ethdev/rte_flow.h       | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
  

Comments

Andrew Rybchenko Feb. 1, 2023, 11:39 a.m. UTC | #1
On 2/1/23 14:35, Rongwei Liu wrote:
> Add IPv6 protocol modify field definition.
> 
> Add new modify field destination type string: "ipv6_proto".
> 
> Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> Acked-by: Ori Kam <orika@nvidia.com>

I've already acked it:

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  
Stephen Hemminger Feb. 1, 2023, 4:55 p.m. UTC | #2
On Wed, 1 Feb 2023 13:35:10 +0200
Rongwei Liu <rongweil@nvidia.com> wrote:

> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 7a8516829c..b8156ebca2 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -811,7 +811,8 @@ static const char *const modify_field_ids[] = {
>  	"udp_port_src", "udp_port_dst",
>  	"vxlan_vni", "geneve_vni", "gtp_teid",
>  	"tag", "mark", "meta", "pointer", "value",
> -	"ipv4_ecn", "ipv6_ecn", "gtp_psc_qfi", "meter_color", NULL
> +	"ipv4_ecn", "ipv6_ecn", "gtp_psc_qfi", "meter_color",
> +	"ipv6_proto", NULL
>  };
>  

Would it be better to keep the table in alphabetical order here?
  
Rongwei Liu Feb. 2, 2023, 2:12 a.m. UTC | #3
Hi Stephen

BR
Rongwei

> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Thursday, February 2, 2023 00:56
> To: Rongwei Liu <rongweil@nvidia.com>
> Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-
> Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>; Raslan Darawsheh
> <rasland@nvidia.com>; Aman Singh <aman.deep.singh@intel.com>; Yuying
> Zhang <yuying.zhang@intel.com>; Ferruh Yigit <ferruh.yigit@amd.com>;
> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Subject: Re: [PATCH v5 2/3] ethdev: add modify IPv6 protocol field
> 
> External email: Use caution opening links or attachments
> 
> 
> On Wed, 1 Feb 2023 13:35:10 +0200
> Rongwei Liu <rongweil@nvidia.com> wrote:
> 
> > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> > index 7a8516829c..b8156ebca2 100644
> > --- a/app/test-pmd/cmdline_flow.c
> > +++ b/app/test-pmd/cmdline_flow.c
> > @@ -811,7 +811,8 @@ static const char *const modify_field_ids[] = {
> >       "udp_port_src", "udp_port_dst",
> >       "vxlan_vni", "geneve_vni", "gtp_teid",
> >       "tag", "mark", "meta", "pointer", "value",
> > -     "ipv4_ecn", "ipv6_ecn", "gtp_psc_qfi", "meter_color", NULL
> > +     "ipv4_ecn", "ipv6_ecn", "gtp_psc_qfi", "meter_color",
> > +     "ipv6_proto", NULL
> >  };
> >
> 
> Would it be better to keep the table in alphabetical order here?
There are two arrays related to modify_filed resources: one for enumeration definition and the other is string for testpmd cli.
The sequence is strictly same.
" keep the table in alphabetical " needs to change both the array and make sure the new comer is the same index.
IMO, current approach is more friendly for new coming fields.
  

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 7a8516829c..b8156ebca2 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -811,7 +811,8 @@  static const char *const modify_field_ids[] = {
 	"udp_port_src", "udp_port_dst",
 	"vxlan_vni", "geneve_vni", "gtp_teid",
 	"tag", "mark", "meta", "pointer", "value",
-	"ipv4_ecn", "ipv6_ecn", "gtp_psc_qfi", "meter_color", NULL
+	"ipv4_ecn", "ipv6_ecn", "gtp_psc_qfi", "meter_color",
+	"ipv6_proto", NULL
 };
 
 static const char *const meter_colors[] = {
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 9b9018cba2..f4797682b7 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3547,6 +3547,7 @@  enum rte_flow_field_id {
 	RTE_FLOW_FIELD_IPV6_ECN,	/**< IPv6 ECN. */
 	RTE_FLOW_FIELD_GTP_PSC_QFI,	/**< GTP QFI. */
 	RTE_FLOW_FIELD_METER_COLOR,	/**< Meter color marker. */
+	RTE_FLOW_FIELD_IPV6_PROTO,	/**< IPv6 next header. */
 };
 
 /**