DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation
@ 2020-06-28  9:36 Shy Shyman
  2020-07-01 18:02 ` Matan Azrad
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shy Shyman @ 2020-06-28  9:36 UTC (permalink / raw)
  To: dev; +Cc: matan, viacheslavo, stable

When flow is inserted with meta match item it requires a certain
register support.
As part of the flow validation of such flows, the validation
function is missing a check that the mlx5 driver is not in
legacy mode in terms of extended meta data support
(MLX5_XMETA_MODE_LEGACY flag).
If the driver is in legacy mode it will cause downstream
function that allocates needed register for meta data.

The fix checks explicitly the conditions for support of
meta data in FDB mode. if the conditions are not met
an error message will be issued.

Fixes: 9bf26e1318 ("ethdev: move egress metadata to dynamic field")
Cc: viacheslavo@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Shy Shyman <shys@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 6318bd99cd..e037643c98 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1479,6 +1479,13 @@ flow_dv_validate_item_meta(struct rte_eth_dev *dev __rte_unused,
 					  "isn't supported");
 		if (reg != REG_A)
 			nic_mask.data = priv->sh->dv_meta_mask;
+	} else if (attr->transfer) {
+		return rte_flow_error_set(error, ENOTSUP,
+					RTE_FLOW_ERROR_TYPE_ITEM, item,
+					"extended metadata feature "
+					"should be enabled when "
+					"meta item is requested "
+					"with e-switch mode ");
 	}
 	if (!mask)
 		mask = &rte_flow_item_meta_mask;
-- 
2.21.0


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation
  2020-06-28  9:36 [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation Shy Shyman
@ 2020-07-01 18:02 ` Matan Azrad
       [not found] ` <AM0PR05MB42893357B960A8889A898976C06C0@AM0PR05MB4289.eurprd05.prod.outlook.com>
  2020-07-05  8:05 ` Raslan Darawsheh
  2 siblings, 0 replies; 4+ messages in thread
From: Matan Azrad @ 2020-07-01 18:02 UTC (permalink / raw)
  To: Shy Shyman, dev; +Cc: Slava Ovsiienko, stable



From: Shy Shyman
> When flow is inserted with meta match item it requires a certain register
> support.
> As part of the flow validation of such flows, the validation function is missing
> a check that the mlx5 driver is not in legacy mode in terms of extended meta
> data support (MLX5_XMETA_MODE_LEGACY flag).
> If the driver is in legacy mode it will cause downstream function that allocates
> needed register for meta data.
> 
> The fix checks explicitly the conditions for support of meta data in FDB mode.
> if the conditions are not met an error message will be issued.
> 
> Fixes: 9bf26e1318 ("ethdev: move egress metadata to dynamic field")
> Cc: viacheslavo@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shy Shyman <shys@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation
       [not found] ` <AM0PR05MB42893357B960A8889A898976C06C0@AM0PR05MB4289.eurprd05.prod.outlook.com>
@ 2020-07-01 19:33   ` Matan Azrad
  0 siblings, 0 replies; 4+ messages in thread
From: Matan Azrad @ 2020-07-01 19:33 UTC (permalink / raw)
  To: Shy Shyman, dev; +Cc: Slava Ovsiienko, stable

Done

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Asaf Penso <asafp@mellanox.com>
Sent: Wednesday, July 1, 2020 2:19:10 PM
To: Matan Azrad <matan@mellanox.com>
Cc: Shy Shyman <shys@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>
Subject: FW: [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation

Matan, can you please ACK in ML as well?
Shy didn't add your ACK from the GitHub.

Regards,
Asaf Penso

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Shy Shyman
> Sent: Sunday, June 28, 2020 12:37 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation
>
> When flow is inserted with meta match item it requires a certain
> register support.
> As part of the flow validation of such flows, the validation
> function is missing a check that the mlx5 driver is not in
> legacy mode in terms of extended meta data support
> (MLX5_XMETA_MODE_LEGACY flag).
> If the driver is in legacy mode it will cause downstream
> function that allocates needed register for meta data.
>
> The fix checks explicitly the conditions for support of
> meta data in FDB mode. if the conditions are not met
> an error message will be issued.
>
> Fixes: 9bf26e1318 ("ethdev: move egress metadata to dynamic field")
> Cc: viacheslavo@mellanox.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Shy Shyman <shys@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index 6318bd99cd..e037643c98 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1479,6 +1479,13 @@ flow_dv_validate_item_meta(struct rte_eth_dev
> *dev __rte_unused,
>                                          "isn't supported");
>                if (reg != REG_A)
>                        nic_mask.data = priv->sh->dv_meta_mask;
> +     } else if (attr->transfer) {
> +             return rte_flow_error_set(error, ENOTSUP,
> +                                     RTE_FLOW_ERROR_TYPE_ITEM, item,
> +                                     "extended metadata feature "
> +                                     "should be enabled when "
> +                                     "meta item is requested "
> +                                     "with e-switch mode ");
>        }
>        if (!mask)
>                mask = &rte_flow_item_meta_mask;
> --
> 2.21.0


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation
  2020-06-28  9:36 [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation Shy Shyman
  2020-07-01 18:02 ` Matan Azrad
       [not found] ` <AM0PR05MB42893357B960A8889A898976C06C0@AM0PR05MB4289.eurprd05.prod.outlook.com>
@ 2020-07-05  8:05 ` Raslan Darawsheh
  2 siblings, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2020-07-05  8:05 UTC (permalink / raw)
  To: Shy Shyman, dev; +Cc: Matan Azrad, Slava Ovsiienko, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Shy Shyman
> Sent: Sunday, June 28, 2020 12:37 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation
> 
> When flow is inserted with meta match item it requires a certain
> register support.
> As part of the flow validation of such flows, the validation
> function is missing a check that the mlx5 driver is not in
> legacy mode in terms of extended meta data support
> (MLX5_XMETA_MODE_LEGACY flag).
> If the driver is in legacy mode it will cause downstream
> function that allocates needed register for meta data.
> 
> The fix checks explicitly the conditions for support of
> meta data in FDB mode. if the conditions are not met
> an error message will be issued.
> 
> Fixes: 9bf26e1318 ("ethdev: move egress metadata to dynamic field")
> Cc: viacheslavo@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shy Shyman <shys@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index 6318bd99cd..e037643c98 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1479,6 +1479,13 @@ flow_dv_validate_item_meta(struct rte_eth_dev
> *dev __rte_unused,
>  					  "isn't supported");
>  		if (reg != REG_A)
>  			nic_mask.data = priv->sh->dv_meta_mask;
> +	} else if (attr->transfer) {
> +		return rte_flow_error_set(error, ENOTSUP,
> +					RTE_FLOW_ERROR_TYPE_ITEM, item,
> +					"extended metadata feature "
> +					"should be enabled when "
> +					"meta item is requested "
> +					"with e-switch mode ");
>  	}
>  	if (!mask)
>  		mask = &rte_flow_item_meta_mask;
> --
> 2.21.0


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2020-07-05  8:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28  9:36 [dpdk-dev] [PATCH] net/mlx5: fix flow META item validation Shy Shyman
2020-07-01 18:02 ` Matan Azrad
     [not found] ` <AM0PR05MB42893357B960A8889A898976C06C0@AM0PR05MB4289.eurprd05.prod.outlook.com>
2020-07-01 19:33   ` Matan Azrad
2020-07-05  8:05 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).