net/mlx5: DR, Fix 'stack frame size exceeds limit' error in dr_rule
If the kernel configuration asks the compiler to check frame limit of 1K,
dr_rule_create_rule_nic exceed this limit:
"stack frame size (1184) exceeds limit (1024)"
Fixing this issue by checking configured frame limit and using the
optimization STE array only for cases with the usual 2K (or larger)
stack size warning.
Fixes: b9b81e1e93
("net/mlx5: DR, For short chains of STEs, avoid allocating ste_arr dynamically")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
This commit is contained in:
parent
2ea26b4de6
commit
17b3222e94
@ -3,7 +3,12 @@
|
||||
|
||||
#include "dr_types.h"
|
||||
|
||||
#if defined(CONFIG_FRAME_WARN) && (CONFIG_FRAME_WARN < 2048)
|
||||
/* don't try to optimize STE allocation if the stack is too constaraining */
|
||||
#define DR_RULE_MAX_STES_OPTIMIZED 0
|
||||
#else
|
||||
#define DR_RULE_MAX_STES_OPTIMIZED 5
|
||||
#endif
|
||||
#define DR_RULE_MAX_STE_CHAIN_OPTIMIZED (DR_RULE_MAX_STES_OPTIMIZED + DR_ACTION_MAX_STES)
|
||||
|
||||
static int dr_rule_append_to_miss_list(struct mlx5dr_domain *dmn,
|
||||
@ -1218,10 +1223,7 @@ dr_rule_create_rule_nic(struct mlx5dr_rule *rule,
|
||||
|
||||
mlx5dr_domain_nic_unlock(nic_dmn);
|
||||
|
||||
if (unlikely(!hw_ste_arr_is_opt))
|
||||
kfree(hw_ste_arr);
|
||||
|
||||
return 0;
|
||||
goto out;
|
||||
|
||||
free_rule:
|
||||
dr_rule_clean_rule_members(rule, nic_rule);
|
||||
@ -1238,6 +1240,7 @@ remove_from_nic_tbl:
|
||||
free_hw_ste:
|
||||
mlx5dr_domain_nic_unlock(nic_dmn);
|
||||
|
||||
out:
|
||||
if (unlikely(!hw_ste_arr_is_opt))
|
||||
kfree(hw_ste_arr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user