mldev: remove weak symbols use in type conversions

Message ID 20230311145056.16386-1-syalavarthi@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series mldev: remove weak symbols use in type conversions |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Srikanth Yalavarthi March 11, 2023, 2:50 p.m. UTC
  Drop use of weak symbols to select the type conversion
functions. Select NEON implementation only on Aarch64
builds. Enable windows build.

Fixes: 3c54f91ad8c9 ("mldev: disable build on Windows")

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 lib/mldev/meson.build          |  9 ++-------
 lib/mldev/mldev_utils_scalar.c | 24 ++++++++++++------------
 2 files changed, 14 insertions(+), 19 deletions(-)
  

Comments

David Marchand March 13, 2023, 10:52 a.m. UTC | #1
Hello,

On Sat, Mar 11, 2023 at 3:51 PM Srikanth Yalavarthi
<syalavarthi@marvell.com> wrote:
>
> Drop use of weak symbols to select the type conversion
> functions. Select NEON implementation only on Aarch64
> builds. Enable windows build.
>
> Fixes: 3c54f91ad8c9 ("mldev: disable build on Windows")

Strictly speaking we are not fixing this change above, but rather
Fixes: 9637de38a2e3 ("mldev: add scalar type conversion")


>
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>

The change looks good to me and the UNH Windows build target seems to agree :-).
Reviewed-by: David Marchand <david.marchand@redhat.com>

Thanks Srikanth.
  
Srikanth Yalavarthi March 13, 2023, 11:37 a.m. UTC | #2
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: 13 March 2023 16:22
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao
> <sshankarnara@marvell.com>
> Subject: [EXT] Re: [PATCH] mldev: remove weak symbols use in type
> conversions
> 
> External Email
> 
> ----------------------------------------------------------------------
> Hello,
> 
> On Sat, Mar 11, 2023 at 3:51 PM Srikanth Yalavarthi
> <syalavarthi@marvell.com> wrote:
> >
> > Drop use of weak symbols to select the type conversion functions.
> > Select NEON implementation only on Aarch64 builds. Enable windows
> > build.
> >
> > Fixes: 3c54f91ad8c9 ("mldev: disable build on Windows")
> 
> Strictly speaking we are not fixing this change above, but rather
> Fixes: 9637de38a2e3 ("mldev: add scalar type conversion")
> 
Updated in v2.

> 
> >
> > Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> 
> The change looks good to me and the UNH Windows build target seems to
> agree :-).
Ack.

> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 
> Thanks Srikanth.
> 
> 
> --
> David Marchand
  

Patch

diff --git a/lib/mldev/meson.build b/lib/mldev/meson.build
index 51ba809465..c9db42257b 100644
--- a/lib/mldev/meson.build
+++ b/lib/mldev/meson.build
@@ -1,21 +1,16 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 Marvell.
 
-if is_windows
-    build = false
-    reason = 'not supported on Windows'
-    subdir_done()
-endif
-
 sources = files(
         'rte_mldev_pmd.c',
         'rte_mldev.c',
         'mldev_utils.c',
-        'mldev_utils_scalar.c',
 )
 
 if dpdk_conf.has('RTE_ARCH_ARM64')
     sources += files('mldev_utils_neon.c')
+else
+    sources += files('mldev_utils_scalar.c')
 endif
 
 headers = files(
diff --git a/lib/mldev/mldev_utils_scalar.c b/lib/mldev/mldev_utils_scalar.c
index 40320ed3ef..322b009f5d 100644
--- a/lib/mldev/mldev_utils_scalar.c
+++ b/lib/mldev/mldev_utils_scalar.c
@@ -84,7 +84,7 @@  union float32 {
 	uint32_t u;
 };
 
-__rte_weak int
+int
 rte_ml_io_float32_to_int8(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -116,7 +116,7 @@  rte_ml_io_float32_to_int8(float scale, uint64_t nb_elements, void *input, void *
 	return 0;
 }
 
-__rte_weak int
+int
 rte_ml_io_int8_to_float32(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	int8_t *input_buffer;
@@ -139,7 +139,7 @@  rte_ml_io_int8_to_float32(float scale, uint64_t nb_elements, void *input, void *
 	return 0;
 }
 
-__rte_weak int
+int
 rte_ml_io_float32_to_uint8(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -171,7 +171,7 @@  rte_ml_io_float32_to_uint8(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }
 
-__rte_weak int
+int
 rte_ml_io_uint8_to_float32(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	uint8_t *input_buffer;
@@ -194,7 +194,7 @@  rte_ml_io_uint8_to_float32(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }
 
-__rte_weak int
+int
 rte_ml_io_float32_to_int16(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -226,7 +226,7 @@  rte_ml_io_float32_to_int16(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }
 
-__rte_weak int
+int
 rte_ml_io_int16_to_float32(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	int16_t *input_buffer;
@@ -249,7 +249,7 @@  rte_ml_io_int16_to_float32(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }
 
-__rte_weak int
+int
 rte_ml_io_float32_to_uint16(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -281,7 +281,7 @@  rte_ml_io_float32_to_uint16(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }
 
-__rte_weak int
+int
 rte_ml_io_uint16_to_float32(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	uint16_t *input_buffer;
@@ -429,7 +429,7 @@  __float32_to_float16_scalar_rtn(float x)
 	return u16;
 }
 
-__rte_weak int
+int
 rte_ml_io_float32_to_float16(uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -513,7 +513,7 @@  __float16_to_float32_scalar_rtx(uint16_t f16)
 	return f32.f;
 }
 
-__rte_weak int
+int
 rte_ml_io_float16_to_float32(uint64_t nb_elements, void *input, void *output)
 {
 	uint16_t *input_buffer;
@@ -614,7 +614,7 @@  __float32_to_bfloat16_scalar_rtn(float x)
 	return u16;
 }
 
-__rte_weak int
+int
 rte_ml_io_float32_to_bfloat16(uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -696,7 +696,7 @@  __bfloat16_to_float32_scalar_rtx(uint16_t f16)
 	return f32.f;
 }
 
-__rte_weak int
+int
 rte_ml_io_bfloat16_to_float32(uint64_t nb_elements, void *input, void *output)
 {
 	uint16_t *input_buffer;