net/mlx5: workaround drop action with old kernel
[dpdk.git] / drivers / net / bnxt / bnxt_flow.c
index 03c7173..59489b5 100644 (file)
@@ -1577,10 +1577,7 @@ bnxt_flow_validate(struct rte_eth_dev *dev,
        vnic = find_matching_vnic(bp, filter);
        if (vnic) {
                if (STAILQ_EMPTY(&vnic->filter)) {
-                       rte_free(vnic->fw_grp_ids);
-                       bnxt_hwrm_vnic_ctx_free(bp, vnic);
-                       bnxt_hwrm_vnic_free(bp, vnic);
-                       vnic->rx_queue_cnt = 0;
+                       bnxt_vnic_cleanup(bp, vnic);
                        bp->nr_vnics--;
                        PMD_DRV_LOG(DEBUG, "Free VNIC\n");
                }
@@ -1969,12 +1966,20 @@ static int bnxt_handle_tunnel_redirect_destroy(struct bnxt *bp,
                /* Tunnel doesn't belong to this VF, so don't send HWRM
                 * cmd, just delete the flow from driver
                 */
-               if (bp->fw_fid != (tun_dst_fid + bp->first_vf_id))
+               if (bp->fw_fid != (tun_dst_fid + bp->first_vf_id)) {
                        PMD_DRV_LOG(ERR,
                                    "Tunnel does not belong to this VF, skip hwrm_tunnel_redirect_free\n");
-               else
+               } else {
                        ret = bnxt_hwrm_tunnel_redirect_free(bp,
                                                        filter->tunnel_type);
+                       if (ret) {
+                               rte_flow_error_set(error, -ret,
+                                                  RTE_FLOW_ERROR_TYPE_HANDLE,
+                                                  NULL,
+                                                  "Unable to free tunnel redirection");
+                               return ret;
+                       }
+               }
        }
        return ret;
 }
@@ -2037,12 +2042,7 @@ done:
                 */
                if (vnic && !vnic->func_default &&
                    STAILQ_EMPTY(&vnic->flow_list)) {
-                       rte_free(vnic->fw_grp_ids);
-                       if (vnic->rx_queue_cnt > 1)
-                               bnxt_hwrm_vnic_ctx_free(bp, vnic);
-
-                       bnxt_hwrm_vnic_free(bp, vnic);
-                       vnic->rx_queue_cnt = 0;
+                       bnxt_vnic_cleanup(bp, vnic);
                        bp->nr_vnics--;
                }
        } else {