net/mlx5: DR, For short chains of STEs, avoid allocating ste_arr dynamically
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Tue, 29 Mar 2022 12:23:55 +0000 (15:23 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 27 Oct 2022 14:50:38 +0000 (15:50 +0100)
commitb9b81e1e93820eb47aeaf0fe7cdda535adf8e7a4
tree9f8fdf5581ccf126098f27b1815cba21d8947baf
parentd277b55f0fa805dbcabef8b4c3295a2cd6506581
net/mlx5: DR, For short chains of STEs, avoid allocating ste_arr dynamically

While creating rule, ste_arr is an array that is allocated at the start
of the function and freed at the end.
This memory allocation can sometimes lead to "hiccups" of up to 10ms.
However, the common use case is short chains of STEs. For such cases,
we can use a local buffer on stack instead.

Changes in v2:
  Use small local array for short rules, allocate dynamically for long rules

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c