Skip to contentSkip to conversation

*** fix native clang compiling errors on ARM64 ***

PATCH Superseded Gavin Hu 7 participants 30 messages May 15, 2018 – May 20, 2018 Network drivers

lore
Share & tools
lore

Gavin Hu

author
#0 lore raw

cover *** fix native clang compiling errors on ARM64 ***

*** The patches are for fixing the native clang compiling errors on ARM64 building hosts.***

Gavin Hu (4):
app: add LDFLAGS -latomic to link atomic lib
Driver/Mellanox: fix PMD compiling issue
cryptodev: fix the clang compiling issue
ifpgai_rawdev: fix the clang compiling issue

 drivers/net/mlx5/mlx5_rxtx_vec_neon.h          | 12 ++++++------
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h  |  3 ++-
 lib/librte_eventdev/rte_event_crypto_adapter.c |  2 +-
 mk/rte.app.mk                                  |  1 +
 4 files changed, 10 insertions(+), 8 deletions(-)
Signature · 1 line
2.1.4
author
#1 lore raw

PATCH 1/4 app: add LDFLAGS -latomic to link atomic lib

For ARM64 platform, libdpdk.a includes the librte_pmd_octeontx_ssovf.a, which requires the libatomic.a support.The atomic lib is built-in in the gcc toolchain, but for clang it has to be explicitly linked.
For more details, please refer to https://clang.llvm.org/docs/Toolchain.html

~/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function `timvf_timer_cancel_burst':
timvf_worker.c:(.text+0x80): undefined reference to __atomic_fetch_add_8' /home/gavin/arm_repo/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function timvf_timer_arm_burst_sp':
timvf_worker.c:(.text+0x200): undefined reference to __atomic_fetch_add_8' timvf_worker.c:(.text+0x244): undefined reference to __atomic_store_2' timvf_worker.c:(.text+0x278): undefined reference to __atomic_fetch_add_4' timvf_worker.c:(.text+0x30c): undefined reference to __atomic_store_2'

---
 mk/rte.app.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.app.mk +1 -0
index 438f99d..bca8325 100644
@@ -51,6 +51,7 @@ endif
 
 # Link only the libraries used in the application
 LDFLAGS += --as-needed
+LDFLAGS += -latomic
 
 # default path for libs
 _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib

Quoted 13 lines · Gavin Hu

For ARM64 platform, libdpdk.a includes the librte_pmd_octeontx_ssovf.a, which requires the libatomic.a support.The atomic lib is built-in in the gcc toolchain, but for clang it has to be explicitly linked.
For more details, please refer to https://clang.llvm.org/docs/Toolchain.html

~/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function `timvf_timer_cancel_burst':
timvf_worker.c:(.text+0x80): undefined reference to __atomic_fetch_add_8' /home/gavin/arm_repo/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function timvf_timer_arm_burst_sp':
timvf_worker.c:(.text+0x200): undefined reference to __atomic_fetch_add_8' timvf_worker.c:(.text+0x244): undefined reference to __atomic_store_2' timvf_worker.c:(.text+0x278): undefined reference to __atomic_fetch_add_4' timvf_worker.c:(.text+0x30c): undefined reference to __atomic_store_2'

Quoted 3 lines

---

Is an equivalent change also needed for the meson build too?

/Bruce

author
#3 lore raw

Re: [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib

Hi Bruce,

CC=clang Meson build did not hit this issue.

The GNU Makefile using clang hit this issue:
make config T=arm64-armv8a-linuxapp-clang

Best Regards,
Gavin

-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, May 15, 2018 5:00 PM
To: Gavin Hu <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib

Quoted 14 lines · Gavin Hu

For ARM64 platform, libdpdk.a includes the
librte_pmd_octeontx_ssovf.a, which requires the libatomic.a
support.The atomic lib is built-in in the gcc toolchain, but for clang it has to be explicitly linked. For more details, please refer to
https://clang.llvm.org/docs/Toolchain.html

~/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function `timvf_timer_cancel_burst':
timvf_worker.c:(.text+0x80): undefined reference to __atomic_fetch_add_8' /home/gavin/arm_repo/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function timvf_timer_arm_burst_sp':
timvf_worker.c:(.text+0x200): undefined reference to __atomic_fetch_add_8' timvf_worker.c:(.text+0x244): undefined reference to __atomic_store_2' timvf_worker.c:(.text+0x278): undefined reference to __atomic_fetch_add_4' timvf_worker.c:(.text+0x30c): undefined reference to __atomic_store_2'

Quoted 3 lines

---

Is an equivalent change also needed for the meson build too?

/Bruce
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Acked-by on v1 1/4
#4 lore raw

Re: [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib

In reply to Gavin Hu

-----Original Message-----

Quoted 19 lines

Date: Tue, 15 May 2018 04:28:41 -0400
From: Gavin Hu <[email protected]>
To: [email protected]
Subject: [dpdk-dev] [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib
X-Mailer: git-send-email 2.1.4

For ARM64 platform, libdpdk.a includes the librte_pmd_octeontx_ssovf.a, which requires the libatomic.a support.The atomic lib is built-in in the gcc toolchain, but for clang it has to be explicitly linked.
For more details, please refer to https://clang.llvm.org/docs/Toolchain.html

~/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function `timvf_timer_cancel_burst':
timvf_worker.c:(.text+0x80): undefined reference to __atomic_fetch_add_8' /home/gavin/arm_repo/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function timvf_timer_arm_burst_sp':
timvf_worker.c:(.text+0x200): undefined reference to __atomic_fetch_add_8' timvf_worker.c:(.text+0x244): undefined reference to __atomic_store_2' timvf_worker.c:(.text+0x278): undefined reference to __atomic_fetch_add_4' timvf_worker.c:(.text+0x30c): undefined reference to __atomic_store_2'

Quoted 2 lines

Following patch is part of upstream. Are you testing with following patch/upstream.

commit 55fbc92d7800100628579643c9ee2770614fef10

Author: Pavan Nikhilesh <[email protected]>
Date:   Wed May 9 02:56:00 2018 +0530

event/octeontx: fix build with clang 6

Clang 6 & 7 fail to naturally align packed structs due to this clang can't use 8byte atomic primitives and splits them into lesser atomic primitives. To use lesser atomic primitives we need to link
libatomic
(-latomic), instead supply alignment attribute to the compiler.

timvf_worker.c:(.text+0x498): undefined reference to
`__atomic_fetch_add_8'

    timvf_worker.c:(.text+0x525): undefined reference to
`__atomic_store_2'
    timvf_worker.c:(.text+0x557): undefined reference to
`__atomic_fetch_add_4'
    timvf_worker.c:(.text+0x5de): undefined reference to

`__atomic_store_2'

Fixes f874c1eb1519 ("event/octeontx: create and free timer

adapter")

Quoted 19 lines
---
 mk/rte.app.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.app.mk +1 -0
index 438f99d..bca8325 100644
@@ -51,6 +51,7 @@ endif
 
 # Link only the libraries used in the application
 LDFLAGS += --as-needed
+LDFLAGS += -latomic
 
 # default path for libs
 _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
Signature · 1 line
2.1.4
author
#5 lore raw

PATCH 2/4 Driver/Mellanox: fix PMD compiling issue

In reply to Gavin Hu
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/mlx5/mlx5_rxtx_vec_neon.h +6 -6
index 2673d6b..71a5eaf 100644
@@ -167,8 +167,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		vst1q_u8((void *)t_wqe, ctrl);
 		/* Fill ESEG in the header. */
 		vst1q_u16((void *)(t_wqe + 1),
-			  (uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
-					 0, 0, 0, 0 });
+			  ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
+					  0, 0, 0, 0 }));
 		txq->wqe_ci = wqe_ci;
 	}
 	if (!n)
@@ -300,10 +300,10 @@ txq_burst_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	vst1q_u8((void *)t_wqe, ctrl);
 	/* Fill ESEG in the header. */
 	vst1q_u8((void *)(t_wqe + 1),
-		 (uint8x16_t) { 0, 0, 0, 0,
-				cs_flags, 0, 0, 0,
-				0, 0, 0, 0,
-				0, 0, 0, 0 });
+		 ((uint8x16_t) { 0, 0, 0, 0,
+				 cs_flags, 0, 0, 0,
+				 0, 0, 0, 0,
+				 0, 0, 0, 0 }));
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	txq->stats.opackets += pkts_n;
 #endif
Signature · 1 line
2.1.4
#6 lore raw

Re: [PATCH 2/4] Driver/Mellanox: fix PMD compiling issue

-----Original Message-----

Quoted 6 lines

Date: Tue, 15 May 2018 04:28:42 -0400
From: Gavin Hu <[email protected]>
To: [email protected]
CC: Sirshak Das <[email protected]>
Subject: [dpdk-dev] [PATCH 2/4] Driver/Mellanox: fix PMD compiling issue
X-Mailer: git-send-email 2.1.4

Please add the reason and compilation error log.
and make sure to fix check patch.sh and check-gitlog.sh errors.

Quoted 42 lines
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/mlx5/mlx5_rxtx_vec_neon.h +6 -6
index 2673d6b..71a5eaf 100644
@@ -167,8 +167,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		vst1q_u8((void *)t_wqe, ctrl);
 		/* Fill ESEG in the header. */
 		vst1q_u16((void *)(t_wqe + 1),
-			  (uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
-					 0, 0, 0, 0 });
+			  ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
+					  0, 0, 0, 0 }));
 		txq->wqe_ci = wqe_ci;
 	}
 	if (!n)
@@ -300,10 +300,10 @@ txq_burst_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	vst1q_u8((void *)t_wqe, ctrl);
 	/* Fill ESEG in the header. */
 	vst1q_u8((void *)(t_wqe + 1),
-		 (uint8x16_t) { 0, 0, 0, 0,
-				cs_flags, 0, 0, 0,
-				0, 0, 0, 0,
-				0, 0, 0, 0 });
+		 ((uint8x16_t) { 0, 0, 0, 0,
+				 cs_flags, 0, 0, 0,
+				 0, 0, 0, 0,
+				 0, 0, 0, 0 }));
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	txq->stats.opackets += pkts_n;
 #endif
Signature · 1 line
2.1.4
author
#7 lore raw

PATCH 3/4 cryptodev: fix the clang compiling issue

In reply to Gavin Hu

~/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49: error: 'rte_memcpy' call operates on objects of type 'struct rte_event' while the size is based on a different type
'struct rte_event *' [-Werror,-Wsizeof-pointer-memaccess]
rte_memcpy(ev, &m_data->response_info, sizeof(ev));
~~ ^~
~/arm_repo/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?

                rte_memcpy(ev, &m_data->response_info, sizeof(ev));
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eventdev/rte_event_crypto_adapter.c +1 -1
index 831f842..cdca1ad 100644
@@ -527,7 +527,7 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
 			continue;
 		}
 
-		rte_memcpy(ev, &m_data->response_info, sizeof(ev));
+		rte_memcpy(ev, &m_data->response_info, sizeof(struct rte_event));
 		ev->event_ptr = ops[i];
 		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
 		if (adapter->implicit_release_disabled)
Signature · 1 line
2.1.4
author
#8 lore raw

PATCH 4/4 ifpgai_rawdev: fix the clang compiling issue

In reply to Gavin Hu

Newly introduced #pragma pack(1) in the header file caused comipiling issues for the files who included it.

In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_fme_dperf.c:5:
In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_feature_dev.h:8:
~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_hw.h:8:10: error: the current #pragma pack aligment value is modified in the included file [-Werror,-Wpragma-pack] ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_defines.h:100:9: note: previous '#pragma pack' directive that modifies alignment is here.

The fix is to change the #pragma pack alignment locally and not have effect on other files who included this header file.

---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/raw/ifpga_rawdev/base/ifpga_defines.h +2 -1
index 0b9622d..beeedf1 100644
@@ -97,7 +97,7 @@ enum port_feature_id {
 /*
  * All headers and structures must be byte-packed to match the spec.
  */
-#pragma pack(1)
+#pragma pack(push,1)
 
 struct feature_header {
 	union {
@@ -1659,4 +1659,5 @@ struct bts_header {
 	(((bts_hdr)->guid_h == GBS_GUID_H) &&		\
 	((bts_hdr)->guid_l == GBS_GUID_L))
 
+#pragma pack(pop)
 #endif /* _BASE_IFPGA_DEFINES_H_ */
Signature · 1 line
2.1.4
author
#9 lore raw

PATCH v2 1/4 app: add LDFLAGS -latomic to link atomic lib

In reply to Gavin Hu

For ARM64 platform, libdpdk.a includes the librte_pmd_octeontx_ssovf.a, which requires the libatomic.a support.The atomic lib is built-in in the gcc toolchain, but for clang it has to be explicitly linked.
For more details, please refer to https://clang.llvm.org/docs/Toolchain.html

~/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function `timvf_timer_cancel_burst':
timvf_worker.c:(.text+0x80): undefined reference to `__atomic_fetch_add_8' /home/gavin/arm_repo/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o):
In function `timvf_timer_arm_burst_sp':
timvf_worker.c:(.text+0x200): undefined reference to __atomic_fetch_add_8' timvf_worker.c:(.text+0x244): undefined reference to __atomic_store_2' timvf_worker.c:(.text+0x278): undefined reference to __atomic_fetch_add_4' timvf_worker.c:(.text+0x30c): undefined reference to __atomic_store_2'

---
 mk/rte.app.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.app.mk +1 -0
index 438f99d..bca8325 100644
@@ -51,6 +51,7 @@ endif
 
 # Link only the libraries used in the application
 LDFLAGS += --as-needed
+LDFLAGS += -latomic
 
 # default path for libs
 _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
Signature · 1 line
2.1.4
author
#10 lore raw

PATCH v2 2/4 Driver/Mellanox: fix PMD compiling issue

---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/mlx5/mlx5_rxtx_vec_neon.h +6 -6
index 2673d6b..71a5eaf 100644
@@ -167,8 +167,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		vst1q_u8((void *)t_wqe, ctrl);
 		/* Fill ESEG in the header. */
 		vst1q_u16((void *)(t_wqe + 1),
-			  (uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
-					 0, 0, 0, 0 });
+			  ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
+					  0, 0, 0, 0 }));
 		txq->wqe_ci = wqe_ci;
 	}
 	if (!n)
@@ -300,10 +300,10 @@ txq_burst_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	vst1q_u8((void *)t_wqe, ctrl);
 	/* Fill ESEG in the header. */
 	vst1q_u8((void *)(t_wqe + 1),
-		 (uint8x16_t) { 0, 0, 0, 0,
-				cs_flags, 0, 0, 0,
-				0, 0, 0, 0,
-				0, 0, 0, 0 });
+		 ((uint8x16_t) { 0, 0, 0, 0,
+				 cs_flags, 0, 0, 0,
+				 0, 0, 0, 0,
+				 0, 0, 0, 0 }));
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	txq->stats.opackets += pkts_n;
 #endif
Signature · 1 line
2.1.4
#11 lore raw

Re: [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue

Quoted 2 lines · Gavin Hu

The title should start from 'net/mlx5: ...' and please be more specific why that pair of parentheses is needed. Add more commit messages and it'd be better to add the error messages like you do in the other commit.

To me, it still looks unnecessary.

Thanks,
Yongseok

Quoted 41 lines

---
drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------

1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/mlx5/mlx5_rxtx_vec_neon.h +6 -6
index 2673d6b..71a5eaf 100644
@@ -167,8 +167,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		vst1q_u8((void *)t_wqe, ctrl);
 		/* Fill ESEG in the header. */
 		vst1q_u16((void *)(t_wqe + 1),
-			  (uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
-					 0, 0, 0, 0 });
+			  ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
+					  0, 0, 0, 0 }));
 		txq->wqe_ci = wqe_ci;
 	}
 	if (!n)
@@ -300,10 +300,10 @@ txq_burst_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	vst1q_u8((void *)t_wqe, ctrl);
 	/* Fill ESEG in the header. */
 	vst1q_u8((void *)(t_wqe + 1),
-		 (uint8x16_t) { 0, 0, 0, 0,
-				cs_flags, 0, 0, 0,
-				0, 0, 0, 0,
-				0, 0, 0, 0 });
+		 ((uint8x16_t) { 0, 0, 0, 0,
+				 cs_flags, 0, 0, 0,
+				 0, 0, 0, 0,
+				 0, 0, 0, 0 }));
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	txq->stats.opackets += pkts_n;
 #endif
Signature · 1 line
2.1.4
#12 lore raw

Re: [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue

Hi Yongseok,

We will make the commit message more verbose.
As for the error: This is a clang compiler issue:
drivers/net/mlx5/mlx5_rxtx_vec.c:37:
/home/sirdas/code/commitc/dpdk-stable-18.02.1/drivers/net/mlx5/mlx5_rxtx_vec_neon.h:170:24: error: too many arguments provided to function-like macro invocation

                          (uint16x8_t) { 0, 0, cs_flags,
                          rte_cpu_to_be_16(len),

Thank you
Sirshak Das.

Quoted 52 lines · Yongseok Koh
Quoted 1 line · Gavin Hu

The title should start from 'net/mlx5: ...' and please be more specific why that pair of parentheses is needed. Add more commit messages and it'd be better to add the error messages like you do in the other commit.

To me, it still looks unnecessary.

Thanks,
Yongseok

Quoted 41 lines

---
drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------

1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/mlx5/mlx5_rxtx_vec_neon.h +6 -6
index 2673d6b..71a5eaf 100644
@@ -167,8 +167,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		vst1q_u8((void *)t_wqe, ctrl);
 		/* Fill ESEG in the header. */
 		vst1q_u16((void *)(t_wqe + 1),
-			  (uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
-					 0, 0, 0, 0 });
+			  ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
+					  0, 0, 0, 0 }));
 		txq->wqe_ci = wqe_ci;
 	}
 	if (!n)
@@ -300,10 +300,10 @@ txq_burst_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	vst1q_u8((void *)t_wqe, ctrl);
 	/* Fill ESEG in the header. */
 	vst1q_u8((void *)(t_wqe + 1),
-		 (uint8x16_t) { 0, 0, 0, 0,
-				cs_flags, 0, 0, 0,
-				0, 0, 0, 0,
-				0, 0, 0, 0 });
+		 ((uint8x16_t) { 0, 0, 0, 0,
+				 cs_flags, 0, 0, 0,
+				 0, 0, 0, 0,
+				 0, 0, 0, 0 }));
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	txq->stats.opackets += pkts_n;
 #endif
Signature · 1 line
2.1.4
Acked-by
#13 lore raw

Re: [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue

Quoted 11 lines · Sirshak Das

Hi Yongseok,

We will make the commit message more verbose.
As for the error: This is a clang compiler issue:
drivers/net/mlx5/mlx5_rxtx_vec.c:37:
/home/sirdas/code/commitc/dpdk-stable-18.02.1/drivers/net/mlx5/mlx5_rxtx_vec_neon.h:170:24: error: too many arguments provided to function-like macro invocation

                         (uint16x8_t) { 0, 0, cs_flags,
                         rte_cpu_to_be_16(len),

Thanks for explanation.

Please add my acked-by tag when you submit the new version with
a) title change b) verbose commit message.

Thank you for contribution!
Yongseok

Quoted 55 lines
Quoted 52 lines · Yongseok Koh
Quoted 1 line · Gavin Hu

The title should start from 'net/mlx5: ...' and please be more specific why that pair of parentheses is needed. Add more commit messages and it'd be better to add the error messages like you do in the other commit.

To me, it still looks unnecessary.

Thanks,
Yongseok

Quoted 41 lines

---
drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------

1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/mlx5/mlx5_rxtx_vec_neon.h +6 -6
index 2673d6b..71a5eaf 100644
@@ -167,8 +167,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		vst1q_u8((void *)t_wqe, ctrl);
 		/* Fill ESEG in the header. */
 		vst1q_u16((void *)(t_wqe + 1),
-			  (uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
-					 0, 0, 0, 0 });
+			  ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
+					  0, 0, 0, 0 }));
 		txq->wqe_ci = wqe_ci;
 	}
 	if (!n)
@@ -300,10 +300,10 @@ txq_burst_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	vst1q_u8((void *)t_wqe, ctrl);
 	/* Fill ESEG in the header. */
 	vst1q_u8((void *)(t_wqe + 1),
-		 (uint8x16_t) { 0, 0, 0, 0,
-				cs_flags, 0, 0, 0,
-				0, 0, 0, 0,
-				0, 0, 0, 0 });
+		 ((uint8x16_t) { 0, 0, 0, 0,
+				 cs_flags, 0, 0, 0,
+				 0, 0, 0, 0,
+				 0, 0, 0, 0 }));
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	txq->stats.opackets += pkts_n;
 #endif
Signature · 1 line
2.1.4
author
#14 lore raw

PATCH v2 3/4 cryptodev: fix the clang compiling issue

In reply to Gavin Hu

~/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49: error:
'rte_memcpy' call operates on objects of type 'struct rte_event' while the size is based on a different type
'struct rte_event *' [-Werror,-Wsizeof-pointer-memaccess]
rte_memcpy(ev, &m_data->response_info, sizeof(ev));
~/arm_repo/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49:
note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?

      rte_memcpy(ev, &m_data->response_info, sizeof(ev));
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_eventdev/rte_event_crypto_adapter.c +2 -1
index 831f842..0f34fe0 100644
@@ -527,7 +527,8 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
 			continue;
 		}
 
-		rte_memcpy(ev, &m_data->response_info, sizeof(ev));
+		rte_memcpy(ev, &m_data->response_info,
+			sizeof(struct rte_event));
 		ev->event_ptr = ops[i];
 		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
 		if (adapter->implicit_release_disabled)
Signature · 1 line
2.1.4
#15 lore raw

Re: [PATCH v2 3/4] cryptodev: fix the clang compiling issue

-----Original Message-----

Quoted 27 lines

Date: Tue, 15 May 2018 05:23:46 -0400
From: Gavin Hu <[email protected]>
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 3/4] cryptodev: fix the clang compiling issue
X-Mailer: git-send-email 2.1.4

~/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49: error:
'rte_memcpy' call operates on objects of type 'struct rte_event' while the size is based on a different type
'struct rte_event *' [-Werror,-Wsizeof-pointer-memaccess]
rte_memcpy(ev, &m_data->response_info, sizeof(ev));
~/arm_repo/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49:
note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?

      rte_memcpy(ev, &m_data->response_info, sizeof(ev));
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_eventdev/rte_event_crypto_adapter.c +0 -0
index 831f842..0f34fe0 100644

lib/librte_eventdev/rte_event_crypto_adapter.c eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter, · line 531

Quoted 6 lines
lib/librte_eventdev/rte_event_crypto_adapter.c +2 -1
@@ -527,7 +527,8 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
 			continue;
 		}
 
-		rte_memcpy(ev, &m_data->response_info, sizeof(ev));
+		rte_memcpy(ev, &m_data->response_info,
+			sizeof(struct rte_event));

Following could be a shorter replacement.

rte_memcpy(ev, &m_data->response_info, sizeof(*ev));

Quoted 6 lines
lib/librte_eventdev/rte_event_crypto_adapter.c +0 -0
 		ev->event_ptr = ops[i];
 		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
 		if (adapter->implicit_release_disabled)
Signature · 1 line
2.1.4
#16 lore raw

Re: [PATCH v2 3/4] cryptodev: fix the clang compiling issue

Quoted 16 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Jerin Jacob
Sent: Tuesday, May 15, 2018 12:42 PM
To: Gavin Hu <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 3/4] cryptodev: fix the clang compiling issue

-----Original Message-----

Quoted 6 lines

Date: Tue, 15 May 2018 05:23:46 -0400
From: Gavin Hu <[email protected]>
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 3/4] cryptodev: fix the clang compiling issue
X-Mailer: git-send-email 2.1.4

Wrong title, should be "eventdev: fix clang build".

Quoted 41 lines

lib/librte_eventdev/rte_event_crypto_adapter.c eca_ops_enqueue_burst(struct

Quoted 23 lines

~/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49: error:
'rte_memcpy' call operates on objects of type 'struct rte_event' while the size is based on a different type
'struct rte_event *' [-Werror,-Wsizeof-pointer-memaccess]
rte_memcpy(ev, &m_data->response_info, sizeof(ev));
~/arm_repo/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49:
note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?

      rte_memcpy(ev, &m_data->response_info, sizeof(ev));
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_eventdev/rte_event_crypto_adapter.c +0 -0
index 831f842..0f34fe0 100644
@@ -527,7 +527,8 @@ eca_ops_enqueue_burst(struct

rte_event_crypto_adapter *adapter,

lib/librte_eventdev/rte_event_crypto_adapter.c eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter, · line 531

Quoted 6 lines
lib/librte_eventdev/rte_event_crypto_adapter.c +2 -1
 			continue;
 		}
 
-		rte_memcpy(ev, &m_data->response_info, sizeof(ev));
+		rte_memcpy(ev, &m_data->response_info,
+			sizeof(struct rte_event));

Following could be a shorter replacement.

rte_memcpy(ev, &m_data->response_info, sizeof(*ev));

Quoted 6 lines
lib/librte_eventdev/rte_event_crypto_adapter.c +0 -1
 		ev->event_ptr = ops[i];
 		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
 		if (adapter->implicit_release_disabled)
--

2.1.4

author
#17 lore raw

PATCH v2 4/4 ifpgai_rawdev: fix the clang compiling issue

In reply to Gavin Hu

Newly introduced #pragma pack(1) in the header file caused comipiling issues for the files who included it.

In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_fme_dperf.c:5:
In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_feature_dev.h:8:
~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_hw.h:8:10: error: the current #pragma pack aligment value is modified in the included file [-Werror,-Wpragma-pack] ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_defines.h:100:9: note: previous '#pragma pack' directive that modifies alignment is here.

The fix is to change the #pragma pack alignment locally and not have effect on other files who included this header file.

---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/raw/ifpga_rawdev/base/ifpga_defines.h +2 -1
index 0b9622d..aa02527 100644
@@ -97,7 +97,7 @@ enum port_feature_id {
 /*
  * All headers and structures must be byte-packed to match the spec.
  */
-#pragma pack(1)
+#pragma pack(push, 1)
 
 struct feature_header {
 	union {
@@ -1659,4 +1659,5 @@ struct bts_header {
 	(((bts_hdr)->guid_h == GBS_GUID_H) &&		\
 	((bts_hdr)->guid_l == GBS_GUID_L))
 
+#pragma pack(pop)
 #endif /* _BASE_IFPGA_DEFINES_H_ */
Signature · 1 line
2.1.4
Acked-by on v2 4/4
#18 lore raw

Re: [PATCH v2 4/4] ifpgai_rawdev: fix the clang compiling issue

-----Original Message-----

Quoted 17 lines

Date: Tue, 15 May 2018 05:23:47 -0400
From: Gavin Hu <[email protected]>
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 4/4] ifpgai_rawdev: fix the clang compiling
issue
X-Mailer: git-send-email 2.1.4

Newly introduced #pragma pack(1) in the header file caused comipiling issues for the files who included it.

In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_fme_dperf.c:5:
In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_feature_dev.h:8:
~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_hw.h:8:10: error: the current #pragma pack aligment value is modified in the included file [-Werror,-Wpragma-pack] ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_defines.h:100:9: note: previous '#pragma pack' directive that modifies alignment is here.

Quoted 5 lines

The fix is to change the #pragma pack alignment locally and not have effect on other files who included this header file.

Perhaps this fixes compilation issues clang6 + x86 too.

Please change the subject line to start with raw/ifpga:....

With above change:

Quoted 26 lines
---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/raw/ifpga_rawdev/base/ifpga_defines.h +2 -1
index 0b9622d..aa02527 100644
@@ -97,7 +97,7 @@ enum port_feature_id {
 /*
  * All headers and structures must be byte-packed to match the spec.
  */
-#pragma pack(1)
+#pragma pack(push, 1)
 
 struct feature_header {
 	union {
@@ -1659,4 +1659,5 @@ struct bts_header {
 	(((bts_hdr)->guid_h == GBS_GUID_H) &&		\
 	((bts_hdr)->guid_l == GBS_GUID_L))
 
+#pragma pack(pop)
 #endif /* _BASE_IFPGA_DEFINES_H_ */
Signature · 1 line
2.1.4
#19 lore raw

Re: [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib

In reply to Gavin Hu

-----Original Message-----

Quoted 22 lines

Date: Tue, 15 May 2018 05:23:44 -0400
From: Gavin Hu <[email protected]>
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic
lib
X-Mailer: git-send-email 2.1.4

For ARM64 platform, libdpdk.a includes the librte_pmd_octeontx_ssovf.a, which requires the libatomic.a support.The atomic lib is built-in in the gcc toolchain, but for clang it has to be explicitly linked.
For more details, please refer to https://clang.llvm.org/docs/Toolchain.html

~/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function `timvf_timer_cancel_burst':
timvf_worker.c:(.text+0x80): undefined reference to `__atomic_fetch_add_8' /home/gavin/arm_repo/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o):
In function `timvf_timer_arm_burst_sp':
timvf_worker.c:(.text+0x200): undefined reference to __atomic_fetch_add_8' timvf_worker.c:(.text+0x244): undefined reference to __atomic_store_2' timvf_worker.c:(.text+0x278): undefined reference to __atomic_fetch_add_4' timvf_worker.c:(.text+0x30c): undefined reference to __atomic_store_2'

Quoted 2 lines

Following comments are not addressed in v2.

https://dpdk.org/ml/archives/dev/2018-May/101799.html
https://dpdk.org/ml/archives/dev/2018-May/101802.html

Quoted 19 lines
---
 mk/rte.app.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.app.mk +1 -0
index 438f99d..bca8325 100644
@@ -51,6 +51,7 @@ endif
 
 # Link only the libraries used in the application
 LDFLAGS += --as-needed
+LDFLAGS += -latomic
 
 # default path for libs
 _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
Signature · 1 line
2.1.4
author
#20 lore raw

PATCH v3 1/3 net/mlx5: fix the clang compiling issue

In reply to Gavin Hu

From: gavin hu <[email protected]>

This patch adds a pair of "()" to embrace the argument input to the function-like macro invocation.

drivers/net/mlx5/mlx5_rxtx_vec.c:37:
drivers/net/mlx5/mlx5_rxtx_vec_neon.h:170:24: error: too many arguments provided to function-like macro invocation

	(uint16x8_t) { 0, 0, cs_flags,
	rte_cpu_to_be_16(len),
Fixes 570acdb1da ("net/mlx5: add vectorized Rx/Tx burst for ARM")
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/mlx5/mlx5_rxtx_vec_neon.h +6 -6
index 2673d6b8c..71a5eaf23 100644
@@ -167,8 +167,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		vst1q_u8((void *)t_wqe, ctrl);
 		/* Fill ESEG in the header. */
 		vst1q_u16((void *)(t_wqe + 1),
-			  (uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
-					 0, 0, 0, 0 });
+			  ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
+					  0, 0, 0, 0 }));
 		txq->wqe_ci = wqe_ci;
 	}
 	if (!n)
@@ -300,10 +300,10 @@ txq_burst_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	vst1q_u8((void *)t_wqe, ctrl);
 	/* Fill ESEG in the header. */
 	vst1q_u8((void *)(t_wqe + 1),
-		 (uint8x16_t) { 0, 0, 0, 0,
-				cs_flags, 0, 0, 0,
-				0, 0, 0, 0,
-				0, 0, 0, 0 });
+		 ((uint8x16_t) { 0, 0, 0, 0,
+				 cs_flags, 0, 0, 0,
+				 0, 0, 0, 0,
+				 0, 0, 0, 0 }));
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	txq->stats.opackets += pkts_n;
 #endif
Signature · 1 line
2.17.0
author
#21 lore raw

PATCH v3 2/3 eventdev: fix the clang compiling issue

From: gavin hu <[email protected]>

This patch fix the clang compiling issue reported on the ARM64 builing host. ev is a pointer in size of 64bit, but the herein it should be the size of its content.

~/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49: error:
'rte_memcpy' call operates on objects of type 'struct rte_event' while the size is based on a different type
'struct rte_event *' [-Werror,-Wsizeof-pointer-memaccess]
rte_memcpy(ev, &m_data->response_info, sizeof(ev));
~/arm_repo/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49:
note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?

      rte_memcpy(ev, &m_data->response_info, sizeof(ev));
Fixes 7901eac340 ("eventdev: add crypto adapter implementation")
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eventdev/rte_event_crypto_adapter.c +1 -1
index 831f84248..ba63a87b7 100644
@@ -527,7 +527,7 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
 			continue;
 		}
 
-		rte_memcpy(ev, &m_data->response_info, sizeof(ev));
+		rte_memcpy(ev, &m_data->response_info, sizeof(*ev));
 		ev->event_ptr = ops[i];
 		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
 		if (adapter->implicit_release_disabled)
Signature · 1 line
2.17.0
author
#22 lore raw

PATCH v3 3/3 raw/ifpga_rawdev: fix the clang compiling issue

In reply to Gavin Hu

From: gavin hu <[email protected]>

The patch fixes the compile issue with clang on ARM64.

Newly introduced #pragma pack(1) in the header file caused comipiling issues for the files who included it.

In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ ifpga_fme_dperf.c:5:
In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ ifpga_feature_dev.h:8:
~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_hw.h:8:10: error:
the current #pragma
pack alignment value is modified in the included file [-Werror, -Wpragma-pack] ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_defines.h:100:9: note:
previous '#pragma pack' directive that modifies alignment is here.

The fix is to change the #pragma pack alignment locally and not have effect on other files who included this header file.

Fixes 56bb54ea1bdf ("raw/ifpga/base: add Intel FPGA OPAE share code")
---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/raw/ifpga_rawdev/base/ifpga_defines.h +2 -1
index 0b9622d5f..aa0252720 100644
@@ -97,7 +97,7 @@ enum port_feature_id {
 /*
  * All headers and structures must be byte-packed to match the spec.
  */
-#pragma pack(1)
+#pragma pack(push, 1)
 
 struct feature_header {
 	union {
@@ -1659,4 +1659,5 @@ struct bts_header {
 	(((bts_hdr)->guid_h == GBS_GUID_H) &&		\
 	((bts_hdr)->guid_l == GBS_GUID_L))
 
+#pragma pack(pop)
 #endif /* _BASE_IFPGA_DEFINES_H_ */
Signature · 1 line
2.17.0
Acked-by on v3 3/3
#23 lore raw

Re: [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue

-----Original Message-----

Quoted 11 lines

Date: Wed, 16 May 2018 14:08:02 +0800
From: Gavin Hu <[email protected]>
To: [email protected]
CC: gavin hu <[email protected]>
Subject: [dpdk-dev] [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang
compiling issue
X-Mailer: git-send-email 2.17.0

From: gavin hu <[email protected]>

The patch fixes the compile issue with clang on ARM64.

Even ARM64 gcc 8.1 could detect this as an error and this patch fixes too.

Quoted 15 lines

Newly introduced #pragma pack(1) in the header file caused comipiling issues for the files who included it.

In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ ifpga_fme_dperf.c:5:
In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ ifpga_feature_dev.h:8:
~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_hw.h:8:10: error:
the current #pragma
pack alignment value is modified in the included file [-Werror, -Wpragma-pack] ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_defines.h:100:9: note:
previous '#pragma pack' directive that modifies alignment is here.

Quoted 7 lines

The fix is to change the #pragma pack alignment locally and not have effect on other files who included this header file.

Fixes 56bb54ea1bdf ("raw/ifpga/base: add Intel FPGA OPAE share code")

The subject could change to raw/ifpga: if Maintainer wishes to do so to maintain the consistency.

Quoted 26 lines
---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/raw/ifpga_rawdev/base/ifpga_defines.h +2 -1
index 0b9622d5f..aa0252720 100644
@@ -97,7 +97,7 @@ enum port_feature_id {
 /*
  * All headers and structures must be byte-packed to match the spec.
  */
-#pragma pack(1)
+#pragma pack(push, 1)
 
 struct feature_header {
 	union {
@@ -1659,4 +1659,5 @@ struct bts_header {
 	(((bts_hdr)->guid_h == GBS_GUID_H) &&		\
 	((bts_hdr)->guid_l == GBS_GUID_L))
 
+#pragma pack(pop)
 #endif /* _BASE_IFPGA_DEFINES_H_ */
Signature · 1 line
2.17.0
author Acked-by Jerin Jacob
#24 lore raw

Re: [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue

If the subject changes to raw/ifpga, it will get a Wrong headline prefix(can be ignored?) warning when running git-log-fixes.h

Wrong headline prefix:
raw/ifpga: fix the clang compiling issue

-----Original Message-----
From: Jerin Jacob <[email protected]>
Sent: Wednesday, May 16, 2018 2:46 PM
To: Gavin Hu <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue

-----Original Message-----

Quoted 11 lines

Date: Wed, 16 May 2018 14:08:02 +0800
From: Gavin Hu <[email protected]>
To: [email protected]
CC: gavin hu <[email protected]>
Subject: [dpdk-dev] [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue
X-Mailer: git-send-email 2.17.0

From: gavin hu <[email protected]>

The patch fixes the compile issue with clang on ARM64.

Even ARM64 gcc 8.1 could detect this as an error and this patch fixes too.

Quoted 15 lines

Newly introduced #pragma pack(1) in the header file caused comipiling issues for the files who included it.

In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ ifpga_fme_dperf.c:5:
In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ ifpga_feature_dev.h:8:
~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_hw.h:8:10: error:
the current #pragma
pack alignment value is modified in the included file [-Werror, -Wpragma-pack] ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_defines.h:100:9: note:
previous '#pragma pack' directive that modifies alignment is here.

Quoted 7 lines

The fix is to change the #pragma pack alignment locally and not have effect on other files who included this header file.

Fixes 56bb54ea1bdf ("raw/ifpga/base: add Intel FPGA OPAE share code")

The subject could change to raw/ifpga: if Maintainer wishes to do so to maintain the consistency.

Quoted 25 lines
---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/raw/ifpga_rawdev/base/ifpga_defines.h +2 -2
index 0b9622d5f..aa0252720 100644
@@ -97,7 +97,7 @@ enum port_feature_id {
 /*
  * All headers and structures must be byte-packed to match the spec.
  */
-#pragma pack(1)
+#pragma pack(push, 1)
 
 struct feature_header {
 union {
@@ -1659,4 +1659,5 @@ struct bts_header {
 (((bts_hdr)->guid_h == GBS_GUID_H) &&\
 ((bts_hdr)->guid_l == GBS_GUID_L))
 
+#pragma pack(pop)
 #endif /* _BASE_IFPGA_DEFINES_H_ */
--
Quoted 2 lines

2.17.0

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#25 lore raw

Re: [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue

17/05/2018 03:47, Gavin Hu:

Quoted 1 line

If the subject changes to raw/ifpga, it will get a Wrong headline prefix(can be ignored?) warning when running git-log-fixes.h

Yes, this warning can be ignored.

author
#26 lore raw

PATCH v4 1/3 net/mlx5: fix the clang compiling issue

In reply to Gavin Hu

From: gavin hu <[email protected]>

This patch adds a pair of "()" to embrace the argument input to the function-like macro invocation.

drivers/net/mlx5/mlx5_rxtx_vec.c:37:
drivers/net/mlx5/mlx5_rxtx_vec_neon.h:170:24: error: too many arguments provided to function-like macro invocation

	(uint16x8_t) { 0, 0, cs_flags,
	rte_cpu_to_be_16(len),
Fixes 570acdb1da ("net/mlx5: add vectorized Rx/Tx burst for ARM")
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/mlx5/mlx5_rxtx_vec_neon.h +6 -6
index 2673d6b8c..71a5eaf23 100644
@@ -167,8 +167,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		vst1q_u8((void *)t_wqe, ctrl);
 		/* Fill ESEG in the header. */
 		vst1q_u16((void *)(t_wqe + 1),
-			  (uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
-					 0, 0, 0, 0 });
+			  ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
+					  0, 0, 0, 0 }));
 		txq->wqe_ci = wqe_ci;
 	}
 	if (!n)
@@ -300,10 +300,10 @@ txq_burst_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	vst1q_u8((void *)t_wqe, ctrl);
 	/* Fill ESEG in the header. */
 	vst1q_u8((void *)(t_wqe + 1),
-		 (uint8x16_t) { 0, 0, 0, 0,
-				cs_flags, 0, 0, 0,
-				0, 0, 0, 0,
-				0, 0, 0, 0 });
+		 ((uint8x16_t) { 0, 0, 0, 0,
+				 cs_flags, 0, 0, 0,
+				 0, 0, 0, 0,
+				 0, 0, 0, 0 }));
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	txq->stats.opackets += pkts_n;
 #endif
Signature · 1 line
2.17.0
author
#27 lore raw

PATCH v4 2/3 eventdev: fix the clang compiling issue

From: gavin hu <[email protected]>

This patch fix the clang compiling issue reported on the ARM64 builing hosts. ev is a pointer in size of 64bit, but herein it should be the size of its content.

~/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49: error:
'rte_memcpy' call operates on objects of type 'struct rte_event' while the size is based on a different type
'struct rte_event *' [-Werror,-Wsizeof-pointer-memaccess]
rte_memcpy(ev, &m_data->response_info, sizeof(ev));
~/arm_repo/dpdk/lib/librte_eventdev/rte_event_crypto_adapter.c:530:49:
note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?

      rte_memcpy(ev, &m_data->response_info, sizeof(ev));
Fixes 7901eac340 ("eventdev: add crypto adapter implementation")
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eventdev/rte_event_crypto_adapter.c +1 -1
index 831f84248..ba63a87b7 100644
@@ -527,7 +527,7 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
 			continue;
 		}
 
-		rte_memcpy(ev, &m_data->response_info, sizeof(ev));
+		rte_memcpy(ev, &m_data->response_info, sizeof(*ev));
 		ev->event_ptr = ops[i];
 		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
 		if (adapter->implicit_release_disabled)
Signature · 1 line
2.17.0
author
#28 lore raw

PATCH v4 3/3 raw/ifpga: fix the clang compiling issue

In reply to Gavin Hu

From: gavin hu <[email protected]>

The patch fixes the compile issue with clang on ARM64, as well as clang + X86 builing hosts.

Newly introduced #pragma pack(1) in the header file caused comipiling issues for the files who included it.

In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ ifpga_fme_dperf.c:5:
In file included from ~/dpdk/drivers/raw/ifpga_rawdev/base/ ifpga_feature_dev.h:8:
~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_hw.h:8:10: error:
the current #pragma
pack alignment value is modified in the included file [-Werror, -Wpragma-pack] ~/dpdk/drivers/raw/ifpga_rawdev/base/ifpga_defines.h:100:9: note:
previous '#pragma pack' directive that modifies alignment is here.

The fix is to change the #pragma pack alignment locally and not have effect on other files who included this header file.

Fixes 56bb54ea1bdf ("raw/ifpga/base: add Intel FPGA OPAE share code")
---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/raw/ifpga_rawdev/base/ifpga_defines.h +2 -1
index 0b9622d5f..aa0252720 100644
@@ -97,7 +97,7 @@ enum port_feature_id {
 /*
  * All headers and structures must be byte-packed to match the spec.
  */
-#pragma pack(1)
+#pragma pack(push, 1)
 
 struct feature_header {
 	union {
@@ -1659,4 +1659,5 @@ struct bts_header {
 	(((bts_hdr)->guid_h == GBS_GUID_H) &&		\
 	((bts_hdr)->guid_l == GBS_GUID_L))
 
+#pragma pack(pop)
 #endif /* _BASE_IFPGA_DEFINES_H_ */
Signature · 1 line
2.17.0
#29 lore raw

Re: [PATCH v4 1/3] net/mlx5: fix the clang compiling issue

In reply to Gavin Hu

17/05/2018 04:46, Gavin Hu:

Quoted 14 lines

From: gavin hu <[email protected]>

This patch adds a pair of "()" to embrace the argument input to the function-like macro invocation.

drivers/net/mlx5/mlx5_rxtx_vec.c:37:
drivers/net/mlx5/mlx5_rxtx_vec_neon.h:170:24: error: too many arguments provided to function-like macro invocation

	(uint16x8_t) { 0, 0, cs_flags,
	rte_cpu_to_be_16(len),
Fixes 570acdb1da ("net/mlx5: add vectorized Rx/Tx burst for ARM")
Quoted 6 lines

Series applied, thanks