[dpdk-dev] net/bnxt: fix fdir filter code

Message ID 20171027155334.46788-1-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ajit Khaparde Oct. 27, 2017, 3:53 p.m. UTC
  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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit Oct. 31, 2017, 12:48 a.m. UTC | #1
On 10/27/2017 8:53 AM, Ajit Khaparde wrote:
> 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>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b6c1daec7..888d794a1 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -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);