]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5e: Replace recursive VLAN push handling with an iterative loop
authorGal Pressman <gal@nvidia.com>
Tue, 8 Jul 2025 21:16:25 +0000 (00:16 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Jul 2025 02:47:43 +0000 (19:47 -0700)
commitc0ca344d796cf00c169f63f09eea0f4905778be1
treeb25adbfa8d3fd1b3d0b8c7769feac7e3b55607cc
parent122d86aa2a0c8950ea958a3d258eccbb5872bd68
net/mlx5e: Replace recursive VLAN push handling with an iterative loop

mlx5e_tc_act_vlan_add_push_action() uses tail-recursion to walk through
a stack of VLAN devices.

There is no need for a complicated recursion with unnecessary stack
consumption and less obvious code flow, rewrite the function so that it
uses a do while loop instead.

Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/1752009387-13300-4-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c