net/bnxt: fix flow destroy
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 17 Apr 2018 01:11:19 +0000 (18:11 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 14:54:55 +0000 (15:54 +0100)
bnxt_hwrm_clear_l2_filter needs to be called only if the filter type
is L2 and not otherwise.
Also check for the return value of bnxt_hwrm_clear_l2_filter().

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_filter.c

index d28c040..1793495 100644 (file)
@@ -1144,8 +1144,8 @@ bnxt_flow_destroy(struct rte_eth_dev *dev,
                ret = bnxt_hwrm_clear_em_filter(bp, filter);
        if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER)
                ret = bnxt_hwrm_clear_ntuple_filter(bp, filter);
-
-       bnxt_hwrm_clear_l2_filter(bp, filter);
+       else
+               ret = bnxt_hwrm_clear_l2_filter(bp, filter);
        if (!ret) {
                STAILQ_REMOVE(&vnic->flow_list, flow, rte_flow, next);
                rte_free(flow);