net/mlx5: fix tci mask filter

Message ID ea99ac4effbb0ab7ec01de2e068be910936fc1bf.1532330280.git.nelio.laranjeiro@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Shahaf Shuler
Headers
Series net/mlx5: fix tci mask filter |

Checks

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

Commit Message

Nélio Laranjeiro July 23, 2018, 7:18 a.m. UTC
  In mlx5_traffic_enable() the TCI mask for the VLAN is wrong causing the
sub flow engine to reject the rule.

Fixes: 272733b5ebfd ("net/mlx5: use flow to enable unicast traffic")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_trigger.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
  

Comments

Yongseok Koh July 23, 2018, 10:38 p.m. UTC | #1
> On Jul 23, 2018, at 12:18 AM, Nelio Laranjeiro <nelio.laranjeiro@6wind.com> wrote:
> 
> In mlx5_traffic_enable() the TCI mask for the VLAN is wrong causing the
> sub flow engine to reject the rule.
> 
> Fixes: 272733b5ebfd ("net/mlx5: use flow to enable unicast traffic")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks
  
Ori Kam July 24, 2018, 6:27 a.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nelio Laranjeiro
> Sent: Monday, July 23, 2018 10:19 AM
> To: dev@dpdk.org; Yongseok Koh <yskoh@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>
> Cc: stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix tci mask filter
> 
> In mlx5_traffic_enable() the TCI mask for the VLAN is wrong causing the
> sub flow engine to reject the rule.
> 
> Fixes: 272733b5ebfd ("net/mlx5: use flow to enable unicast traffic")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> ---
>  drivers/net/mlx5/mlx5_trigger.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_trigger.c
> b/drivers/net/mlx5/mlx5_trigger.c
> index 4d2078bbd..d02a626ae 100644
> --- a/drivers/net/mlx5/mlx5_trigger.c
> +++ b/drivers/net/mlx5/mlx5_trigger.c
> @@ -300,9 +300,8 @@ mlx5_traffic_enable(struct rte_eth_dev *dev)
>  			struct rte_flow_item_vlan vlan_spec = {
>  				.tci = rte_cpu_to_be_16(vlan),
>  			};
> -			struct rte_flow_item_vlan vlan_mask = {
> -				.tci = 0xffff,
> -			};
> +			struct rte_flow_item_vlan vlan_mask =
> +				rte_flow_item_vlan_mask;
> 
>  			ret = mlx5_ctrl_flow_vlan(dev, &bcast, &bcast,
>  						  &vlan_spec, &vlan_mask);
> @@ -339,9 +338,8 @@ mlx5_traffic_enable(struct rte_eth_dev *dev)
>  			struct rte_flow_item_vlan vlan_spec = {
>  				.tci = rte_cpu_to_be_16(vlan),
>  			};
> -			struct rte_flow_item_vlan vlan_mask = {
> -				.tci = 0xffff,
> -			};
> +			struct rte_flow_item_vlan vlan_mask =
> +				rte_flow_item_vlan_mask;
> 
>  			ret = mlx5_ctrl_flow_vlan(dev, &unicast,
>  						  &unicast_mask,
> --

Acked-by: Ori Kam <orika@mellanox.com>

Thanks,
> 2.18.0
  
Shahaf Shuler July 24, 2018, 1:45 p.m. UTC | #3
Tuesday, July 24, 2018 1:38 AM, Yongseok Koh:
> Subject: Re: [PATCH] net/mlx5: fix tci mask filter
> 
> 
> > On Jul 23, 2018, at 12:18 AM, Nelio Laranjeiro
> <nelio.laranjeiro@6wind.com> wrote:
> >
> > In mlx5_traffic_enable() the TCI mask for the VLAN is wrong causing
> > the sub flow engine to reject the rule.
> >
> > Fixes: 272733b5ebfd ("net/mlx5: use flow to enable unicast traffic")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> > ---
> Acked-by: Yongseok Koh <yskoh@mellanox.com>

Applied to next-net-mlx, thanks. 

> 
> Thanks
  

Patch

diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 4d2078bbd..d02a626ae 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -300,9 +300,8 @@  mlx5_traffic_enable(struct rte_eth_dev *dev)
 			struct rte_flow_item_vlan vlan_spec = {
 				.tci = rte_cpu_to_be_16(vlan),
 			};
-			struct rte_flow_item_vlan vlan_mask = {
-				.tci = 0xffff,
-			};
+			struct rte_flow_item_vlan vlan_mask =
+				rte_flow_item_vlan_mask;
 
 			ret = mlx5_ctrl_flow_vlan(dev, &bcast, &bcast,
 						  &vlan_spec, &vlan_mask);
@@ -339,9 +338,8 @@  mlx5_traffic_enable(struct rte_eth_dev *dev)
 			struct rte_flow_item_vlan vlan_spec = {
 				.tci = rte_cpu_to_be_16(vlan),
 			};
-			struct rte_flow_item_vlan vlan_mask = {
-				.tci = 0xffff,
-			};
+			struct rte_flow_item_vlan vlan_mask =
+				rte_flow_item_vlan_mask;
 
 			ret = mlx5_ctrl_flow_vlan(dev, &unicast,
 						  &unicast_mask,