patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix validation of VLAN pcp item
@ 2019-07-29 15:14 Dekel Peled
  2019-07-29 15:28 ` Slava Ovsiienko
  2019-08-05  8:23 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Dekel Peled @ 2019-07-29 15:14 UTC (permalink / raw)
  To: yskoh, viacheslavo, shahafs; +Cc: orika, dev, stable

Function mlx5_flow_validate_item_vlan() validates the user setting
is supported by NIC, using a mask with TCI mask 0x0fff.
This check will reject a flow rule specifying a vlan pcp item.

This patch updates mlx5_flow_validate_item_vlan() to use mask 0xffff,
so flow rules with vlan pcp item are accepted.

Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 3d2d5fc..ec25fde 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1218,8 +1218,8 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
 	const struct rte_flow_item_vlan *spec = item->spec;
 	const struct rte_flow_item_vlan *mask = item->mask;
 	const struct rte_flow_item_vlan nic_mask = {
-		.tci = RTE_BE16(0x0fff),
-		.inner_type = RTE_BE16(0xffff),
+		.tci = RTE_BE16(UINT16_MAX),
+		.inner_type = RTE_BE16(UINT16_MAX),
 	};
 	uint16_t vlan_tag = 0;
 	const int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH] net/mlx5: fix validation of VLAN pcp item
  2019-07-29 15:14 [dpdk-stable] [PATCH] net/mlx5: fix validation of VLAN pcp item Dekel Peled
@ 2019-07-29 15:28 ` Slava Ovsiienko
  2019-08-05  8:23 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Slava Ovsiienko @ 2019-07-29 15:28 UTC (permalink / raw)
  To: Dekel Peled, Yongseok Koh, Shahaf Shuler; +Cc: Ori Kam, dev, stable

> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Monday, July 29, 2019 18:15
> To: Yongseok Koh <yskoh@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix validation of VLAN pcp item
> 
> Function mlx5_flow_validate_item_vlan() validates the user setting is
> supported by NIC, using a mask with TCI mask 0x0fff.
> This check will reject a flow rule specifying a vlan pcp item.
> 
> This patch updates mlx5_flow_validate_item_vlan() to use mask 0xffff, so
> flow rules with vlan pcp item are accepted.
> 
> Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

> ---
>  drivers/net/mlx5/mlx5_flow.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 3d2d5fc..ec25fde 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -1218,8 +1218,8 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
>  	const struct rte_flow_item_vlan *spec = item->spec;
>  	const struct rte_flow_item_vlan *mask = item->mask;
>  	const struct rte_flow_item_vlan nic_mask = {
> -		.tci = RTE_BE16(0x0fff),
> -		.inner_type = RTE_BE16(0xffff),
> +		.tci = RTE_BE16(UINT16_MAX),
> +		.inner_type = RTE_BE16(UINT16_MAX),
>  	};
>  	uint16_t vlan_tag = 0;
>  	const int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix validation of VLAN pcp item
  2019-07-29 15:14 [dpdk-stable] [PATCH] net/mlx5: fix validation of VLAN pcp item Dekel Peled
  2019-07-29 15:28 ` Slava Ovsiienko
@ 2019-08-05  8:23 ` " Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2019-08-05  8:23 UTC (permalink / raw)
  To: Dekel Peled, Yongseok Koh, Slava Ovsiienko, Shahaf Shuler
  Cc: Ori Kam, dev, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Monday, July 29, 2019 6:15 PM
> To: Yongseok Koh <yskoh@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix validation of VLAN pcp item
> 
> Function mlx5_flow_validate_item_vlan() validates the user setting is
> supported by NIC, using a mask with TCI mask 0x0fff.
> This check will reject a flow rule specifying a vlan pcp item.
> 
> This patch updates mlx5_flow_validate_item_vlan() to use mask 0xffff, so
> flow rules with vlan pcp item are accepted.
> 
> Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 3d2d5fc..ec25fde 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -1218,8 +1218,8 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
>  	const struct rte_flow_item_vlan *spec = item->spec;
>  	const struct rte_flow_item_vlan *mask = item->mask;
>  	const struct rte_flow_item_vlan nic_mask = {
> -		.tci = RTE_BE16(0x0fff),
> -		.inner_type = RTE_BE16(0xffff),
> +		.tci = RTE_BE16(UINT16_MAX),
> +		.inner_type = RTE_BE16(UINT16_MAX),
>  	};
>  	uint16_t vlan_tag = 0;
>  	const int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
> --
> 1.8.3.1


Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 15:14 [dpdk-stable] [PATCH] net/mlx5: fix validation of VLAN pcp item Dekel Peled
2019-07-29 15:28 ` Slava Ovsiienko
2019-08-05  8:23 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox