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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:03:34 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/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.

Thanks.

Luca Boccassi

---
>From b3e01cd3e46fde2a6872b5b058890ac403701504 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Wed, 8 Apr 2020 02:08:59 +0200
Subject: [PATCH] common/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_glue.c | 4 ++++
 drivers/net/mlx5/mlx5_glue.h | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c
index 0917bf28d6..c5880dd6f2 100644
--- a/drivers/net/mlx5/mlx5_glue.c
+++ b/drivers/net/mlx5/mlx5_glue.c
@@ -30,6 +30,10 @@
 #include "mlx5_autoconf.h"
 #include "mlx5_glue.h"
 
+#ifdef MLX5_GLUE
+const struct mlx5_glue *mlx5_glue;
+#endif
+
 static int
 mlx5_glue_fork_init(void)
 {
diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h
index 6442f1eba8..4e6465523a 100644
--- a/drivers/net/mlx5/mlx5_glue.h
+++ b/drivers/net/mlx5/mlx5_glue.h
@@ -258,6 +258,6 @@ struct mlx5_glue {
 			       struct mlx5dv_devx_port *mlx5_devx_port);
 };
 
-const struct mlx5_glue *mlx5_glue;
+extern const struct mlx5_glue *mlx5_glue;
 
 #endif /* MLX5_GLUE_H_ */
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:47.681096737 +0100
+++ 0079-common-mlx5-fix-build-with-fno-common.patch	2020-05-19 14:04:44.248648953 +0100
@@ -1,8 +1,10 @@
-From 2889d38256906a5cbff717e7e524ec645c89c794 Mon Sep 17 00:00:00 2001
+From b3e01cd3e46fde2a6872b5b058890ac403701504 Mon Sep 17 00:00:00 2001
 From: Thomas Monjalon <thomas at monjalon.net>
 Date: Wed, 8 Apr 2020 02:08:59 +0200
 Subject: [PATCH] common/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
@@ -17,35 +19,34 @@
 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.
 
-Cc: stable at dpdk.org
-
 Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
 Acked-by: Matan Azrad <matan at mellanox.com>
 ---
- 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
-@@ -18,6 +18,9 @@
- 
- int mlx5_common_logtype;
+ drivers/net/mlx5/mlx5_glue.c | 4 ++++
+ drivers/net/mlx5/mlx5_glue.h | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c
+index 0917bf28d6..c5880dd6f2 100644
+--- a/drivers/net/mlx5/mlx5_glue.c
++++ b/drivers/net/mlx5/mlx5_glue.c
+@@ -30,6 +30,10 @@
+ #include "mlx5_autoconf.h"
+ #include "mlx5_glue.h"
  
 +#ifdef MLX5_GLUE
 +const struct mlx5_glue *mlx5_glue;
 +#endif
- 
- /**
-  * Get PCI information by sysfs device path.
-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
-@@ -304,6 +304,6 @@ struct mlx5_glue {
- 			 size_t event_resp_len);
++
+ static int
+ mlx5_glue_fork_init(void)
+ {
+diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h
+index 6442f1eba8..4e6465523a 100644
+--- a/drivers/net/mlx5/mlx5_glue.h
++++ b/drivers/net/mlx5/mlx5_glue.h
+@@ -258,6 +258,6 @@ struct mlx5_glue {
+ 			       struct mlx5dv_devx_port *mlx5_devx_port);
  };
  
 -const struct mlx5_glue *mlx5_glue;


More information about the stable mailing list