]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: TC, Add missing policer validation
authorRoi Dayan <roid@nvidia.com>
Mon, 1 Aug 2022 15:02:49 +0000 (18:02 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 22 Aug 2022 19:57:09 +0000 (12:57 -0700)
There is a missing policer validation when offloading police action
with tc action api. Add it.

Fixes: 03900dd2b103 ("net/mlx5e: TC, Support tc action api for police")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c

index 37522352e4b23011d17fd8225b7438452e77e868..c8e5ca65bb6ec395116352f0a5816b4e03026f1f 100644 (file)
@@ -79,6 +79,10 @@ tc_act_police_offload(struct mlx5e_priv *priv,
        struct mlx5e_flow_meter_handle *meter;
        int err = 0;
 
+       err = mlx5e_policer_validate(&fl_act->action, act, fl_act->extack);
+       if (err)
+               return err;
+
        err = fill_meter_params_from_act(act, &params);
        if (err)
                return err;