net/bnxt: fix flow director filter
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 27 Oct 2017 15:53:34 +0000 (10:53 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 1 Nov 2017 21:17:05 +0000 (22:17 +0100)
Set the filter_type before we match a new filter against existing
filters. Otherwise we are missing the existing filters.

Fixes: 2d64da097aa0 ("net/bnxt: support FDIR")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c

index 10735f6..61801c2 100644 (file)
@@ -2407,6 +2407,7 @@ bnxt_fdir_filter(struct rte_eth_dev *dev,
                ret = bnxt_parse_fdir_filter(bp, fdir, filter);
                if (ret != 0)
                        goto free_filter;
+               filter->filter_type = HWRM_CFA_NTUPLE_FILTER;
 
                match = bnxt_match_fdir(bp, filter);
                if (match != NULL && filter_op == RTE_ETH_FILTER_ADD) {
@@ -2427,7 +2428,6 @@ bnxt_fdir_filter(struct rte_eth_dev *dev,
                        STAILQ_FIRST(&bp->ff_pool[fdir->action.rx_queue]);
 
                if (filter_op == RTE_ETH_FILTER_ADD) {
-                       filter->filter_type = HWRM_CFA_NTUPLE_FILTER;
                        ret = bnxt_hwrm_set_ntuple_filter(bp,
                                                          filter->dst_id,
                                                          filter);