net/mlx5: fix err message overwrite for actions translation
PATCH 1/1 net/mlx5: fix err message overwrite for actions translation
Function __flow_hw_translate_actions_template contains several encapsulated functions that already have internal error handling process via rte_flow_error_set for each case.
Thus the one (rte_flow_error_set) within the goto statement err at the end of __flow_hw_translate_actions_template function may be redundant for those failed cases. As a result, the error messages would all be overwritten as "fail to create rte table", making it displayed at quite large granularity.
To prevent above error messages overwrite, this patch add a local variable struct rte_flow_error sub_error to the function and pass this sub_error instead of error to each sub-function. Under error handling process (err label), if sub_error was updated, copy its contents to error and return. If it was not updated, return default error message (fail to create rte table).
Also refactor the logic for SEND_TO_KERNEL, COUNT and AGE actions in above function to align the error handling process.
--- .mailmap | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 65 ++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 27 deletions(-)
.mailmap +1 -1
@@ -760,7 +760,7 @@ Julien Hascoet <[email protected]> Julien Massonneau <[email protected]> Julien Meunier <[email protected]> <[email protected]> Július Milan <[email protected]> -Junfeng Guo <[email protected]> +Junfeng Guo <[email protected]> <[email protected]> Junjie Chen <[email protected]> Junjie Wan <[email protected]> Junlong Wang <[email protected]>
drivers/net/mlx5/mlx5_flow_hw.c +39 -26
149 lines not on this page · raw message
Signature · 1 line
2.34.1
Quoted 28 lines
-----Original Message-----
From: Junfeng Guo <[email protected]>
Sent: Thursday, February 20, 2025 08:09
To: [email protected]
Cc: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>; Minggang(Gavin) Li <[email protected]>; Jiawei(Jonny) Wang <[email protected]>; [email protected]
Subject: [PATCH] net/mlx5: fix err message overwrite for actions translationFunction
__flow_hw_translate_actions_templatecontains several encapsulated functions that already have internal error handling process viarte_flow_error_setfor each case.Thus the one (
rte_flow_error_set) within the goto statementerrat the end of__flow_hw_translate_actions_templatefunction may be redundant for those failed cases. As a result, the error messages would all be overwritten as "fail to create rte table", making it displayed at quite large granularity.To prevent above error messages overwrite, this patch add a local variable
struct rte_flow_error sub_errorto the function and pass thissub_errorinstead oferrorto each sub-function. Under error handling process (errlabel), ifsub_errorwas updated, copy its contents toerrorand return. If it was not updated, return default error message (fail to create rte table).
Quoted 8 lines
Also refactor the logic for
SEND_TO_KERNEL, COUNT and AGE actions in above function to align the error handling process.Signed-off-by Junfeng Guo <[email protected]>
Best regards,
Dariusz Sosnowski
Hi,
From: Junfeng Guo <[email protected]>
Sent: Thursday, February 20, 2025 9:08 AM
To: [email protected]
Cc: Dariusz Sosnowski; Slava Ovsiienko; Bing Zhao; Ori Kam; Suanming Mou; Matan Azrad; Minggang(Gavin) Li; Jiawei(Jonny) Wang; [email protected]
Subject: [PATCH] net/mlx5: fix err message overwrite for actions translation
Function __flow_hw_translate_actions_template contains several encapsulated functions that already have internal error handling process via rte_flow_error_set for each case.
Thus the one (rte_flow_error_set) within the goto statement err at the end of __flow_hw_translate_actions_template function may be redundant for those failed cases. As a result, the error messages would all be overwritten as "fail to create rte table", making it displayed at quite large granularity.
To prevent above error messages overwrite, this patch add a local variable struct rte_flow_error sub_error to the function and pass this sub_error instead of error to each sub-function. Under error handling process (err label), if sub_error was updated, copy its contents to error and return. If it was not updated, return default error message (fail to create rte table).
Also refactor the logic for SEND_TO_KERNEL, COUNT and AGE actions in above function to align the error handling process.
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh