[v4,1/4] app/testpmd: add packet id for IP fragment

Message ID 20210413081032.60509-2-jia.guo@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series support flow for IP fragment in IAVF |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Guo, Jia April 13, 2021, 8:10 a.m. UTC
  Add the new items to support the flow configuration for IP fragment
packets.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
 app/test-pmd/cmdline_flow.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
  

Comments

Jack Min April 19, 2021, 7:43 a.m. UTC | #1
On Tue, 21-04-13, 16:10, Jeff Guo wrote:
> Add the new items to support the flow configuration for IP fragment
> packets.
> 
> Signed-off-by: Ting Xu <ting.xu@intel.com>
> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> ---
>  app/test-pmd/cmdline_flow.c | 21 ++++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)

[...snip...]

> +	[ITEM_IPV4_ID] = {
> +		.name = "packet_id",
> +		.help = "fragment packet id",
> +		.next = NEXT(item_ipv4, NEXT_ENTRY(UNSIGNED), item_param),
> +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4,
> +					     hdr.packet_id)),
> +	},
>  	[ITEM_IPV4_FRAGMENT_OFFSET] = {
>  		.name = "fragment_offset",
>  		.help = "fragmentation flags and fragment offset",
> @@ -2969,12 +2980,20 @@ static const struct token token_list[] = {
>  	},
>  	[ITEM_IPV6_FRAG_EXT_FRAG_DATA] = {
>  		.name = "frag_data",
> -		.help = "Fragment flags and offset",
> +		.help = "fragment flags and offset",
Will it be better to have a seperate fix patch for this ?

-Jack
  
Ferruh Yigit April 19, 2021, 3:37 p.m. UTC | #2
On 4/13/2021 9:10 AM, Jeff Guo wrote:
> Add the new items to support the flow configuration for IP fragment
> packets.
> 
> Signed-off-by: Ting Xu <ting.xu@intel.com>
> Signed-off-by: Jeff Guo <jia.guo@intel.com>

Hi Ori,

Can you please check this patch?
If you don't have any objection, I am planning to get it for rc1.
  
Ferruh Yigit April 19, 2021, 3:40 p.m. UTC | #3
On 4/19/2021 8:43 AM, Jack Min wrote:
> On Tue, 21-04-13, 16:10, Jeff Guo wrote:
>> Add the new items to support the flow configuration for IP fragment
>> packets.
>>
>> Signed-off-by: Ting Xu <ting.xu@intel.com>
>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>> ---
>>   app/test-pmd/cmdline_flow.c | 21 ++++++++++++++++++++-
>>   1 file changed, 20 insertions(+), 1 deletion(-)
> 
> [...snip...]
> 
>> +	[ITEM_IPV4_ID] = {
>> +		.name = "packet_id",
>> +		.help = "fragment packet id",
>> +		.next = NEXT(item_ipv4, NEXT_ENTRY(UNSIGNED), item_param),
>> +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4,
>> +					     hdr.packet_id)),
>> +	},
>>   	[ITEM_IPV4_FRAGMENT_OFFSET] = {
>>   		.name = "fragment_offset",
>>   		.help = "fragmentation flags and fragment offset",
>> @@ -2969,12 +2980,20 @@ static const struct token token_list[] = {
>>   	},
>>   	[ITEM_IPV6_FRAG_EXT_FRAG_DATA] = {
>>   		.name = "frag_data",
>> -		.help = "Fragment flags and offset",
>> +		.help = "fragment flags and offset",
> Will it be better to have a seperate fix patch for this ?
> 

You refer the case update of the help string, 'F' -> 'f', right?
If so this is so small, and cosmetic, update, I think no need to have its own 
patch, and while this patch is touching related area, acceptable to fix it here.
  
Ori Kam April 19, 2021, 5:45 p.m. UTC | #4
Hi Jeff and Ting,

> -----Original Message-----
> From: Jeff Guo <jia.guo@intel.com>
> Sent: Tuesday, April 13, 2021 11:10 AM
> Subject: [PATCH v4 1/4] app/testpmd: add packet id for IP fragment
> 
> Add the new items to support the flow configuration for IP fragment
> packets.
> 
> Signed-off-by: Ting Xu <ting.xu@intel.com>
> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> ---
>  app/test-pmd/cmdline_flow.c | 21 ++++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index fb7a3a8bd3..46ae342b85 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -166,6 +166,7 @@ enum index {
>  	ITEM_VLAN_HAS_MORE_VLAN,
>  	ITEM_IPV4,
>  	ITEM_IPV4_TOS,
> +	ITEM_IPV4_ID,
>  	ITEM_IPV4_FRAGMENT_OFFSET,
>  	ITEM_IPV4_TTL,
>  	ITEM_IPV4_PROTO,
> @@ -236,6 +237,7 @@ enum index {
>  	ITEM_IPV6_FRAG_EXT,
>  	ITEM_IPV6_FRAG_EXT_NEXT_HDR,
>  	ITEM_IPV6_FRAG_EXT_FRAG_DATA,
> +	ITEM_IPV6_FRAG_EXT_ID,
>  	ITEM_ICMP6,
>  	ITEM_ICMP6_TYPE,
>  	ITEM_ICMP6_CODE,
> @@ -1028,6 +1030,7 @@ static const enum index item_vlan[] = {
> 
>  static const enum index item_ipv4[] = {
>  	ITEM_IPV4_TOS,
> +	ITEM_IPV4_ID,
>  	ITEM_IPV4_FRAGMENT_OFFSET,
>  	ITEM_IPV4_TTL,
>  	ITEM_IPV4_PROTO,
> @@ -1164,6 +1167,7 @@ static const enum index item_ipv6_ext[] = {
>  static const enum index item_ipv6_frag_ext[] = {
>  	ITEM_IPV6_FRAG_EXT_NEXT_HDR,
>  	ITEM_IPV6_FRAG_EXT_FRAG_DATA,
> +	ITEM_IPV6_FRAG_EXT_ID,
>  	ITEM_NEXT,
>  	ZERO,
>  };
> @@ -2466,6 +2470,13 @@ static const struct token token_list[] = {
>  		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4,
>  					     hdr.type_of_service)),
>  	},
> +	[ITEM_IPV4_ID] = {
> +		.name = "packet_id",
> +		.help = "fragment packet id",
> +		.next = NEXT(item_ipv4, NEXT_ENTRY(UNSIGNED),
> item_param),
> +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4,
> +					     hdr.packet_id)),
> +	},
>  	[ITEM_IPV4_FRAGMENT_OFFSET] = {
>  		.name = "fragment_offset",
>  		.help = "fragmentation flags and fragment offset",
> @@ -2969,12 +2980,20 @@ static const struct token token_list[] = {
>  	},
>  	[ITEM_IPV6_FRAG_EXT_FRAG_DATA] = {
>  		.name = "frag_data",
> -		.help = "Fragment flags and offset",
> +		.help = "fragment flags and offset",
>  		.next = NEXT(item_ipv6_frag_ext, NEXT_ENTRY(UNSIGNED),
>  			     item_param),
>  		.args = ARGS(ARGS_ENTRY_HTON(struct
> rte_flow_item_ipv6_frag_ext,
>  					     hdr.frag_data)),
>  	},
> +	[ITEM_IPV6_FRAG_EXT_ID] = {
> +		.name = "packet_id",
> +		.help = "fragment packet id",
> +		.next = NEXT(item_ipv6_frag_ext, NEXT_ENTRY(UNSIGNED),
> +			     item_param),
> +		.args = ARGS(ARGS_ENTRY_HTON(struct
> rte_flow_item_ipv6_frag_ext,
> +					     hdr.id)),
> +	},
>  	[ITEM_ICMP6] = {
>  		.name = "icmp6",
>  		.help = "match any ICMPv6 header",
> --
> 2.20.1

Acked-by: Ori Kam <orika@nvidia.com>
Thanks,
Ori
  
Ferruh Yigit April 19, 2021, 11:01 p.m. UTC | #5
On 4/19/2021 6:45 PM, Ori Kam wrote:
> Hi Jeff and Ting,
> 
>> -----Original Message-----
>> From: Jeff Guo <jia.guo@intel.com>
>> Sent: Tuesday, April 13, 2021 11:10 AM
>> Subject: [PATCH v4 1/4] app/testpmd: add packet id for IP fragment
>>
>> Add the new items to support the flow configuration for IP fragment
>> packets.
>>
>> Signed-off-by: Ting Xu <ting.xu@intel.com>
>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> 
> Acked-by: Ori Kam <orika@nvidia.com>
> 

Applied to dpdk-next-net/main, thanks.
  
Jack Min April 20, 2021, 2:21 a.m. UTC | #6
On Mon, 21-04-19, 16:40, Ferruh Yigit wrote:
> On 4/19/2021 8:43 AM, Jack Min wrote:
> > On Tue, 21-04-13, 16:10, Jeff Guo wrote:
> > > Add the new items to support the flow configuration for IP fragment
> > > packets.
> > > 
> > > Signed-off-by: Ting Xu <ting.xu@intel.com>
> > > Signed-off-by: Jeff Guo <jia.guo@intel.com>
> > > ---
> > >   app/test-pmd/cmdline_flow.c | 21 ++++++++++++++++++++-
> > >   1 file changed, 20 insertions(+), 1 deletion(-)
> > 
> > [...snip...]
> > 
> > > +	[ITEM_IPV4_ID] = {
> > > +		.name = "packet_id",
> > > +		.help = "fragment packet id",
> > > +		.next = NEXT(item_ipv4, NEXT_ENTRY(UNSIGNED), item_param),
> > > +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4,
> > > +					     hdr.packet_id)),
> > > +	},
> > >   	[ITEM_IPV4_FRAGMENT_OFFSET] = {
> > >   		.name = "fragment_offset",
> > >   		.help = "fragmentation flags and fragment offset",
> > > @@ -2969,12 +2980,20 @@ static const struct token token_list[] = {
> > >   	},
> > >   	[ITEM_IPV6_FRAG_EXT_FRAG_DATA] = {
> > >   		.name = "frag_data",
> > > -		.help = "Fragment flags and offset",
> > > +		.help = "fragment flags and offset",
> > Will it be better to have a seperate fix patch for this ?
> > 
> 
> You refer the case update of the help string, 'F' -> 'f', right?
Right.

> If so this is so small, and cosmetic, update, I think no need to have its
> own patch, and while this patch is touching related area, acceptable to fix
> it here.
Yes it's so small so I don't insist my point. :)

Reviewed-by: Xiaoyu Min <jackmin@nvidia.com>

-Jack
  

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index fb7a3a8bd3..46ae342b85 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -166,6 +166,7 @@  enum index {
 	ITEM_VLAN_HAS_MORE_VLAN,
 	ITEM_IPV4,
 	ITEM_IPV4_TOS,
+	ITEM_IPV4_ID,
 	ITEM_IPV4_FRAGMENT_OFFSET,
 	ITEM_IPV4_TTL,
 	ITEM_IPV4_PROTO,
@@ -236,6 +237,7 @@  enum index {
 	ITEM_IPV6_FRAG_EXT,
 	ITEM_IPV6_FRAG_EXT_NEXT_HDR,
 	ITEM_IPV6_FRAG_EXT_FRAG_DATA,
+	ITEM_IPV6_FRAG_EXT_ID,
 	ITEM_ICMP6,
 	ITEM_ICMP6_TYPE,
 	ITEM_ICMP6_CODE,
@@ -1028,6 +1030,7 @@  static const enum index item_vlan[] = {
 
 static const enum index item_ipv4[] = {
 	ITEM_IPV4_TOS,
+	ITEM_IPV4_ID,
 	ITEM_IPV4_FRAGMENT_OFFSET,
 	ITEM_IPV4_TTL,
 	ITEM_IPV4_PROTO,
@@ -1164,6 +1167,7 @@  static const enum index item_ipv6_ext[] = {
 static const enum index item_ipv6_frag_ext[] = {
 	ITEM_IPV6_FRAG_EXT_NEXT_HDR,
 	ITEM_IPV6_FRAG_EXT_FRAG_DATA,
+	ITEM_IPV6_FRAG_EXT_ID,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -2466,6 +2470,13 @@  static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4,
 					     hdr.type_of_service)),
 	},
+	[ITEM_IPV4_ID] = {
+		.name = "packet_id",
+		.help = "fragment packet id",
+		.next = NEXT(item_ipv4, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4,
+					     hdr.packet_id)),
+	},
 	[ITEM_IPV4_FRAGMENT_OFFSET] = {
 		.name = "fragment_offset",
 		.help = "fragmentation flags and fragment offset",
@@ -2969,12 +2980,20 @@  static const struct token token_list[] = {
 	},
 	[ITEM_IPV6_FRAG_EXT_FRAG_DATA] = {
 		.name = "frag_data",
-		.help = "Fragment flags and offset",
+		.help = "fragment flags and offset",
 		.next = NEXT(item_ipv6_frag_ext, NEXT_ENTRY(UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv6_frag_ext,
 					     hdr.frag_data)),
 	},
+	[ITEM_IPV6_FRAG_EXT_ID] = {
+		.name = "packet_id",
+		.help = "fragment packet id",
+		.next = NEXT(item_ipv6_frag_ext, NEXT_ENTRY(UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv6_frag_ext,
+					     hdr.id)),
+	},
 	[ITEM_ICMP6] = {
 		.name = "icmp6",
 		.help = "match any ICMPv6 header",