app/testpmd: enhance GTP support
diff mbox series

Message ID 239bc0ae9191ddc12fec65742949710d13185b85.1584346077.git.dekelp@mellanox.com
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • app/testpmd: enhance GTP support
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Dekel Peled March 16, 2020, 8:14 a.m. UTC
This patch adds CLI option to enter the v_pt_rsv_flags value for GTP
flow pattern item.
It also adds GTP as valid item in raw_encap nad raw_decap setting.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
 app/test-pmd/cmdline_flow.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Ori Kam March 24, 2020, 9:58 a.m. UTC | #1
Hi Dekel,

> -----Original Message-----
> Subject: [dpdk-dev] [PATCH] app/testpmd: enhance GTP support
> 
> This patch adds CLI option to enter the v_pt_rsv_flags value for GTP
> flow pattern item.
> It also adds GTP as valid item in raw_encap nad raw_decap setting.
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> ---
>  app/test-pmd/cmdline_flow.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index a781545..cc1bd19 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -170,6 +170,7 @@ enum index {
>  	ITEM_FUZZY,
>  	ITEM_FUZZY_THRESH,
>  	ITEM_GTP,
> +	ITEM_GTP_FLAGS,
>  	ITEM_GTP_MSG_TYPE,
>  	ITEM_GTP_TEID,
>  	ITEM_GTPC,
> @@ -938,6 +939,7 @@ struct parse_action_priv {
>  };
> 
>  static const enum index item_gtp[] = {
> +	ITEM_GTP_FLAGS,
>  	ITEM_GTP_MSG_TYPE,
>  	ITEM_GTP_TEID,
>  	ITEM_NEXT,
> @@ -2347,6 +2349,13 @@ static int comp_set_raw_index(struct context *,
> const struct token *,
>  		.next = NEXT(item_gtp),
>  		.call = parse_vc,
>  	},
> +	[ITEM_GTP_FLAGS] = {
> +		.name = "v_pt_rsv_flags",
> +		.help = "GTP flags",
> +		.next = NEXT(item_gtp, NEXT_ENTRY(UNSIGNED),
> item_param),
> +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gtp,
> +					     v_pt_rsv_flags)),

V_pt_rsv_flags is 8 bits right? So why HTON?

> +	},
>  	[ITEM_GTP_MSG_TYPE] = {
>  		.name = "msg_type",
>  		.help = "GTP message type",
> @@ -6604,6 +6613,9 @@ static int comp_set_raw_index(struct context *,
> const struct token *,
>  			size = sizeof(struct rte_flow_item_ah);
>  			proto = 0x33;
>  			break;
> +		case RTE_FLOW_ITEM_TYPE_GTP:
> +			size = sizeof(struct rte_flow_item_gtp);
> +			break;
>  		case RTE_FLOW_ITEM_TYPE_PFCP:
>  			size = sizeof(struct rte_flow_item_pfcp);
>  			break;
> --
> 1.8.3.1

Best,
Ori
Dekel Peled March 24, 2020, 12:39 p.m. UTC | #2
Hi, PSB.

> -----Original Message-----
> From: Ori Kam <orika@mellanox.com>
> Sent: Tuesday, March 24, 2020 11:59 AM
> To: Dekel Peled <dekelp@mellanox.com>; wenzhuo.lu@intel.com;
> jingjing.wu@intel.com; bernard.iremonger@intel.com
> Cc: Matan Azrad <matan@mellanox.com>; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] app/testpmd: enhance GTP support
> 
> Hi Dekel,
> 
> > -----Original Message-----
> > Subject: [dpdk-dev] [PATCH] app/testpmd: enhance GTP support
> >
> > This patch adds CLI option to enter the v_pt_rsv_flags value for GTP
> > flow pattern item.
> > It also adds GTP as valid item in raw_encap nad raw_decap setting.
> >
> > Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> > ---
> >  app/test-pmd/cmdline_flow.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> >
> > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> > index a781545..cc1bd19 100644
> > --- a/app/test-pmd/cmdline_flow.c
> > +++ b/app/test-pmd/cmdline_flow.c
> > @@ -170,6 +170,7 @@ enum index {
> >  	ITEM_FUZZY,
> >  	ITEM_FUZZY_THRESH,
> >  	ITEM_GTP,
> > +	ITEM_GTP_FLAGS,
> >  	ITEM_GTP_MSG_TYPE,
> >  	ITEM_GTP_TEID,
> >  	ITEM_GTPC,
> > @@ -938,6 +939,7 @@ struct parse_action_priv {  };
> >
> >  static const enum index item_gtp[] = {
> > +	ITEM_GTP_FLAGS,
> >  	ITEM_GTP_MSG_TYPE,
> >  	ITEM_GTP_TEID,
> >  	ITEM_NEXT,
> > @@ -2347,6 +2349,13 @@ static int comp_set_raw_index(struct context *,
> > const struct token *,
> >  		.next = NEXT(item_gtp),
> >  		.call = parse_vc,
> >  	},
> > +	[ITEM_GTP_FLAGS] = {
> > +		.name = "v_pt_rsv_flags",
> > +		.help = "GTP flags",
> > +		.next = NEXT(item_gtp, NEXT_ENTRY(UNSIGNED),
> > item_param),
> > +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gtp,
> > +					     v_pt_rsv_flags)),
> 
> V_pt_rsv_flags is 8 bits right? So why HTON?

This is the common practice in this array, done for other uint8_t fields.

> 
> > +	},
> >  	[ITEM_GTP_MSG_TYPE] = {
> >  		.name = "msg_type",
> >  		.help = "GTP message type",
> > @@ -6604,6 +6613,9 @@ static int comp_set_raw_index(struct context *,
> > const struct token *,
> >  			size = sizeof(struct rte_flow_item_ah);
> >  			proto = 0x33;
> >  			break;
> > +		case RTE_FLOW_ITEM_TYPE_GTP:
> > +			size = sizeof(struct rte_flow_item_gtp);
> > +			break;
> >  		case RTE_FLOW_ITEM_TYPE_PFCP:
> >  			size = sizeof(struct rte_flow_item_pfcp);
> >  			break;
> > --
> > 1.8.3.1
> 
> Best,
> Ori

Patch
diff mbox series

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index a781545..cc1bd19 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -170,6 +170,7 @@  enum index {
 	ITEM_FUZZY,
 	ITEM_FUZZY_THRESH,
 	ITEM_GTP,
+	ITEM_GTP_FLAGS,
 	ITEM_GTP_MSG_TYPE,
 	ITEM_GTP_TEID,
 	ITEM_GTPC,
@@ -938,6 +939,7 @@  struct parse_action_priv {
 };
 
 static const enum index item_gtp[] = {
+	ITEM_GTP_FLAGS,
 	ITEM_GTP_MSG_TYPE,
 	ITEM_GTP_TEID,
 	ITEM_NEXT,
@@ -2347,6 +2349,13 @@  static int comp_set_raw_index(struct context *, const struct token *,
 		.next = NEXT(item_gtp),
 		.call = parse_vc,
 	},
+	[ITEM_GTP_FLAGS] = {
+		.name = "v_pt_rsv_flags",
+		.help = "GTP flags",
+		.next = NEXT(item_gtp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gtp,
+					     v_pt_rsv_flags)),
+	},
 	[ITEM_GTP_MSG_TYPE] = {
 		.name = "msg_type",
 		.help = "GTP message type",
@@ -6604,6 +6613,9 @@  static int comp_set_raw_index(struct context *, const struct token *,
 			size = sizeof(struct rte_flow_item_ah);
 			proto = 0x33;
 			break;
+		case RTE_FLOW_ITEM_TYPE_GTP:
+			size = sizeof(struct rte_flow_item_gtp);
+			break;
 		case RTE_FLOW_ITEM_TYPE_PFCP:
 			size = sizeof(struct rte_flow_item_pfcp);
 			break;