net/bnxt: fix reusing L2 filter
authorSomnath Kotur <somnath.kotur@broadcom.com>
Sat, 21 Dec 2019 02:29:41 +0000 (18:29 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jan 2020 18:46:01 +0000 (19:46 +0100)
commitf0f6b5e6cf94e75cd419bb1bc37463bbc7884110
tree6ecd9d3451fc229e868668e467abd3210ba085ef
parent5c63167168138cb5f119372814e62472bbdcd38e
net/bnxt: fix reusing L2 filter

The software L2 filter was being released back to the free pool,
though it was created in HW and the filter corresponding to an actual
'flow' would have reference to the HW L2 filter.
But if this 'flow were to be deleted, then this HW L2 filter also
would be gone.
Fix this by storing the L2 filter created originally either for an
n-tuple flow or otherwise as part of the vnic's filter list.
This would require the filter_info struct to have a backptr to the
vnic which it came from.
Now that L2 filters can be re-used for an n-tuple filter(s), delete
L2 filter as well so the reference count of an L2 filter (if reused)
can be decremented appropriately.

Fixes: 5c1171c97216 ("net/bnxt: refactor filter/flow")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_filter.h
drivers/net/bnxt/bnxt_flow.c
drivers/net/bnxt/bnxt_hwrm.c