net/enic: fix the filter type used for flow API

Message ID 20210202002423.954-1-hyonkim@cisco.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/enic: fix the filter type used for flow API |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing warning Testing issues

Commit Message

Hyong Youb Kim (hyonkim) Feb. 2, 2021, 12:24 a.m. UTC
  The filter type (struct filter_v2.type) should always be set to
FILTER_DPDK_1, when advanced filtering is enabled in
firmware. Otherwise, for some old firmware versions, the driver sets
it to FILTER_USNIC_IP, and attempts to install filters fail. This
behavior matches that of the now-removed flow director implementation
(enic_clsf.c).

Fixes: 26faa126d87e ("net/enic: flow API for NICs with advanced filters disabled")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_flow.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Ferruh Yigit Feb. 2, 2021, 12:57 p.m. UTC | #1
On 2/2/2021 12:24 AM, Hyong Youb Kim wrote:
> The filter type (struct filter_v2.type) should always be set to
> FILTER_DPDK_1, when advanced filtering is enabled in
> firmware. Otherwise, for some old firmware versions, the driver sets
> it to FILTER_USNIC_IP, and attempts to install filters fail. This
> behavior matches that of the now-removed flow director implementation
> (enic_clsf.c).
> 
> Fixes: 26faa126d87e ("net/enic: flow API for NICs with advanced filters disabled")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
> Reviewed-by: John Daley <johndale@cisco.com>

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

Patch

diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index 97ee7509ce..7eb06f889e 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -1598,6 +1598,8 @@  enic_flow_parse(struct rte_eth_dev *dev,
 		return -rte_errno;
 	}
 	enic_filter->type = enic->flow_filter_mode;
+	if (enic->adv_filters)
+		enic_filter->type = FILTER_DPDK_1;
 	ret = enic_copy_filter(pattern, enic_filter_cap, enic,
 				       enic_filter, error);
 	return ret;