[dpdk-stable] patch 'mlx5: fix build with -fno-common' has been queued to LTS release 18.11.9

Kevin Traynor ktraynor at redhat.com
Tue Jun 16 15:33:02 CEST 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/19/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/53a68781004e60d73a56856e5b8334b68769c9d8

Thanks.

Kevin.

---
>From 53a68781004e60d73a56856e5b8334b68769c9d8 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Mon, 15 Jun 2020 20:36:15 +0100
Subject: [PATCH] mlx5: fix build with -fno-common

[ upstream commit 2889d38256906a5cbff717e7e524ec645c89c794 ]

The variable storages of the same name are merged together
if compiled with -fcommon. This is the default.
This default behaviour allows to declare a variable in a header file and
share the variable in every .o binaries thanks to merge at link-time.

In the case of dlopen linking of the glue library, the pointer mlx5_glue
is referencing the glue functions struct and is set after calling
dlopen.

If compiling with -fno-common (default in GCC 10), the variable must be
declared as extern to avoid multiple re-definitions.
In case the glue layer is split in glue library, the variable mlx5_glue
needs to have its own storage for the rest of the PMD.

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
Acked-by: Matan Azrad <matan at mellanox.com>
---
 drivers/net/mlx5/mlx5.c      | 4 ++++
 drivers/net/mlx5/mlx5_glue.h | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 29370f58f0..649faad319 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -132,4 +132,8 @@ static rte_spinlock_t mlx5_shared_data_lock = RTE_SPINLOCK_INITIALIZER;
 int mlx5_logtype;
 
+#ifdef MLX5_GLUE
+const struct mlx5_glue *mlx5_glue;
+#endif
+
 /**
  * Prepare shared data between primary and secondary process.
diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h
index 2d92ba8bcf..0ed754a070 100644
--- a/drivers/net/mlx5/mlx5_glue.h
+++ b/drivers/net/mlx5/mlx5_glue.h
@@ -167,5 +167,5 @@ struct mlx5_glue {
 };
 
-const struct mlx5_glue *mlx5_glue;
+extern const struct mlx5_glue *mlx5_glue;
 
 #endif /* MLX5_GLUE_H_ */
-- 
2.21.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-06-16 14:31:16.011171920 +0100
+++ 0002-mlx5-fix-build-with-fno-common.patch	2020-06-16 14:31:15.914226651 +0100
@@ -1 +1 @@
-From 2889d38256906a5cbff717e7e524ec645c89c794 Mon Sep 17 00:00:00 2001
+From 53a68781004e60d73a56856e5b8334b68769c9d8 Mon Sep 17 00:00:00 2001
@@ -3,2 +3,4 @@
-Date: Wed, 8 Apr 2020 02:08:59 +0200
-Subject: [PATCH] common/mlx5: fix build with -fno-common
+Date: Mon, 15 Jun 2020 20:36:15 +0100
+Subject: [PATCH] mlx5: fix build with -fno-common
+
+[ upstream commit 2889d38256906a5cbff717e7e524ec645c89c794 ]
@@ -20,2 +21,0 @@
-Cc: stable at dpdk.org
-
@@ -25,10 +25,10 @@
- drivers/common/mlx5/mlx5_common.c | 3 +++
- drivers/common/mlx5/mlx5_glue.h   | 2 +-
- 2 files changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
-index d8c01a5d14..42610459f7 100644
---- a/drivers/common/mlx5/mlx5_common.c
-+++ b/drivers/common/mlx5/mlx5_common.c
-@@ -19,4 +19,7 @@
- int mlx5_common_logtype;
+ drivers/net/mlx5/mlx5.c      | 4 ++++
+ drivers/net/mlx5/mlx5_glue.h | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
+index 29370f58f0..649faad319 100644
+--- a/drivers/net/mlx5/mlx5.c
++++ b/drivers/net/mlx5/mlx5.c
+@@ -132,4 +132,8 @@ static rte_spinlock_t mlx5_shared_data_lock = RTE_SPINLOCK_INITIALIZER;
+ int mlx5_logtype;
@@ -39 +39 @@
- 
++
@@ -41,5 +41,6 @@
-diff --git a/drivers/common/mlx5/mlx5_glue.h b/drivers/common/mlx5/mlx5_glue.h
-index cd1136f382..184c41071e 100644
---- a/drivers/common/mlx5/mlx5_glue.h
-+++ b/drivers/common/mlx5/mlx5_glue.h
-@@ -305,5 +305,5 @@ struct mlx5_glue {
+  * Prepare shared data between primary and secondary process.
+diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h
+index 2d92ba8bcf..0ed754a070 100644
+--- a/drivers/net/mlx5/mlx5_glue.h
++++ b/drivers/net/mlx5/mlx5_glue.h
+@@ -167,5 +167,5 @@ struct mlx5_glue {



More information about the stable mailing list