net/mlx5: call meter detach only if DR is supported
authorOphir Munk <ophirmu@mellanox.com>
Tue, 25 Aug 2020 09:31:11 +0000 (09:31 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Sep 2020 16:55:06 +0000 (18:55 +0200)
commit1e577c9e5fe49ee1b2a201ac926e7deeec19c76d
tree2fc42ce2a38cc0d0b1c7b24f7ce7861b8cb8bab1
parent079f1ae5acf591c52a19f4c5c7e30de5252176e6
net/mlx5: call meter detach only if DR is supported

Flow metering is supported only in direct rules (DR). Currently the APIs
of meter actions create and modify are under #ifdef
HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER, while detaching the meter action
is executed unconditionally. This commit adds the same ifdef to API
mlx5_flow_meter_detach().
This commit avoids compilation failure of non-Linux operating systems
which do not support DR.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/mlx5_flow_meter.c