patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix flow split combined with age action
@ 2021-01-17  9:40 Dekel Peled
  2021-01-17  9:45 ` Matan Azrad
  2021-01-21 12:11 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Dekel Peled @ 2021-01-17  9:40 UTC (permalink / raw)
  To: matan, shahafs, viacheslavo; +Cc: dev, stable

Currently, for a flow containing an age action, if flow is split to
sub-flows, a new age action will be created for each sub-flow.
However only the action created for the last sub-flow will be queried
on flow query and cleared on flow removal.

This behavior is wrong, causing a leak of resources.
Need to create just one action per flow, and use it for all sub-flows.

This patch adds the required check to make sure an age action is
created just once per flow, and used by all sub-flows.

Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 860ef9aa01..11adc138f8 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -10077,14 +10077,22 @@ flow_dv_translate(struct rte_eth_dev *dev,
 			break;
 		case RTE_FLOW_ACTION_TYPE_AGE:
 			if (priv->sh->flow_hit_aso_en && attr->group) {
-				flow->age = flow_dv_translate_create_aso_age
-						(dev, action->conf, error);
-				if (!flow->age)
-					return rte_flow_error_set
+				/*
+				 * Create one shared age action, to be used
+				 * by all sub-flows.
+				 */
+				if (!flow->age) {
+					flow->age =
+						flow_dv_translate_create_aso_age
+							(dev, action->conf,
+							 error);
+					if (!flow->age)
+						return rte_flow_error_set
 						(error, rte_errno,
 						 RTE_FLOW_ERROR_TYPE_ACTION,
 						 NULL,
 						 "can't create ASO age action");
+				}
 				dev_flow->dv.actions[actions_n++] =
 					  (flow_aso_age_get_by_idx
 						(dev, flow->age))->dr_action;
-- 
2.25.1


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

* Re: [dpdk-stable] [PATCH] net/mlx5: fix flow split combined with age action
  2021-01-17  9:40 [dpdk-stable] [PATCH] net/mlx5: fix flow split combined with age action Dekel Peled
@ 2021-01-17  9:45 ` Matan Azrad
  2021-01-21 12:11 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Matan Azrad @ 2021-01-17  9:45 UTC (permalink / raw)
  To: Dekel Peled, Shahaf Shuler, Slava Ovsiienko; +Cc: dev, stable



From: Dekel Peled <dekelp@nvidia.com>
> Currently, for a flow containing an age action, if flow is split to sub-flows, a new
> age action will be created for each sub-flow.
> However only the action created for the last sub-flow will be queried on flow
> query and cleared on flow removal.
> 
> This behavior is wrong, causing a leak of resources.
> Need to create just one action per flow, and use it for all sub-flows.
> 
> This patch adds the required check to make sure an age action is created just
> once per flow, and used by all sub-flows.
> 
> Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix flow split combined with age action
  2021-01-17  9:40 [dpdk-stable] [PATCH] net/mlx5: fix flow split combined with age action Dekel Peled
  2021-01-17  9:45 ` Matan Azrad
@ 2021-01-21 12:11 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2021-01-21 12:11 UTC (permalink / raw)
  To: Dekel Peled, Matan Azrad, Shahaf Shuler, Slava Ovsiienko; +Cc: dev, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Sunday, January 17, 2021 11:41 AM
> To: Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow split combined with age
> action
> 
> Currently, for a flow containing an age action, if flow is split to
> sub-flows, a new age action will be created for each sub-flow.
> However only the action created for the last sub-flow will be queried
> on flow query and cleared on flow removal.
> 
> This behavior is wrong, causing a leak of resources.
> Need to create just one action per flow, and use it for all sub-flows.
> 
> This patch adds the required check to make sure an age action is
> created just once per flow, and used by all sub-flows.
> 
> Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> ---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2021-01-21 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17  9:40 [dpdk-stable] [PATCH] net/mlx5: fix flow split combined with age action Dekel Peled
2021-01-17  9:45 ` Matan Azrad
2021-01-21 12:11 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/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 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

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


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