DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/mlx5: fix resetting verbs hash fields
@ 2020-05-04  6:38 Ophir Munk
  2020-05-05  6:16 ` [dpdk-dev] [PATCH v2] " Ophir Munk
  0 siblings, 1 reply; 4+ messages in thread
From: Ophir Munk @ 2020-05-04  6:38 UTC (permalink / raw)
  To: dev, Raslan Darawsheh; +Cc: Ophir Munk

The flow_verbs_translate() function accumulates hash fields while
iterating through the flow items (SRC_IPV4, DST_IPV4, SRC_IPV6,
DST_IPV6, SRC_PORT_TCP, DST_PORT_TCP, SRC_PORT_UDP, DST_PORT_UDP).
Before this commit the dev_flow handle structure was reused in each new
flow_verbs_translate() call, however the dev_flow->hash_fields variable
was not reset before each call. As a result hash_fields from previous
calls remained present in the current flow which lead to invalid
combinations (e.g.  simultaneous IPv4 and IPv6 specs). This scenario
happens for example in the next flows sequence, when running in verbs
mode (dv_flow_en=0).

flow create 0 ingress group 0 pattern eth / ipv4 / end <rss actions>
flow create 0 ingress group 0 pattern eth / ipv6 / end <rss actions>

The fix is to reset dev_flow->hash_fields in flow_verbs_translate()
for each new call.

Fixes: e7bfa3596a0a ("net/mlx5: separate the flow handle resource")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_verbs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index 7efd97f..d9aec49 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c
@@ -1628,6 +1628,7 @@ flow_verbs_translate(struct rte_eth_dev *dev,
 		}
 	}
 	dev_flow->act_flags = action_flags;
+	dev_flow->hash_fields = 0;
 	for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {
 		int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
 
-- 
2.8.4


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

* [dpdk-dev] [PATCH v2] net/mlx5: fix resetting verbs hash fields
  2020-05-04  6:38 [dpdk-dev] [PATCH v1] net/mlx5: fix resetting verbs hash fields Ophir Munk
@ 2020-05-05  6:16 ` Ophir Munk
  2020-05-05  9:08   ` Matan Azrad
  2020-05-05 10:40   ` Raslan Darawsheh
  0 siblings, 2 replies; 4+ messages in thread
From: Ophir Munk @ 2020-05-05  6:16 UTC (permalink / raw)
  To: dev; +Cc: Ophir Munk, Raslan Darawsheh, Matan Azrad

The flow_verbs_translate() function accumulates hash fields while
iterating through the flow items (SRC_IPV4, DST_IPV4, SRC_IPV6,
DST_IPV6, SRC_PORT_TCP, DST_PORT_TCP, SRC_PORT_UDP, DST_PORT_UDP).
Before this commit the dev_flow handle structure was reused in each new
flow_verbs_translate() call, however the dev_flow->hash_fields variable
was not reset before each call. As a result hash_fields from previous
calls remained present in the current flow which lead to invalid
combinations (e.g.  simultaneous IPv4 and IPv6 specs). This scenario
happens for example in the next flows sequence, when running in verbs
mode (dv_flow_en=0).

flow create 0 ingress group 0 pattern eth / ipv4 / end <rss actions>
flow create 0 ingress group 0 pattern eth / ipv6 / end <rss actions>

The fix is to reset dev_flow->hash_fields in flow_verbs_prepare().

Fixes: e7bfa3596a0a ("net/mlx5: separate the flow handle resource")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_verbs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index 7efd97f..4659f0a 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c
@@ -1539,6 +1539,7 @@ flow_verbs_prepare(struct rte_eth_dev *dev,
 	dev_flow->verbs.size = 0;
 	dev_flow->verbs.attr.num_of_specs = 0;
 	dev_flow->ingress = attr->ingress;
+	dev_flow->hash_fields = 0;
 	/* Need to set transfer attribute: not supported in Verbs mode. */
 	return dev_flow;
 }
-- 
2.8.4


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

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix resetting verbs hash fields
  2020-05-05  6:16 ` [dpdk-dev] [PATCH v2] " Ophir Munk
@ 2020-05-05  9:08   ` Matan Azrad
  2020-05-05 10:40   ` Raslan Darawsheh
  1 sibling, 0 replies; 4+ messages in thread
From: Matan Azrad @ 2020-05-05  9:08 UTC (permalink / raw)
  To: Ophir Munk, dev; +Cc: Ophir Munk, Raslan Darawsheh



> -----Original Message-----
> From: Ophir Munk <ophirmu@mellanox.com>
> Sent: Tuesday, May 5, 2020 9:16 AM
> To: dev@dpdk.org
> Cc: Ophir Munk <ophirmu@mellanox.com>; Raslan Darawsheh
> <rasland@mellanox.com>; Matan Azrad <matan@mellanox.com>
> Subject: [PATCH v2] net/mlx5: fix resetting verbs hash fields
> 
> The flow_verbs_translate() function accumulates hash fields while iterating
> through the flow items (SRC_IPV4, DST_IPV4, SRC_IPV6, DST_IPV6,
> SRC_PORT_TCP, DST_PORT_TCP, SRC_PORT_UDP, DST_PORT_UDP).
> Before this commit the dev_flow handle structure was reused in each new
> flow_verbs_translate() call, however the dev_flow->hash_fields variable
> was not reset before each call. As a result hash_fields from previous calls
> remained present in the current flow which lead to invalid combinations (e.g.
> simultaneous IPv4 and IPv6 specs). This scenario happens for example in the
> next flows sequence, when running in verbs mode (dv_flow_en=0).
> 
> flow create 0 ingress group 0 pattern eth / ipv4 / end <rss actions> flow
> create 0 ingress group 0 pattern eth / ipv6 / end <rss actions>
> 
> The fix is to reset dev_flow->hash_fields in flow_verbs_prepare().
> 
> Fixes: e7bfa3596a0a ("net/mlx5: separate the flow handle resource")
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

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

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix resetting verbs hash fields
  2020-05-05  6:16 ` [dpdk-dev] [PATCH v2] " Ophir Munk
  2020-05-05  9:08   ` Matan Azrad
@ 2020-05-05 10:40   ` Raslan Darawsheh
  1 sibling, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2020-05-05 10:40 UTC (permalink / raw)
  To: Ophir Munk, dev; +Cc: Ophir Munk, Matan Azrad

Hi,
> -----Original Message-----
> From: Ophir Munk <ophirmu@mellanox.com>
> Sent: Tuesday, May 5, 2020 9:16 AM
> To: dev@dpdk.org
> Cc: Ophir Munk <ophirmu@mellanox.com>; Raslan Darawsheh
> <rasland@mellanox.com>; Matan Azrad <matan@mellanox.com>
> Subject: [PATCH v2] net/mlx5: fix resetting verbs hash fields
> 
> The flow_verbs_translate() function accumulates hash fields while
> iterating through the flow items (SRC_IPV4, DST_IPV4, SRC_IPV6,
> DST_IPV6, SRC_PORT_TCP, DST_PORT_TCP, SRC_PORT_UDP,
> DST_PORT_UDP).
> Before this commit the dev_flow handle structure was reused in each new
> flow_verbs_translate() call, however the dev_flow->hash_fields variable
> was not reset before each call. As a result hash_fields from previous
> calls remained present in the current flow which lead to invalid
> combinations (e.g.  simultaneous IPv4 and IPv6 specs). This scenario
> happens for example in the next flows sequence, when running in verbs
> mode (dv_flow_en=0).
> 
> flow create 0 ingress group 0 pattern eth / ipv4 / end <rss actions>
> flow create 0 ingress group 0 pattern eth / ipv6 / end <rss actions>
> 
> The fix is to reset dev_flow->hash_fields in flow_verbs_prepare().
> 
> Fixes: e7bfa3596a0a ("net/mlx5: separate the flow handle resource")
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_verbs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c
> b/drivers/net/mlx5/mlx5_flow_verbs.c
> index 7efd97f..4659f0a 100644
> --- a/drivers/net/mlx5/mlx5_flow_verbs.c
> +++ b/drivers/net/mlx5/mlx5_flow_verbs.c
> @@ -1539,6 +1539,7 @@ flow_verbs_prepare(struct rte_eth_dev *dev,
>  	dev_flow->verbs.size = 0;
>  	dev_flow->verbs.attr.num_of_specs = 0;
>  	dev_flow->ingress = attr->ingress;
> +	dev_flow->hash_fields = 0;
>  	/* Need to set transfer attribute: not supported in Verbs mode. */
>  	return dev_flow;
>  }
> --
> 2.8.4


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


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

end of thread, other threads:[~2020-05-05 10:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04  6:38 [dpdk-dev] [PATCH v1] net/mlx5: fix resetting verbs hash fields Ophir Munk
2020-05-05  6:16 ` [dpdk-dev] [PATCH v2] " Ophir Munk
2020-05-05  9:08   ` Matan Azrad
2020-05-05 10:40   ` Raslan Darawsheh

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git