[dpdk-dev] app/testpmd: add TCP flags in flow API

Message ID 1495098372-18438-1-git-send-email-beilei.xing@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xing, Beilei May 18, 2017, 9:06 a.m. UTC
  This commit adds TCP flags support in flow API as
some drivers have SYN filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Zhao1, Wei May 18, 2017, 9:14 a.m. UTC | #1
Test that patch use flow API of igb NIC syn filter, it is ok.
 
Acked-by: Wei Zhao <wei.zhao1@intel.com>

> -----Original Message-----
> From: Xing, Beilei
> Sent: Thursday, May 18, 2017 5:06 PM
> To: adrien.mazarguil@6wind.com
> Cc: dev@dpdk.org; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH] app/testpmd: add TCP flags in flow API
> 
> This commit adds TCP flags support in flow API as some drivers have SYN
> filter.
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
>  app/test-pmd/cmdline_flow.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 0fd69f9..3e5803a 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -152,6 +152,7 @@ enum index {
>  	ITEM_TCP,
>  	ITEM_TCP_SRC,
>  	ITEM_TCP_DST,
> +	ITEM_TCP_FLAGS,
>  	ITEM_SCTP,
>  	ITEM_SCTP_SRC,
>  	ITEM_SCTP_DST,
> @@ -531,6 +532,7 @@ static const enum index item_udp[] = {  static const
> enum index item_tcp[] = {
>  	ITEM_TCP_SRC,
>  	ITEM_TCP_DST,
> +	ITEM_TCP_FLAGS,
>  	ITEM_NEXT,
>  	ZERO,
>  };
> @@ -1267,6 +1269,13 @@ static const struct token token_list[] = {
>  		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_tcp,
>  					     hdr.dst_port)),
>  	},
> +	[ITEM_TCP_FLAGS] = {
> +		.name = "flags",
> +		.help = "TCP flags",
> +		.next = NEXT(item_tcp, NEXT_ENTRY(UNSIGNED),
> item_param),
> +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_tcp,
> +					     hdr.tcp_flags)),
> +	},
>  	[ITEM_SCTP] = {
>  		.name = "sctp",
>  		.help = "match SCTP header",
> --
> 2.5.5
  
Adrien Mazarguil May 18, 2017, 9:22 a.m. UTC | #2
On Thu, May 18, 2017 at 05:06:12PM +0800, Beilei Xing wrote:
> This commit adds TCP flags support in flow API as
> some drivers have SYN filter.
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
  
Thomas Monjalon June 8, 2017, 9:10 p.m. UTC | #3
18/05/2017 11:14, Zhao1, Wei:
> Test that patch use flow API of igb NIC syn filter, it is ok.
>  
> Acked-by: Wei Zhao <wei.zhao1@intel.com>

In this case, I think the appropriate tag is Tested-by ;)
Thanks
  
Thomas Monjalon June 8, 2017, 9:13 p.m. UTC | #4
18/05/2017 11:22, Adrien Mazarguil:
> On Thu, May 18, 2017 at 05:06:12PM +0800, Beilei Xing wrote:
> > This commit adds TCP flags support in flow API as
> > some drivers have SYN filter.
> > 
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied, thanks
  

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 0fd69f9..3e5803a 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -152,6 +152,7 @@  enum index {
 	ITEM_TCP,
 	ITEM_TCP_SRC,
 	ITEM_TCP_DST,
+	ITEM_TCP_FLAGS,
 	ITEM_SCTP,
 	ITEM_SCTP_SRC,
 	ITEM_SCTP_DST,
@@ -531,6 +532,7 @@  static const enum index item_udp[] = {
 static const enum index item_tcp[] = {
 	ITEM_TCP_SRC,
 	ITEM_TCP_DST,
+	ITEM_TCP_FLAGS,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -1267,6 +1269,13 @@  static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_tcp,
 					     hdr.dst_port)),
 	},
+	[ITEM_TCP_FLAGS] = {
+		.name = "flags",
+		.help = "TCP flags",
+		.next = NEXT(item_tcp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_tcp,
+					     hdr.tcp_flags)),
+	},
 	[ITEM_SCTP] = {
 		.name = "sctp",
 		.help = "match SCTP header",