net/mlx5: fix crash in tunnel offload setup
authorGregory Etelson <getelson@nvidia.com>
Mon, 16 Nov 2020 14:02:23 +0000 (16:02 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 20 Nov 2020 20:10:04 +0000 (21:10 +0100)
commita0e4728c430c5d0367bf85d29b5063d456d5da5f
tree8c9ea221577f845967b2ad5e36427576232a942f
parent868d2e342cf3eb5120cfcacc2488a6c21cdc6f3a
net/mlx5: fix crash in tunnel offload setup

The new flow table resource management API triggered a PMD crash in
tunnel offload mode, when tunnel match flow rule was inserted before
tunnel set rule.

Reason for the crash was double flow table registration. The table was
registered by the tunnel offload code for the first time and once
more by PMD code, as part of general table processing. The table
counter was decremented only once during the rule destruction and
caused a resource leak that triggered the crash.

The patch updates PMD registration with tunnel offload parameters and
removes table registration in tunnel related code.

Fixes: afd7a62514ad ("net/mlx5: make flow table cache thread safe")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow_dv.c