net/bnxt: remove addition of a temporary filter
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Mon, 8 Jan 2018 20:24:33 +0000 (12:24 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
filter1 which is used to just get the l2 filter FW id and not used
later was unnecessarily being inserted into a list and was not being
freed after it's use was done.
Fix it by not doing the list insertion and releasing it back to the free
filter pool.

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 65d30fb..2c9b7c7 100644 (file)
@@ -806,7 +806,6 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
                bnxt_free_filter(bp, filter1);
                return NULL;
        }
-       STAILQ_INSERT_TAIL(&vnic->filter, filter1, next);
        return filter1;
 }
 
@@ -957,7 +956,11 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
                goto ret;
        }
 
-//done:
+       if (filter1) {
+               bnxt_free_filter(bp, filter1);
+               filter1->fw_l2_filter_id = -1;
+       }
+
        act = nxt_non_void_action(++act);
        if (act->type != RTE_FLOW_ACTION_TYPE_END) {
                rte_flow_error_set(error, EINVAL,