net/mlx5: optimize tag traversal with hash list
[dpdk.git] / drivers / net / bnxt / bnxt_filter.c
index 8120b39..da1a6c2 100644 (file)
@@ -34,6 +34,7 @@ struct bnxt_filter_info *bnxt_alloc_filter(struct bnxt *bp)
        }
        STAILQ_REMOVE_HEAD(&bp->free_filter_list, next);
 
+       filter->mac_index = INVALID_MAC_INDEX;
        /* Default to L2 MAC Addr filter */
        filter->flags = HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX;
        filter->enables = HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR |
@@ -60,7 +61,7 @@ struct bnxt_filter_info *bnxt_alloc_vf_filter(struct bnxt *bp, uint16_t vf)
        return filter;
 }
 
-void bnxt_init_filters(struct bnxt *bp)
+static void bnxt_init_filters(struct bnxt *bp)
 {
        struct bnxt_filter_info *filter;
        int i, max_filters;
@@ -120,6 +121,10 @@ void bnxt_free_filter_mem(struct bnxt *bp)
                    filter->filter_type == HWRM_CFA_NTUPLE_FILTER) {
                        /* Call HWRM to try to free filter again */
                        rc = bnxt_hwrm_clear_ntuple_filter(bp, filter);
+                       if (rc)
+                               PMD_DRV_LOG(ERR,
+                                           "Cannot free ntuple filter: %d\n",
+                                           rc);
                }
                filter->fw_ntuple_filter_id = UINT64_MAX;
 
@@ -166,6 +171,7 @@ int bnxt_alloc_filter_mem(struct bnxt *bp)
                return -ENOMEM;
        }
        bp->filter_info = filter_mem;
+       bnxt_init_filters(bp);
        return 0;
 }