net/mlx5: add meter attach and detach
authorSuanming Mou <suanmingm@mellanox.com>
Fri, 8 Nov 2019 03:49:21 +0000 (05:49 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 Nov 2019 13:23:02 +0000 (14:23 +0100)
commit266e9f3d361162d4cc8d8e81576742c1d3e1c914
tree69fac56d237fb97c297f8e900d0b707429b2e7f4
parentfab7f7d45049e6f1d13729b68b396263ee45ece5
net/mlx5: add meter attach and detach

Add the meter attach and detach for the flow create.

When create the flow with meter, first try to find any created meter
action matches the flow meter id. If the meter action is already
created, just attach to it and increase the ref_cnt. If not, create
one.

For the dettach, decrease the ref_cnt, destroy the meter action while
the ref_cnt decreased to zero.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_flow.h
drivers/net/mlx5/mlx5_flow_meter.c