DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix icmpv6 header rewrite actions
@ 2020-01-22 14:37 Shiri Kuzin
  2020-01-26 16:53 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Shiri Kuzin @ 2020-01-22 14:37 UTC (permalink / raw)
  To: dev
  Cc: Matan Azrad, Raslan Darawsheh, Ori Kam, Slava Ovsiienko,
	Dekel Peled, stable

the ConnectX-5 HW cannot calculate the checksum for ICMPv6,
therefore flows with pattern 'ipv6 proto is 58' with actions that change
the header should be rejected. the actions that change the header
in this type of flow are 'set_ipv6_src' and 'set_ipv6_dst'.

Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
Cc: dekelp@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

---
 drivers/net/mlx5/mlx5_flow_dv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 26dbaaf329..2475ff336e 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -4447,6 +4447,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 	uint8_t next_protocol = 0xff;
 	uint16_t ether_type = 0;
 	int actions_n = 0;
+	uint8_t item_ipv6_proto = 0;
 	const struct rte_flow_item *gre_item = NULL;
 	struct rte_flow_item_tcp nic_tcp_mask = {
 		.hdr = {
@@ -4554,6 +4555,9 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 			if (items->mask != NULL &&
 			    ((const struct rte_flow_item_ipv6 *)
 			     items->mask)->hdr.proto) {
+				item_ipv6_proto =
+					((const struct rte_flow_item_ipv6 *)
+					 items->spec)->hdr.proto;
 				next_protocol =
 					((const struct rte_flow_item_ipv6 *)
 					 items->spec)->hdr.proto;
@@ -4926,6 +4930,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 								  error);
 			if (ret < 0)
 				return ret;
+			if (item_ipv6_proto == IPPROTO_ICMPV6)
+				return rte_flow_error_set(error, ENOTSUP,
+					RTE_FLOW_ERROR_TYPE_ACTION,
+					actions,
+					"Can't change header "
+					"with ICMPv6 proto");
 			/* Count all modify-header actions as one action. */
 			if (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))
 				++actions_n;
-- 
2.18.1


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix icmpv6 header rewrite actions
  2020-01-22 14:37 [dpdk-dev] [PATCH] net/mlx5: fix icmpv6 header rewrite actions Shiri Kuzin
@ 2020-01-26 16:53 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2020-01-26 16:53 UTC (permalink / raw)
  To: Shiri Kuzin, dev
  Cc: Matan Azrad, Ori Kam, Slava Ovsiienko, Dekel Peled, stable

Hi,

> -----Original Message-----
> From: Shiri Kuzin <shirik@mellanox.com>
> Sent: Wednesday, January 22, 2020 4:38 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Raslan Darawsheh
> <rasland@mellanox.com>; Ori Kam <orika@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Dekel Peled <dekelp@mellanox.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix icmpv6 header rewrite actions
> 
> the ConnectX-5 HW cannot calculate the checksum for ICMPv6, therefore
> flows with pattern 'ipv6 proto is 58' with actions that change the header
> should be rejected. the actions that change the header in this type of flow
> are 'set_ipv6_src' and 'set_ipv6_dst'.
> 
> Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
> Cc: dekelp@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> 
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 26dbaaf329..2475ff336e 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -4447,6 +4447,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const
> struct rte_flow_attr *attr,
>  	uint8_t next_protocol = 0xff;
>  	uint16_t ether_type = 0;
>  	int actions_n = 0;
> +	uint8_t item_ipv6_proto = 0;
>  	const struct rte_flow_item *gre_item = NULL;
>  	struct rte_flow_item_tcp nic_tcp_mask = {
>  		.hdr = {
> @@ -4554,6 +4555,9 @@ flow_dv_validate(struct rte_eth_dev *dev, const
> struct rte_flow_attr *attr,
>  			if (items->mask != NULL &&
>  			    ((const struct rte_flow_item_ipv6 *)
>  			     items->mask)->hdr.proto) {
> +				item_ipv6_proto =
> +					((const struct rte_flow_item_ipv6 *)
> +					 items->spec)->hdr.proto;
>  				next_protocol =
>  					((const struct rte_flow_item_ipv6 *)
>  					 items->spec)->hdr.proto;
> @@ -4926,6 +4930,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const
> struct rte_flow_attr *attr,
>  								  error);
>  			if (ret < 0)
>  				return ret;
> +			if (item_ipv6_proto == IPPROTO_ICMPV6)
> +				return rte_flow_error_set(error, ENOTSUP,
> +					RTE_FLOW_ERROR_TYPE_ACTION,
> +					actions,
> +					"Can't change header "
> +					"with ICMPv6 proto");
>  			/* Count all modify-header actions as one action. */
>  			if (!(action_flags &
> MLX5_FLOW_MODIFY_HDR_ACTIONS))
>  				++actions_n;
> --
> 2.18.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2020-01-26 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22 14:37 [dpdk-dev] [PATCH] net/mlx5: fix icmpv6 header rewrite actions Shiri Kuzin
2020-01-26 16:53 ` Raslan Darawsheh

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).