diff mbox series

[v2] net/i40e: fix qinq flow pattern to allow non full mask

Message ID 20201014163047.69981-1-padraig.j.connolly@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series [v2] net/i40e: fix qinq flow pattern to allow non full mask | expand

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/checkpatch success coding style OK

Commit Message

Padraig Connolly Oct. 14, 2020, 4:30 p.m. UTC
Issue reported by customer that only full mask was allowed on inner and
outer VLAN tag, thus not allowing mask to set VLAN ID filter only.
Removed check that enforces inner vlan and outer vlan to equal
I40E_TCI_MASK (full mask 0xffff).

Fixes: c2be7f9b232f ("net/i40e: fix parsing QinQ pattern")
Fixes: d37705068ee8 ("net/i40e: parse QinQ pattern")

Cc: bernard.iremonger@intel.com
Cc: stable@dpdk.org

Tested-by: Padraig Connolly <padraig.j.connolly@intel.com>
Signed-off-by: Padraig Connolly <padraig.j.connolly@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Comments

Iremonger, Bernard Oct. 15, 2020, 8:56 a.m. UTC | #1
Hi Padraig,

> -----Original Message-----
> From: Connolly, Padraig J <padraig.j.connolly@intel.com>
> Sent: Wednesday, October 14, 2020 5:31 PM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Connolly, Padraig J <padraig.j.connolly@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/i40e: fix qinq flow pattern to allow non full mask
> 
> Issue reported by customer that only full mask was allowed on inner and
> outer VLAN tag, thus not allowing mask to set VLAN ID filter only.
> Removed check that enforces inner vlan and outer vlan to equal
> I40E_TCI_MASK (full mask 0xffff).
> 
> Fixes: c2be7f9b232f ("net/i40e: fix parsing QinQ pattern")
> Fixes: d37705068ee8 ("net/i40e: parse QinQ pattern")
> 
> Cc: bernard.iremonger@intel.com
> Cc: stable@dpdk.org
> 
> Tested-by: Padraig Connolly <padraig.j.connolly@intel.com>
> Signed-off-by: Padraig Connolly <padraig.j.connolly@intel.com>
> ---
>  drivers/net/i40e/i40e_flow.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
> index adc5da1c5..8e7a9989b 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -4649,14 +4649,9 @@ i40e_flow_parse_qinq_pattern(__rte_unused
> struct rte_eth_dev *dev,
>  	}
> 
>  	/* Get filter specification */
> -	if ((o_vlan_mask != NULL) && (o_vlan_mask->tci ==
> -			rte_cpu_to_be_16(I40E_TCI_MASK)) &&
> -			(i_vlan_mask != NULL) &&
> -			(i_vlan_mask->tci ==
> rte_cpu_to_be_16(I40E_TCI_MASK))) {
> -		filter->outer_vlan = rte_be_to_cpu_16(o_vlan_spec->tci)
> -			& I40E_TCI_MASK;
> -		filter->inner_vlan = rte_be_to_cpu_16(i_vlan_spec->tci)
> -			& I40E_TCI_MASK;
> +	if (o_vlan_mask != NULL &&  i_vlan_mask != NULL) {
> +		filter->outer_vlan = rte_be_to_cpu_16(o_vlan_spec->tci);
> +		filter->inner_vlan = rte_be_to_cpu_16(i_vlan_spec->tci);
>  	} else {
>  			rte_flow_error_set(error, EINVAL,
>  					   RTE_FLOW_ERROR_TYPE_ITEM,
> --
> 2.17.1

The following fixes line can be removed:
 Fixes: c2be7f9b232f ("net/i40e: fix parsing QinQ pattern")

As the fix in the above patch is not changed by this fix.

Otherwise 

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index adc5da1c5..8e7a9989b 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4649,14 +4649,9 @@  i40e_flow_parse_qinq_pattern(__rte_unused struct rte_eth_dev *dev,
 	}
 
 	/* Get filter specification */
-	if ((o_vlan_mask != NULL) && (o_vlan_mask->tci ==
-			rte_cpu_to_be_16(I40E_TCI_MASK)) &&
-			(i_vlan_mask != NULL) &&
-			(i_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK))) {
-		filter->outer_vlan = rte_be_to_cpu_16(o_vlan_spec->tci)
-			& I40E_TCI_MASK;
-		filter->inner_vlan = rte_be_to_cpu_16(i_vlan_spec->tci)
-			& I40E_TCI_MASK;
+	if (o_vlan_mask != NULL &&  i_vlan_mask != NULL) {
+		filter->outer_vlan = rte_be_to_cpu_16(o_vlan_spec->tci);
+		filter->inner_vlan = rte_be_to_cpu_16(i_vlan_spec->tci);
 	} else {
 			rte_flow_error_set(error, EINVAL,
 					   RTE_FLOW_ERROR_TYPE_ITEM,