diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2017-03-14 16:49:04 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2017-03-28 15:34:00 +0300 |
commit | aa0cbbae5d360ea23a15038d24f6f7c9573eecaf (patch) | |
tree | 592639dc245ad4afb02229fc37c10c882683e6db /drivers/spi | |
parent | 17091853fc0bb8354283000e065a60b8cc682f5c (diff) |
net/mlx5e: Properly deal with resource cleanup when adding TC flow fails
The code for adding tc fdb flows leaves things half set when it fails
in the middle. Currently we are not leaking things (e.g eswitch
vlan reference, encap reference and HW resources) since the main
code to add flower rules does a cleanup by calling mlx5e_tc_del_flow().
This cleanup further works just b/c we're checking there if the HW rule
for the flow we are attempting to delete is valid before touching it, and
since under the current possible combinations of supported actions it's okay
to go and blidnly deref or delete all the action related resources (encap, vlan).
Instead, do things properly, namely make sure that if add flow fails we
clean all what was allocated or referenced. Now, the flow delete code can
blindly deref/deallocate both the rule and the actions related resources and
when more action combinations are introduced (such as the upcoming header
re-write) we are fine with clear and robust code.
While here, align all of nic/fdb parse actions/add flow functions to get
mlx5e_tc_flow struct param and pick the attributes or whatever else needed
from there.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/spi')
0 files changed, 0 insertions, 0 deletions