DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine
@ 2019-05-09  6:11 Jack Min
  2019-05-09  6:11 ` Jack Min
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jack Min @ 2019-05-09  6:11 UTC (permalink / raw)
  To: Shahaf Shuler, Yongseok Koh; +Cc: dev

Add support to match all TCP control bits (flags)
except "NS (ECN-nonce)" via Direct Verbs (DV) or Direct Rule (DR)
engine.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index cf255ca95c..44b4f40404 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -2066,6 +2066,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 	uint64_t last_item = 0;
 	uint8_t next_protocol = 0xff;
 	int actions_n = 0;
+	struct rte_flow_item_tcp nic_tcp_mask = {
+		.hdr = { .tcp_flags = 0xFF,
+			 .src_port = RTE_BE16(UINT16_MAX),
+			 .dst_port = RTE_BE16(UINT16_MAX),
+		}
+	};
 
 	if (items == NULL)
 		return -1;
@@ -2146,7 +2152,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 			ret = mlx5_flow_validate_item_tcp
 						(items, item_flags,
 						 next_protocol,
-						 &rte_flow_item_tcp_mask,
+						 &nic_tcp_mask,
 						 error);
 			if (ret < 0)
 				return ret;
@@ -2862,6 +2868,10 @@ flow_dv_translate_item_tcp(void *matcher, void *key,
 		 rte_be_to_cpu_16(tcp_m->hdr.dst_port));
 	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_dport,
 		 rte_be_to_cpu_16(tcp_v->hdr.dst_port & tcp_m->hdr.dst_port));
+	MLX5_SET(fte_match_set_lyr_2_4, headers_m, tcp_flags,
+		 tcp_m->hdr.tcp_flags);
+	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_flags,
+		 (tcp_v->hdr.tcp_flags & tcp_m->hdr.tcp_flags));
 }
 
 /**
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine
  2019-05-09  6:11 [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine Jack Min
@ 2019-05-09  6:11 ` Jack Min
  2019-05-12  6:27 ` Ori Kam
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Jack Min @ 2019-05-09  6:11 UTC (permalink / raw)
  To: Shahaf Shuler, Yongseok Koh; +Cc: dev

Add support to match all TCP control bits (flags)
except "NS (ECN-nonce)" via Direct Verbs (DV) or Direct Rule (DR)
engine.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index cf255ca95c..44b4f40404 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -2066,6 +2066,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 	uint64_t last_item = 0;
 	uint8_t next_protocol = 0xff;
 	int actions_n = 0;
+	struct rte_flow_item_tcp nic_tcp_mask = {
+		.hdr = { .tcp_flags = 0xFF,
+			 .src_port = RTE_BE16(UINT16_MAX),
+			 .dst_port = RTE_BE16(UINT16_MAX),
+		}
+	};
 
 	if (items == NULL)
 		return -1;
@@ -2146,7 +2152,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 			ret = mlx5_flow_validate_item_tcp
 						(items, item_flags,
 						 next_protocol,
-						 &rte_flow_item_tcp_mask,
+						 &nic_tcp_mask,
 						 error);
 			if (ret < 0)
 				return ret;
@@ -2862,6 +2868,10 @@ flow_dv_translate_item_tcp(void *matcher, void *key,
 		 rte_be_to_cpu_16(tcp_m->hdr.dst_port));
 	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_dport,
 		 rte_be_to_cpu_16(tcp_v->hdr.dst_port & tcp_m->hdr.dst_port));
+	MLX5_SET(fte_match_set_lyr_2_4, headers_m, tcp_flags,
+		 tcp_m->hdr.tcp_flags);
+	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_flags,
+		 (tcp_v->hdr.tcp_flags & tcp_m->hdr.tcp_flags));
 }
 
 /**
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine
  2019-05-09  6:11 [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine Jack Min
  2019-05-09  6:11 ` Jack Min
@ 2019-05-12  6:27 ` Ori Kam
  2019-05-12  6:27   ` Ori Kam
  2019-05-26 19:20 ` Shahaf Shuler
  2019-05-27  2:35 ` Jack Min
  3 siblings, 1 reply; 6+ messages in thread
From: Ori Kam @ 2019-05-12  6:27 UTC (permalink / raw)
  To: Jack Min, Shahaf Shuler, Yongseok Koh; +Cc: dev



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Jack Min
> Sent: Thursday, May 9, 2019 9:11 AM
> To: Shahaf Shuler <shahafs@mellanox.com>; Yongseok Koh
> <yskoh@mellanox.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine
> 
> Add support to match all TCP control bits (flags)
> except "NS (ECN-nonce)" via Direct Verbs (DV) or Direct Rule (DR)
> engine.
> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index cf255ca95c..44b4f40404 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -2066,6 +2066,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const
> struct rte_flow_attr *attr,
>  	uint64_t last_item = 0;
>  	uint8_t next_protocol = 0xff;
>  	int actions_n = 0;
> +	struct rte_flow_item_tcp nic_tcp_mask = {
> +		.hdr = { .tcp_flags = 0xFF,
> +			 .src_port = RTE_BE16(UINT16_MAX),
> +			 .dst_port = RTE_BE16(UINT16_MAX),
> +		}
> +	};
> 
>  	if (items == NULL)
>  		return -1;
> @@ -2146,7 +2152,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const
> struct rte_flow_attr *attr,
>  			ret = mlx5_flow_validate_item_tcp
>  						(items, item_flags,
>  						 next_protocol,
> -						 &rte_flow_item_tcp_mask,
> +						 &nic_tcp_mask,
>  						 error);
>  			if (ret < 0)
>  				return ret;
> @@ -2862,6 +2868,10 @@ flow_dv_translate_item_tcp(void *matcher, void
> *key,
>  		 rte_be_to_cpu_16(tcp_m->hdr.dst_port));
>  	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_dport,
>  		 rte_be_to_cpu_16(tcp_v->hdr.dst_port & tcp_m-
> >hdr.dst_port));
> +	MLX5_SET(fte_match_set_lyr_2_4, headers_m, tcp_flags,
> +		 tcp_m->hdr.tcp_flags);
> +	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_flags,
> +		 (tcp_v->hdr.tcp_flags & tcp_m->hdr.tcp_flags));
>  }
> 
>  /**
> --
> 2.20.1

Acked-by: Ori Kam <orika@mellanox.com>
Thanks,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine
  2019-05-12  6:27 ` Ori Kam
@ 2019-05-12  6:27   ` Ori Kam
  0 siblings, 0 replies; 6+ messages in thread
From: Ori Kam @ 2019-05-12  6:27 UTC (permalink / raw)
  To: Jack Min, Shahaf Shuler, Yongseok Koh; +Cc: dev



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Jack Min
> Sent: Thursday, May 9, 2019 9:11 AM
> To: Shahaf Shuler <shahafs@mellanox.com>; Yongseok Koh
> <yskoh@mellanox.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine
> 
> Add support to match all TCP control bits (flags)
> except "NS (ECN-nonce)" via Direct Verbs (DV) or Direct Rule (DR)
> engine.
> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index cf255ca95c..44b4f40404 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -2066,6 +2066,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const
> struct rte_flow_attr *attr,
>  	uint64_t last_item = 0;
>  	uint8_t next_protocol = 0xff;
>  	int actions_n = 0;
> +	struct rte_flow_item_tcp nic_tcp_mask = {
> +		.hdr = { .tcp_flags = 0xFF,
> +			 .src_port = RTE_BE16(UINT16_MAX),
> +			 .dst_port = RTE_BE16(UINT16_MAX),
> +		}
> +	};
> 
>  	if (items == NULL)
>  		return -1;
> @@ -2146,7 +2152,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const
> struct rte_flow_attr *attr,
>  			ret = mlx5_flow_validate_item_tcp
>  						(items, item_flags,
>  						 next_protocol,
> -						 &rte_flow_item_tcp_mask,
> +						 &nic_tcp_mask,
>  						 error);
>  			if (ret < 0)
>  				return ret;
> @@ -2862,6 +2868,10 @@ flow_dv_translate_item_tcp(void *matcher, void
> *key,
>  		 rte_be_to_cpu_16(tcp_m->hdr.dst_port));
>  	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_dport,
>  		 rte_be_to_cpu_16(tcp_v->hdr.dst_port & tcp_m-
> >hdr.dst_port));
> +	MLX5_SET(fte_match_set_lyr_2_4, headers_m, tcp_flags,
> +		 tcp_m->hdr.tcp_flags);
> +	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_flags,
> +		 (tcp_v->hdr.tcp_flags & tcp_m->hdr.tcp_flags));
>  }
> 
>  /**
> --
> 2.20.1

Acked-by: Ori Kam <orika@mellanox.com>
Thanks,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev]  [PATCH] net/mlx5: match on TCP flags via DV/DR engine
  2019-05-09  6:11 [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine Jack Min
  2019-05-09  6:11 ` Jack Min
  2019-05-12  6:27 ` Ori Kam
@ 2019-05-26 19:20 ` Shahaf Shuler
  2019-05-27  2:35 ` Jack Min
  3 siblings, 0 replies; 6+ messages in thread
From: Shahaf Shuler @ 2019-05-26 19:20 UTC (permalink / raw)
  To: Shahaf Shuler, Yongseok Koh; +Cc: dev, Jack Min

From: Jack Min <jackmin@mellanox.com>

>Add support to match all TCP control bits (flags)
>except "NS (ECN-nonce)" via Direct Verbs (DV) or Direct Rule (DR)
>engine.
>
>Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
>Acked-by: Ori Kam <orika@mellanox.com>

Applied to next-net-mlx, with few points to address:
1. Your author name is not the same as your signed-of name. please take
care.
2. fixed some identation issues
3. modifed the title. please have a look.

thanks. 


>---
> drivers/net/mlx5/mlx5_flow_dv.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
>index cf255ca95c..44b4f40404 100644
>--- a/drivers/net/mlx5/mlx5_flow_dv.c
>+++ b/drivers/net/mlx5/mlx5_flow_dv.c
>@@ -2066,6 +2066,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
> 	uint64_t last_item = 0;
> 	uint8_t next_protocol = 0xff;
> 	int actions_n = 0;
>+	struct rte_flow_item_tcp nic_tcp_mask = {
>+		.hdr = { .tcp_flags = 0xFF,
>+			 .src_port = RTE_BE16(UINT16_MAX),
>+			 .dst_port = RTE_BE16(UINT16_MAX),
>+		}
>+	};
> 
> 	if (items == NULL)
> 		return -1;
>@@ -2146,7 +2152,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
> 			ret = mlx5_flow_validate_item_tcp
> 						(items, item_flags,
> 						 next_protocol,
>-						 &rte_flow_item_tcp_mask,
>+						 &nic_tcp_mask,
> 						 error);
> 			if (ret < 0)
> 				return ret;
>@@ -2862,6 +2868,10 @@ flow_dv_translate_item_tcp(void *matcher, void *key,
> 		 rte_be_to_cpu_16(tcp_m->hdr.dst_port));
> 	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_dport,
> 		 rte_be_to_cpu_16(tcp_v->hdr.dst_port & tcp_m->hdr.dst_port));
>+	MLX5_SET(fte_match_set_lyr_2_4, headers_m, tcp_flags,
>+		 tcp_m->hdr.tcp_flags);
>+	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_flags,
>+		 (tcp_v->hdr.tcp_flags & tcp_m->hdr.tcp_flags));
> }
> 
> /**

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine
  2019-05-09  6:11 [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine Jack Min
                   ` (2 preceding siblings ...)
  2019-05-26 19:20 ` Shahaf Shuler
@ 2019-05-27  2:35 ` Jack Min
  3 siblings, 0 replies; 6+ messages in thread
From: Jack Min @ 2019-05-27  2:35 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Yongseok Koh, dev

On Mon, 19-05-27, 03:20, Shahaf Shuler wrote:
> From: Jack Min <jackmin@mellanox.com>
> 
> >Add support to match all TCP control bits (flags)
> >except "NS (ECN-nonce)" via Direct Verbs (DV) or Direct Rule (DR)
> >engine.
> >
> >Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> >Acked-by: Ori Kam <orika@mellanox.com>
> 
> Applied to next-net-mlx, with few points to address:
Thank you, shahaf.

> 1. Your author name is not the same as your signed-of name. please take
> care.
It seems the MS exchange mangled my email name...

> 2. fixed some identation issues
> 3. modifed the title. please have a look.
Ok. 

> thanks. 
> 
> 
> >---
> > drivers/net/mlx5/mlx5_flow_dv.c | 12 +++++++++++-
> > 1 file changed, 11 insertions(+), 1 deletion(-)
> >
> >diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
> >index cf255ca95c..44b4f40404 100644
> >--- a/drivers/net/mlx5/mlx5_flow_dv.c
> >+++ b/drivers/net/mlx5/mlx5_flow_dv.c
> >@@ -2066,6 +2066,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
> > 	uint64_t last_item = 0;
> > 	uint8_t next_protocol = 0xff;
> > 	int actions_n = 0;
> >+	struct rte_flow_item_tcp nic_tcp_mask = {
> >+		.hdr = { .tcp_flags = 0xFF,
> >+			 .src_port = RTE_BE16(UINT16_MAX),
> >+			 .dst_port = RTE_BE16(UINT16_MAX),
> >+		}
> >+	};
> > 
> > 	if (items == NULL)
> > 		return -1;
> >@@ -2146,7 +2152,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
> > 			ret = mlx5_flow_validate_item_tcp
> > 						(items, item_flags,
> > 						 next_protocol,
> >-						 &rte_flow_item_tcp_mask,
> >+						 &nic_tcp_mask,
> > 						 error);
> > 			if (ret < 0)
> > 				return ret;
> >@@ -2862,6 +2868,10 @@ flow_dv_translate_item_tcp(void *matcher, void *key,
> > 		 rte_be_to_cpu_16(tcp_m->hdr.dst_port));
> > 	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_dport,
> > 		 rte_be_to_cpu_16(tcp_v->hdr.dst_port & tcp_m->hdr.dst_port));
> >+	MLX5_SET(fte_match_set_lyr_2_4, headers_m, tcp_flags,
> >+		 tcp_m->hdr.tcp_flags);
> >+	MLX5_SET(fte_match_set_lyr_2_4, headers_v, tcp_flags,
> >+		 (tcp_v->hdr.tcp_flags & tcp_m->hdr.tcp_flags));
> > }
> > 
> > /**

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-27  2:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09  6:11 [dpdk-dev] [PATCH] net/mlx5: match on TCP flags via DV/DR engine Jack Min
2019-05-09  6:11 ` Jack Min
2019-05-12  6:27 ` Ori Kam
2019-05-12  6:27   ` Ori Kam
2019-05-26 19:20 ` Shahaf Shuler
2019-05-27  2:35 ` Jack Min

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).