Skip to contentSkip to conversation

common/mlx5: fix missing __rte_internal tags in exported functions

PATCH Applied Tal Shnaiderman 7 participants 13 messages Apr 11, 2021 – Apr 12, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/mlx5: fix missing __rte_internal tags in exported functions

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on Windows")
Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
---
 drivers/common/mlx5/linux/mlx5_common_os.h   | 4 ++++
 drivers/common/mlx5/windows/mlx5_common_os.h | 6 ++++++
 2 files changed, 10 insertions(+)
drivers/common/mlx5/linux/mlx5_common_os.h +4 -0
index 63f070d9c4..d1c7e3dce0 100644
@@ -203,24 +203,28 @@ mlx5_os_get_devx_uar_page_id(void *uar)
 #endif
 }
 
+__rte_internal
 static inline void *
 mlx5_os_alloc_pd(void *ctx)
 {
 	return mlx5_glue->alloc_pd(ctx);
 }
 
+__rte_internal
 static inline int
 mlx5_os_dealloc_pd(void *pd)
 {
 	return mlx5_glue->dealloc_pd(pd);
 }
 
+__rte_internal
 static inline void *
 mlx5_os_umem_reg(void *ctx, void *addr, size_t size, uint32_t access)
 {
 	return mlx5_glue->devx_umem_reg(ctx, addr, size, access);
 }
 
+__rte_internal
 static inline int
 mlx5_os_umem_dereg(void *pumem)
 {
drivers/common/mlx5/windows/mlx5_common_os.h +6 -0
index e92533c4d3..3756e1959b 100644
@@ -248,11 +248,17 @@ mlx5_os_devx_subscribe_devx_event(void *eventc,
 	return -ENOTSUP;
 }
 
+__rte_internal
 void *mlx5_os_alloc_pd(void *ctx);
+__rte_internal
 int mlx5_os_dealloc_pd(void *pd);
+__rte_internal
 void *mlx5_os_umem_reg(void *ctx, void *addr, size_t size, uint32_t access);
+__rte_internal
 int mlx5_os_umem_dereg(void *pumem);
+__rte_internal
 int mlx5_os_reg_mr(void *pd,
 		   void *addr, size_t length, struct mlx5_pmd_mr *pmd_mr);
+__rte_internal
 void mlx5_os_dereg_mr(struct mlx5_pmd_mr *pmd_mr);
 #endif /* RTE_PMD_MLX5_COMMON_OS_H_ */
Signature · 1 line
2.16.1.windows.4
Acked-by on v1 1/1
#1 lore raw

From: Tal Shnaiderman

Quoted 10 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on

Windows")

Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
Quoted 60 lines
---
 drivers/common/mlx5/linux/mlx5_common_os.h   | 4 ++++
 drivers/common/mlx5/windows/mlx5_common_os.h | 6 ++++++
 2 files changed, 10 insertions(+)
drivers/common/mlx5/linux/mlx5_common_os.h +4 -0
index 63f070d9c4..d1c7e3dce0 100644
@@ -203,24 +203,28 @@ mlx5_os_get_devx_uar_page_id(void *uar)  #endif  }
 
+__rte_internal
 static inline void *
 mlx5_os_alloc_pd(void *ctx)
 {
 	return mlx5_glue->alloc_pd(ctx);
 }
 
+__rte_internal
 static inline int
 mlx5_os_dealloc_pd(void *pd)
 {
 	return mlx5_glue->dealloc_pd(pd);
 }
 
+__rte_internal
 static inline void *
 mlx5_os_umem_reg(void *ctx, void *addr, size_t size, uint32_t access)  {
 	return mlx5_glue->devx_umem_reg(ctx, addr, size, access);  }
 
+__rte_internal
 static inline int
 mlx5_os_umem_dereg(void *pumem)
 {
drivers/common/mlx5/windows/mlx5_common_os.h +6 -0
index e92533c4d3..3756e1959b 100644
@@ -248,11 +248,17 @@ mlx5_os_devx_subscribe_devx_event(void *eventc,
 	return -ENOTSUP;
 }
 
+__rte_internal
 void *mlx5_os_alloc_pd(void *ctx);
+__rte_internal
 int mlx5_os_dealloc_pd(void *pd);
+__rte_internal
 void *mlx5_os_umem_reg(void *ctx, void *addr, size_t size, uint32_t access);
+__rte_internal
 int mlx5_os_umem_dereg(void *pumem);
+__rte_internal
 int mlx5_os_reg_mr(void *pd,
 		   void *addr, size_t length, struct mlx5_pmd_mr *pmd_mr);
+__rte_internal
 void mlx5_os_dereg_mr(struct mlx5_pmd_mr *pmd_mr);  #endif /*

RTE_PMD_MLX5_COMMON_OS_H_ */
--
2.16.1.windows.4

Tested-by on v1 1/1
#2 lore raw
In reply to Tal Shnaiderman

Hi,

Quoted 14 lines

-----Original Message-----
From: Tal Shnaiderman <[email protected]>
Sent: Sunday, April 11, 2021 3:22 PM
To: [email protected]
Cc: NBU-Contact-Thomas Monjalon <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Asaf Penso <[email protected]>; Wisam Monther <[email protected]>; [email protected]
Subject: [PATCH] common/mlx5: fix missing __rte_internal tags in exported functions

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Quoted 7 lines
Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on

Windows")

Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
#3 lore raw
In reply to Tal Shnaiderman

Hi,

Quoted 11 lines

-----Original Message-----
From: Tal Shnaiderman <[email protected]>
Sent: Sunday, April 11, 2021 3:22 PM
To: [email protected]
Cc: NBU-Contact-Thomas Monjalon <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Asaf Penso <[email protected]>; Wisam Monther <[email protected]>; [email protected]
Subject: [PATCH] common/mlx5: fix missing __rte_internal tags in exported functions

Removed __ from the commit title to fix wrong headline format issue.

Quoted 10 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on

Windows")

Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

#4 lore raw

12/04/2021 13:25, Raslan Darawsheh:

Quoted 1 line

Removed __ from the commit title to fix wrong headline format issue.

Removing __ makes it wrong: rte_internal does not exist. The idea of discouraging the use of underscore is to avoid naming bits and bytes in the title.
Here it should be: "add missing internal tags to some functions"

Quoted 2 lines
Quoted 2 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

#5 lore raw

Hi,

Quoted 11 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, April 12, 2021 3:26 PM
To: Tal Shnaiderman <[email protected]>; Raslan Darawsheh <[email protected]>
Cc: [email protected]; Matan Azrad <[email protected]>; Asaf Penso <[email protected]>; Wisam Monther <[email protected]>; [email protected]
Subject: Re: [PATCH] common/mlx5: fix missing __rte_internal tags in exported functions

Quoted 7 lines

12/04/2021 13:25, Raslan Darawsheh:

Quoted 1 line

Removed __ from the commit title to fix wrong headline format issue.

Removing __ makes it wrong: rte_internal does not exist. The idea of discouraging the use of underscore is to avoid naming bits and bytes in the title.
Here it should be: "add missing internal tags to some functions"

My suggestion was to make it like this:
"fix missing rte internal tags in exported functions"

But, I find your suggestion even better, so I'd change it to that

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Kindest regards
Raslan Darawsheh

#6 lore raw
In reply to Raslan Darawsheh
Quoted 24 lines · Raslan Darawsheh

Hi,

Quoted 11 lines

-----Original Message-----
From: Tal Shnaiderman <[email protected]>
Sent: Sunday, April 11, 2021 3:22 PM
To: [email protected]
Cc: NBU-Contact-Thomas Monjalon <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Asaf Penso <[email protected]>; Wisam Monther <[email protected]>; [email protected]
Subject: [PATCH] common/mlx5: fix missing __rte_internal tags in exported functions

Removed __ from the commit title to fix wrong headline format issue.

Quoted 9 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on

Windows")

Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
Quoted 4 lines
Quoted 1 line

Patch applied to next-net-mlx,

Can we merge this directly to main repo?
Since debug build is broken without it.

#7 lore raw

12/04/2021 14:59, Ferruh Yigit:

Quoted 16 lines · Raslan Darawsheh
Quoted 15 lines

Hi,

From: Tal Shnaiderman <[email protected]>

Quoted 1 line

Removed __ from the commit title to fix wrong headline format issue.

Quoted 9 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on

Windows")

Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Patch applied to next-net-mlx,

Can we merge this directly to main repo?
Since debug build is broken without it.

Which debug option?
It is broken since when?

#8 lore raw
Quoted 19 lines · Thomas Monjalon

12/04/2021 14:59, Ferruh Yigit:

Quoted 18 lines · Raslan Darawsheh
Quoted 17 lines

Hi,

From: Tal Shnaiderman <[email protected]>

Quoted 1 line

Removed __ from the commit title to fix wrong headline format issue.

Quoted 10 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on

Windows")

Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

Patch applied to next-net-mlx,

Can we merge this directly to main repo?
Since debug build is broken without it.

Which debug option?
It is broken since when?

"meson --buildtype=debug build && ninja -C build" is broken [1], I thought that is why this patch is done at first place. Some checks are done now only in the debug mode, since checks are reduced to developer mode [2].

It become visible when .def file removed [3], since that is when symbols are added to the .map file.

[1]
FAILED: drivers/rte_common_mlx5.sym_chk
.../meson --internal exe --capture drivers/rte_common_mlx5.sym_chk -- .../buildtools/check-symbols.sh .../drivers/common/mlx5/version.map drivers/librte_common_mlx5.a mlx5_os_umem_reg is not flagged as internal
but is listed in version map
Please add __rte_internal to the definition of mlx5_os_umem_reg
mlx5_os_umem_dereg is not flagged as internal
but is listed in version map
Please add __rte_internal to the definition of mlx5_os_umem_dereg

[2]
Commit 720dfda4551e ("build: limit symbol checks to developer mode")

[3]
Commit 56ea803e878e ("build: remove Windows export symbol list")

#9 lore raw
Quoted 32 lines · Ferruh Yigit
Quoted 19 lines · Thomas Monjalon

12/04/2021 14:59, Ferruh Yigit:

Quoted 18 lines · Raslan Darawsheh
Quoted 17 lines

Hi,

From: Tal Shnaiderman <[email protected]>

Quoted 1 line

Removed __ from the commit title to fix wrong headline format issue.

Quoted 10 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on

Windows")

Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

Patch applied to next-net-mlx,

Can we merge this directly to main repo?
Since debug build is broken without it.

Which debug option?
It is broken since when?

Quoted 4 lines

"meson --buildtype=debug build && ninja -C build" is broken [1], I thought that is why this patch is done at first place.
Some checks are done now only in the debug mode, since checks are reduced to developer mode [2].

I don't think [2] has something to do with it.

The symbols fixed here are inlined.
In release (and debugoptimized) modes, I can see no trace of them in the .o

$ nm build/drivers/librte_common_mlx5.a |grep umem_reg
                 U mlx5dv_devx_umem_reg
0000000000000410 t mlx5_glue_devx_umem_reg

While in debug mode:

$ nm build.debug/drivers/librte_common_mlx5.a |grep umem_reg
00000000000000b9 t mlx5_os_umem_reg
                 ^^^^^^^^^^^^^^^^^^
                 U mlx5dv_devx_umem_reg
0000000000001578 t mlx5_glue_devx_umem_reg

The symbol check then catches mlx5_os_umem_reg wrt the version.map and complains mlx5_os_umem_reg is not tagged internal.

Signature · 1 line
David Marchand
#10 lore raw
Quoted 67 lines

Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] common/mlx5: fix missing __rte_internal tags in exported functions

External email: Use caution opening links or attachments

Quoted 10 lines · Ferruh Yigit
Quoted 8 lines · Thomas Monjalon

12/04/2021 14:59, Ferruh Yigit:

Quoted 7 lines · Raslan Darawsheh
Quoted 6 lines

Hi,

From: Tal Shnaiderman <[email protected]>

Quoted 1 line

Removed __ from the commit title to fix wrong headline format issue.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Several functions introduced in the addition of the Windows support to
mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on

Windows")

Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg

functions

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

on
Windows")

Fixes ba420719823c ("common/mlx5: add reg/dereg MR on

Windows")

Quoted 15 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

Patch applied to next-net-mlx,

Can we merge this directly to main repo?
Since debug build is broken without it.

Which debug option?
It is broken since when?

Quoted 4 lines

"meson --buildtype=debug build && ninja -C build" is broken [1], I thought that is why this patch is done at first place. Some checks are done now only in the debug mode, since checks are reduced to developer mode [2].

I don't think [2] has something to do with it.

The symbols fixed here are inlined.
In release (and debugoptimized) modes, I can see no trace of them in the .o

$ nm build/drivers/librte_common_mlx5.a |grep umem_reg
                 U mlx5dv_devx_umem_reg
0000000000000410 t mlx5_glue_devx_umem_reg

While in debug mode:

$ nm build.debug/drivers/librte_common_mlx5.a |grep umem_reg
00000000000000b9 t mlx5_os_umem_reg
                 ^^^^^^^^^^^^^^^^^^
                 U mlx5dv_devx_umem_reg
0000000000001578 t mlx5_glue_devx_umem_reg
Quoted 6 lines

The symbol check then catches mlx5_os_umem_reg wrt the version.map and complains mlx5_os_umem_reg is not tagged internal.

--
David Marchand

Right, the issue was in observed from commit 56ea803e878e ("build: remove Windows export symbol list") and this patch fixes it, apologies for not stating it in the commit log.

Since rte_common_mlx5_exports.def was merged to version.map several functions which needed export only for Windows were brought in, e.g. mlx5_os_umem_reg, in Linux it is implemented in the .h file but has a .c implementation on Windows so it is needed to be in version.map.

Windows doesn't run symbol check in debug so up until the file merge it wasn't caught.

#11 lore raw
In reply to David Marchand
Quoted 55 lines · David Marchand
Quoted 32 lines · Ferruh Yigit
Quoted 19 lines · Thomas Monjalon

12/04/2021 14:59, Ferruh Yigit:

Quoted 18 lines · Raslan Darawsheh
Quoted 17 lines

Hi,

From: Tal Shnaiderman <[email protected]>

Quoted 1 line

Removed __ from the commit title to fix wrong headline format issue.

Quoted 10 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on

Windows")

Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

Patch applied to next-net-mlx,

Can we merge this directly to main repo?
Since debug build is broken without it.

Which debug option?
It is broken since when?

Quoted 4 lines

"meson --buildtype=debug build && ninja -C build" is broken [1], I thought that is why this patch is done at first place.
Some checks are done now only in the debug mode, since checks are reduced to developer mode [2].

I don't think [2] has something to do with it.

The symbols fixed here are inlined.
In release (and debugoptimized) modes, I can see no trace of them in the .o

$ nm build/drivers/librte_common_mlx5.a |grep umem_reg
                  U mlx5dv_devx_umem_reg
0000000000000410 t mlx5_glue_devx_umem_reg

While in debug mode:

$ nm build.debug/drivers/librte_common_mlx5.a |grep umem_reg
00000000000000b9 t mlx5_os_umem_reg
                  ^^^^^^^^^^^^^^^^^^
                  U mlx5dv_devx_umem_reg
0000000000001578 t mlx5_glue_devx_umem_reg
Quoted 4 lines

The symbol check then catches mlx5_os_umem_reg wrt the version.map and complains mlx5_os_umem_reg is not tagged internal.

Got it, if so this is not related to [2] as you said, but related to the debug mode build, thanks for clarification.

#12 lore raw
In reply to Tal Shnaiderman

11/04/2021 14:21, Tal Shnaiderman:

Quoted 9 lines

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag although being exported.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on Windows")
Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")

It is fixing Linux debug build (note: should be added to CI).

Applied in main tree with this message, thanks:

common/mlx5: add missing internal tags

Several functions introduced in the addition of the Windows support to mlx5 were missing the __rte_internal tag.
This miss is better revealed when symbols became exported on Linux too, and it is caught by the symbol checker with --buildtype=debug.

Fixes 1552fb287166 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes 1969ee424405 ("common/mlx5: add UMEM reg/dereg functions on Windows")
Fixes ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
Fixes 56ea803e878e ("build: remove Windows export symbol list")