* [PATCH] net/mlx5: fix error infomation missing
@ 2022-02-15 10:10 Suanming Mou
2022-02-22 14:45 ` Raslan Darawsheh
0 siblings, 1 reply; 2+ messages in thread
From: Suanming Mou @ 2022-02-15 10:10 UTC (permalink / raw)
To: viacheslavo, matan; +Cc: rasland, dev, stable
While mlx5_hlist_create() failed, the rte_flow_error was not filled
with the corresponding error information.
This commit adds the missing rte_flow_error_set() for the failure case.
Fixes: f3020a331dca ("net/mlx5: optimize hash list table allocate on demand")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index ef9c66eddf..05456ff196 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -312,7 +312,8 @@ flow_dv_hlist_prepare(struct mlx5_dev_ctx_shared *sh, struct mlx5_hlist **phl,
mlx5_list_match_cb cb_match,
mlx5_list_remove_cb cb_remove,
mlx5_list_clone_cb cb_clone,
- mlx5_list_clone_free_cb cb_clone_free)
+ mlx5_list_clone_free_cb cb_clone_free,
+ struct rte_flow_error *error)
{
struct mlx5_hlist *hl;
struct mlx5_hlist *expected = NULL;
@@ -327,7 +328,9 @@ flow_dv_hlist_prepare(struct mlx5_dev_ctx_shared *sh, struct mlx5_hlist **phl,
cb_clone_free);
if (!hl) {
DRV_LOG(ERR, "%s hash creation failed", name);
- rte_errno = ENOMEM;
+ rte_flow_error_set(error, ENOMEM,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+ "cannot allocate resource memory");
return NULL;
}
if (!__atomic_compare_exchange_n(phl, &expected, hl, false,
@@ -3725,7 +3728,8 @@ flow_dv_encap_decap_resource_register
flow_dv_encap_decap_match_cb,
flow_dv_encap_decap_remove_cb,
flow_dv_encap_decap_clone_cb,
- flow_dv_encap_decap_clone_free_cb);
+ flow_dv_encap_decap_clone_free_cb,
+ error);
if (unlikely(!encaps_decaps))
return -rte_errno;
resource->flags = dev_flow->dv.group ? 0 : 1;
@@ -5821,7 +5825,8 @@ flow_dv_modify_hdr_resource_register
flow_dv_modify_match_cb,
flow_dv_modify_remove_cb,
flow_dv_modify_clone_cb,
- flow_dv_modify_clone_free_cb);
+ flow_dv_modify_clone_free_cb,
+ error);
if (unlikely(!modify_cmds))
return -rte_errno;
resource->root = !dev_flow->dv.group;
@@ -10758,7 +10763,8 @@ flow_dv_tag_resource_register
flow_dv_tag_match_cb,
flow_dv_tag_remove_cb,
flow_dv_tag_clone_cb,
- flow_dv_tag_clone_free_cb);
+ flow_dv_tag_clone_free_cb,
+ error);
if (unlikely(!tag_table))
return -rte_errno;
entry = mlx5_hlist_register(tag_table, tag_be24, &ctx);
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] net/mlx5: fix error infomation missing
2022-02-15 10:10 [PATCH] net/mlx5: fix error infomation missing Suanming Mou
@ 2022-02-22 14:45 ` Raslan Darawsheh
0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2022-02-22 14:45 UTC (permalink / raw)
To: Suanming Mou, Slava Ovsiienko, Matan Azrad; +Cc: dev, stable
Hi,
> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Tuesday, February 15, 2022 12:11 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Cc: Raslan Darawsheh <rasland@nvidia.com>; dev@dpdk.org;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix error infomation missing
>
Fixed typo in the title:
infomation => information
> While mlx5_hlist_create() failed, the rte_flow_error was not filled
> with the corresponding error information.
>
> This commit adds the missing rte_flow_error_set() for the failure case.
>
> Fixes: f3020a331dca ("net/mlx5: optimize hash list table allocate on demand")
> Cc: stable@dpdk.org
>
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-22 14:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 10:10 [PATCH] net/mlx5: fix error infomation missing Suanming Mou
2022-02-22 14:45 ` 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).