net/bnxt: fix alloc filter to use a common routine
authorSomnath Kotur <somnath.kotur@broadcom.com>
Tue, 28 Jan 2020 07:29:15 +0000 (12:59 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 5 Feb 2020 08:51:20 +0000 (09:51 +0100)
Invoke bnxt_get_unused_filter() inside bnxt_alloc_filter() so that
all filters are allocated from one common routine.

Fixes: f92735db1e4c ("net/bnxt: add L2 filter alloc/init/free")
Cc: stable@dpdk.org
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_filter.c

index b31f104..e218433 100644 (file)
@@ -26,13 +26,11 @@ struct bnxt_filter_info *bnxt_alloc_filter(struct bnxt *bp)
 {
        struct bnxt_filter_info *filter;
 
-       /* Find the 1st unused filter from the free_filter_list pool*/
-       filter = STAILQ_FIRST(&bp->free_filter_list);
+       filter = bnxt_get_unused_filter(bp);
        if (!filter) {
                PMD_DRV_LOG(ERR, "No more free filter resources\n");
                return NULL;
        }
-       STAILQ_REMOVE_HEAD(&bp->free_filter_list, next);
 
        filter->mac_index = INVALID_MAC_INDEX;
        /* Default to L2 MAC Addr filter */