[v1,2/5] net/hinic: fix TCAM filter set failed

Message ID 263a30d52f070480b98cd9ae4c36a95e86af7463.1600093192.git.cloud.wangxiaoyun@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series some bugs fix |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Wangxiaoyun (Cloud) Sept. 14, 2020, 2:31 p.m. UTC
  hinic supports two methods: linear table and tcam table,
if tcam filter enables failed but linear table is ok,
which also needs to enable filter, so for this scene,
driver should not close fdir switch.

Fixes: f4ca3fd54c4d ("net/hinic: create and destroy flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
---
 drivers/net/hinic/hinic_pmd_flow.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/hinic/hinic_pmd_flow.c b/drivers/net/hinic/hinic_pmd_flow.c
index 9888a87..d71a42a 100644
--- a/drivers/net/hinic/hinic_pmd_flow.c
+++ b/drivers/net/hinic/hinic_pmd_flow.c
@@ -2809,8 +2809,12 @@  static int hinic_add_tcam_filter(struct rte_eth_dev *dev,
 
 		rc = hinic_set_fdir_tcam_rule_filter(nic_dev->hwdev, true);
 		if (rc && rc != HINIC_MGMT_CMD_UNSUPPORTED) {
-			(void)hinic_set_fdir_filter(nic_dev->hwdev, 0, 0, 0,
-						false);
+			/*
+			 * hinic supports two methods: linear table and tcam
+			 * table, if tcam filter enables failed but linear table
+			 * is ok, which also needs to enable filter, so for this
+			 * scene, driver should not close fdir switch.
+			 */
 			(void)hinic_del_tcam_rule(nic_dev->hwdev,
 						fdir_tcam_rule->index);
 			return rc;