]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: TC, Refactor sample offload error flow
authorRoi Dayan <roid@nvidia.com>
Tue, 14 Sep 2021 08:32:51 +0000 (11:32 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 5 Oct 2021 01:10:52 +0000 (18:10 -0700)
commite5881a22f3d4b2089a77d7a589b98d65322c51ca
treefe109855bf4c6137c929b93637930bbe49520303
parent1af34eb2c065b14ab26e1e2c8f984c373e4f2c34
net/mlx5e: TC, Refactor sample offload error flow

Refactor sample unoffload to be symmetric to sample offload.
Use the existing del_post_rule() to release the post rule.
Also mlx5e_tc_sample_unoffload() should not return post_rule
which is NULL when post actions are supported.
Sample offload works with this NULL because many places of the
code use IS_ERR() instead of IS_ERR_OR_NULL() to check rule is valid
and when rule is detected as sample offload the code is not using the
rule. Let's be persistent and avoid returning NULL anyway and return the
pre rule, like in CT case, which is not NULL.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Chris Mi <cmi@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c