net/mlx5: use global default miss for E-Switch sampling
cover net/mlx5: use global default miss for E-Switch sampling
This patchset fixes the E-Switch sampling flow creation issue, and also uses the global default miss for each E-Switch sampling flow.
Jiawei Wang (2):
net/mlx5: fix the E-Switch sample action creation failure net/mlx5: use global default miss for E-Switch sampling
drivers/net/mlx5/mlx5_flow.h | 1 - drivers/net/mlx5/mlx5_flow_dv.c | 23 +++++------------------ 2 files changed, 5 insertions(+), 19 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/2 net/mlx5: fix the E-Switch sample action creation failure
This patch fixes the incorrect checking for the return value of default miss action creation.
--- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -9155,7 +9155,7 @@ struct mlx5_cache_entry *if (resource->ft_type ==MLX5DV_FLOW_TABLE_TYPE_FDB ) { ret =mlx5_flow_os_create_flow_action_default_miss (&cache_resource->default_miss); -if (!ret) { +if (ret) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
Signature · 1 line
1.8.3.1
PATCH 2/2 net/mlx5: use global default miss for E-Switch sampling
In reply to Jiawei WangIn E-Switch steering domain there was dedicated default miss action created for every sampling flow.
The patch replaces this one with the global default miss action.
--- drivers/net/mlx5/mlx5_flow.h | 1 - drivers/net/mlx5/mlx5_flow_dv.c | 23 +++++------------------ 2 files changed, 5 insertions(+), 19 deletions(-)
drivers/net/mlx5/mlx5_flow.h +0 -1
@@ -598,7 +598,6 @@ struct mlx5_flow_dv_sample_resource {uint32_t ratio;/** Sample Ratio */ uint64_t set_action;/** Restore reg_c0 value */ void *normal_path_tbl;/** Flow Table pointer */ -void *default_miss;/** default_miss dr_action. */ struct mlx5_flow_sub_actions_idx sample_idx;/**< Action index resources. */ struct mlx5_flow_sub_actions_list sample_act;
drivers/net/mlx5/mlx5_flow_dv.c +5 -18
@@ -9149,22 +9149,18 @@ struct mlx5_cache_entry * "for sample"); goto error; } -int ret; - cache_resource->normal_path_tbl = tbl;if (resource->ft_type ==MLX5DV_FLOW_TABLE_TYPE_FDB ) { - ret =mlx5_flow_os_create_flow_action_default_miss - (&cache_resource->default_miss); -if (ret) { +if (!sh->default_miss_action) {rte_flow_error_set (error,ENOMEM ,RTE_FLOW_ERROR_TYPE_UNSPECIFIED ,NULL , -"cannot create default miss " -"action" ); +"default miss action was not " +"created" ); goto error; } sample_dv_actions[resource->sample_act.actions_num++] = - cache_resource->default_miss; + sh->default_miss_action; }/* Create a DR sample action */ sampler_attr.sample_ratio = cache_resource->ratio;
@@ -9184,11 +9180,7 @@ struct mlx5_cache_entry * cache_resource->dev = dev;return &cache_resource->entry; error: -if (cache_resource->ft_type ==MLX5DV_FLOW_TABLE_TYPE_FDB && - cache_resource->default_miss) -claim_zero (mlx5_flow_os_destroy_flow_action - (cache_resource->default_miss)); -else +if (cache_resource->ft_type !=MLX5DV_FLOW_TABLE_TYPE_FDB )flow_dv_sample_sub_actions_release (dev, &cache_resource->sample_idx);if (cache_resource->normal_path_tbl)
@@ -11591,11 +11583,6 @@ struct mlx5_cache_entry *if (cache_resource->verbs_action)claim_zero (mlx5_flow_os_destroy_flow_action (cache_resource->verbs_action)); -if (cache_resource->ft_type ==MLX5DV_FLOW_TABLE_TYPE_FDB ) { -if (cache_resource->default_miss) -claim_zero (mlx5_flow_os_destroy_flow_action - (cache_resource->default_miss)); - }if (cache_resource->normal_path_tbl)flow_dv_tbl_resource_release (MLX5_SH (dev), cache_resource->normal_path_tbl);
Signature · 1 line
1.8.3.1
Quoted 4 lines · Jiawei Wang
In E-Switch steering domain there was dedicated default miss action created for every sampling flow.
The patch replaces this one with the global default miss action.
Hi Jiawei,
The impact of the patch is not clear, what was the problem using action per flow? What will change when global action is used? Is this fixing some problem or is it optimization by preventing per flow action?
Quoted 2 lines
Since this looks like optimization, I am removing the stable tag for now.
If it is a fix, please reply with a fixes line, I can update it in next-net.
Quoted 2 lines
Signed-off-by Jiawei Wang <[email protected]>
27/01/2021 13:50, Ferruh Yigit:
Quoted 12 lines · Jiawei Wang
Quoted 4 lines
In E-Switch steering domain there was dedicated default miss action created for every sampling flow.
The patch replaces this one with the global default miss action.Hi Jiawei,
The impact of the patch is not clear, what was the problem using action per flow? What will change when global action is used? Is this fixing some problem or is it optimization by preventing per flow action?
Quoted 6 lines
Quoted 2 lines
Since this looks like optimization, I am removing the stable tag for now.
If it is a fix, please reply with a fixes line, I can update it in next-net.
Yes please we must avoid "Cc: stable" without a "Fixes:" line.
Hi Ferruh,
Quoted 19 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Wednesday, January 27, 2021 8:50 PM
To: Jiawei(Jonny) Wang <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Ori Kam <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; [email protected]; Kevin Traynor <[email protected]>; Luca Boccassi <[email protected]>
Subject: Re: [dpdk-stable] [PATCH 2/2] net/mlx5: use global default miss for E-Switch samplingQuoted 4 lines · Jiawei Wang
In E-Switch steering domain there was dedicated default miss action created for every sampling flow.
The patch replaces this one with the global default miss action.
Quoted 6 lines
Hi Jiawei,
The impact of the patch is not clear, what was the problem using action per flow? What will change when global action is used? Is this fixing some problem or is it optimization by preventing per flow action?
The patch is optimization not fix, MLX5 PMD can reuses the global action don’t need allocate new one each time.
Quoted 4 lines
Quoted 2 lines
Since this looks like optimization, I am removing the stable tag for now.
Yes, please remove this tag.
Thanks.
Quoted 5 lines
If it is a fix, please reply with a fixes line, I can update it in next-net.
Quoted 2 lines
Signed-off-by Jiawei Wang <[email protected]>
Hi,
Quoted 17 lines
-----Original Message-----
From: Jiawei Wang <[email protected]>
Sent: Tuesday, January 26, 2021 2:54 PM
To: Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Ori Kam <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: [PATCH 0/2] net/mlx5: use global default miss for E-Switch samplingThis patchset fixes the E-Switch sampling flow creation issue, and also uses the global
default miss for each E-Switch sampling flow.Jiawei Wang (2):
net/mlx5: fix the E-Switch sample action creation failure net/mlx5: use global default miss for E-Switch sampling
Quoted 6 lines
drivers/net/mlx5/mlx5_flow.h | 1 - drivers/net/mlx5/mlx5_flow_dv.c | 23 +++++------------------ 2 files changed, 5 insertions(+), 19 deletions(-)--
1.8.3.1
Series applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh