patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] common/mlx5: fix code arrangement in tag allocation
@ 2020-06-24 13:20 Michael Baum
  2020-06-28 12:17 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Baum @ 2020-06-24 13:20 UTC (permalink / raw)
  To: dev; +Cc: matan, viacheslavo, stable

Flow tag action is supported only when the driver has DR or DV support.
The tag allocation is adjusted to the modes DV or DR.

In case both DR and DV are not supported in the system, the driver
handles static code for error report.
This error code, wrongly, was compiled when DV is supported while in
this case it cannot be accessed at all.

Ignore the aforementioned static error code in case of DV by
preprocessor commands rearrangement.

Fixes: cbb66daa3c85 ("net/mlx5: prepare Direct Verbs for Direct Rule")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/common/mlx5/linux/mlx5_glue.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/common/mlx5/linux/mlx5_glue.c b/drivers/common/mlx5/linux/mlx5_glue.c
index c91ee33..a41650d 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.c
+++ b/drivers/common/mlx5/linux/mlx5_glue.c
@@ -752,7 +752,7 @@
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
 #ifdef HAVE_MLX5DV_DR
 	return mlx5dv_dr_action_create_tag(tag);
-#else
+#else /* HAVE_MLX5DV_DR */
 	struct mlx5dv_flow_action_attr *action;
 	action = malloc(sizeof(*action));
 	if (!action)
@@ -760,11 +760,12 @@
 	action->type = MLX5DV_FLOW_ACTION_TAG;
 	action->tag_value = tag;
 	return action;
-#endif
-#endif
+#endif /* HAVE_MLX5DV_DR */
+#else /* HAVE_IBV_FLOW_DV_SUPPORT */
 	(void)tag;
 	errno = ENOTSUP;
 	return NULL;
+#endif /* HAVE_IBV_FLOW_DV_SUPPORT */
 }
 
 static void *
-- 
1.8.3.1


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] common/mlx5: fix code arrangement in tag allocation
  2020-06-24 13:20 [dpdk-stable] [PATCH] common/mlx5: fix code arrangement in tag allocation Michael Baum
@ 2020-06-28 12:17 ` " Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2020-06-28 12:17 UTC (permalink / raw)
  To: Michael Baum, dev; +Cc: Matan Azrad, Slava Ovsiienko, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Michael Baum
> Sent: Wednesday, June 24, 2020 4:21 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] common/mlx5: fix code arrangement in tag
> allocation
> 
> Flow tag action is supported only when the driver has DR or DV support.
> The tag allocation is adjusted to the modes DV or DR.
> 
> In case both DR and DV are not supported in the system, the driver
> handles static code for error report.
> This error code, wrongly, was compiled when DV is supported while in
> this case it cannot be accessed at all.
> 
> Ignore the aforementioned static error code in case of DV by
> preprocessor commands rearrangement.
> 
> Fixes: cbb66daa3c85 ("net/mlx5: prepare Direct Verbs for Direct Rule")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/common/mlx5/linux/mlx5_glue.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/common/mlx5/linux/mlx5_glue.c
> b/drivers/common/mlx5/linux/mlx5_glue.c
> index c91ee33..a41650d 100644
> --- a/drivers/common/mlx5/linux/mlx5_glue.c
> +++ b/drivers/common/mlx5/linux/mlx5_glue.c
> @@ -752,7 +752,7 @@
>  #ifdef HAVE_IBV_FLOW_DV_SUPPORT
>  #ifdef HAVE_MLX5DV_DR
>  	return mlx5dv_dr_action_create_tag(tag);
> -#else
> +#else /* HAVE_MLX5DV_DR */
>  	struct mlx5dv_flow_action_attr *action;
>  	action = malloc(sizeof(*action));
>  	if (!action)
> @@ -760,11 +760,12 @@
>  	action->type = MLX5DV_FLOW_ACTION_TAG;
>  	action->tag_value = tag;
>  	return action;
> -#endif
> -#endif
> +#endif /* HAVE_MLX5DV_DR */
> +#else /* HAVE_IBV_FLOW_DV_SUPPORT */
>  	(void)tag;
>  	errno = ENOTSUP;
>  	return NULL;
> +#endif /* HAVE_IBV_FLOW_DV_SUPPORT */
>  }
> 
>  static void *
> --
> 1.8.3.1


Patch apply to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 13:20 [dpdk-stable] [PATCH] common/mlx5: fix code arrangement in tag allocation Michael Baum
2020-06-28 12:17 ` [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