All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] *** fix native clang compiling errors on ARM64 ***
@ 2018-05-15  8:28 Gavin Hu
  2018-05-15  8:28 ` [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
                   ` (6 more replies)
  0 siblings, 7 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-15  8:28 UTC (permalink / raw)
  To: dev

*** 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(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib
  2018-05-15  8:28 [PATCH 0/4] *** fix native clang compiling errors on ARM64 *** Gavin Hu
@ 2018-05-15  8:28 ` Gavin Hu
  2018-05-15  9:00   ` Bruce Richardson
  2018-05-15  9:07   ` Jerin Jacob
  2018-05-15  8:28 ` [PATCH 2/4] Driver/Mellanox: fix PMD compiling issue Gavin Hu
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-15  8:28 UTC (permalink / raw)
  To: dev

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'

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 mk/rte.app.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 438f99d..bca8325 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -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
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/4] Driver/Mellanox: fix PMD compiling issue
  2018-05-15  8:28 [PATCH 0/4] *** fix native clang compiling errors on ARM64 *** Gavin Hu
  2018-05-15  8:28 ` [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
@ 2018-05-15  8:28 ` Gavin Hu
  2018-05-15  9:11   ` Jerin Jacob
  2018-05-15  8:28 ` [PATCH 3/4] cryptodev: fix the clang " Gavin Hu
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 30+ messages in thread
From: Gavin Hu @ 2018-05-15  8:28 UTC (permalink / raw)
  To: dev; +Cc: Sirshak Das

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Sirshak Das <sirshak.das@arm.com>
Reviewed-by: Phil Yang <Phil.Yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index 2673d6b..71a5eaf 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -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
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 3/4] cryptodev: fix the clang compiling issue
  2018-05-15  8:28 [PATCH 0/4] *** fix native clang compiling errors on ARM64 *** Gavin Hu
  2018-05-15  8:28 ` [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
  2018-05-15  8:28 ` [PATCH 2/4] Driver/Mellanox: fix PMD compiling issue Gavin Hu
@ 2018-05-15  8:28 ` Gavin Hu
  2018-05-15  8:28 ` [PATCH 4/4] ifpgai_rawdev: " Gavin Hu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-15  8:28 UTC (permalink / raw)
  To: dev

~/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));

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c
index 831f842..cdca1ad 100644
--- a/lib/librte_eventdev/rte_event_crypto_adapter.c
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
@@ -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)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 4/4] ifpgai_rawdev: fix the clang compiling issue
  2018-05-15  8:28 [PATCH 0/4] *** fix native clang compiling errors on ARM64 *** Gavin Hu
                   ` (2 preceding siblings ...)
  2018-05-15  8:28 ` [PATCH 3/4] cryptodev: fix the clang " Gavin Hu
@ 2018-05-15  8:28 ` Gavin Hu
  2018-05-15  9:23 ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-15  8:28 UTC (permalink / raw)
  To: dev

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.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
index 0b9622d..beeedf1 100644
--- a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
+++ b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
@@ -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_ */
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib
  2018-05-15  8:28 ` [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
@ 2018-05-15  9:00   ` Bruce Richardson
  2018-05-15 10:10     ` Gavin Hu
  2018-05-15  9:07   ` Jerin Jacob
  1 sibling, 1 reply; 30+ messages in thread
From: Bruce Richardson @ 2018-05-15  9:00 UTC (permalink / raw)
  To: Gavin Hu; +Cc: dev

On Tue, May 15, 2018 at 04:28:41AM -0400, Gavin Hu wrote:
> 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'
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> ---

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

/Bruce

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib
  2018-05-15  8:28 ` [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
  2018-05-15  9:00   ` Bruce Richardson
@ 2018-05-15  9:07   ` Jerin Jacob
  1 sibling, 0 replies; 30+ messages in thread
From: Jerin Jacob @ 2018-05-15  9:07 UTC (permalink / raw)
  To: Gavin Hu; +Cc: dev

-----Original Message-----
> Date: Tue, 15 May 2018 04:28:41 -0400
> From: Gavin Hu <gavin.hu@arm.com>
> To: dev@dpdk.org
> 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'
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>



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

commit 55fbc92d7800100628579643c9ee2770614fef10
Author: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
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")
    
    Reported-by: Andrew Rybchenko <arybchenko@solarflare.com>
    Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
    Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>


> ---
>  mk/rte.app.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mk/rte.app.mk b/mk/rte.app.mk
> index 438f99d..bca8325 100644
> --- a/mk/rte.app.mk
> +++ b/mk/rte.app.mk
> @@ -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
> -- 
> 2.1.4
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/4] Driver/Mellanox: fix PMD compiling issue
  2018-05-15  8:28 ` [PATCH 2/4] Driver/Mellanox: fix PMD compiling issue Gavin Hu
@ 2018-05-15  9:11   ` Jerin Jacob
  0 siblings, 0 replies; 30+ messages in thread
From: Jerin Jacob @ 2018-05-15  9:11 UTC (permalink / raw)
  To: Gavin Hu; +Cc: dev, Sirshak Das

-----Original Message-----
> Date: Tue, 15 May 2018 04:28:42 -0400
> From: Gavin Hu <gavin.hu@arm.com>
> To: dev@dpdk.org
> CC: Sirshak Das <sirshak.das@arm.com>
> 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.

> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Signed-off-by: Sirshak Das <sirshak.das@arm.com>
> Reviewed-by: Phil Yang <Phil.Yang@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> ---
>  drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
> index 2673d6b..71a5eaf 100644
> --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
> +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
> @@ -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
> -- 
> 2.1.4
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib
  2018-05-15  8:28 [PATCH 0/4] *** fix native clang compiling errors on ARM64 *** Gavin Hu
                   ` (3 preceding siblings ...)
  2018-05-15  8:28 ` [PATCH 4/4] ifpgai_rawdev: " Gavin Hu
@ 2018-05-15  9:23 ` Gavin Hu
  2018-05-15  9:23   ` [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue Gavin Hu
                     ` (3 more replies)
  2018-05-16  6:08 ` [PATCH v3 1/3] net/mlx5: fix the clang compiling issue Gavin Hu
  2018-05-17  2:46 ` [PATCH v4 1/3] net/mlx5: " Gavin Hu
  6 siblings, 4 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-15  9:23 UTC (permalink / raw)
  To: dev

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'

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 mk/rte.app.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 438f99d..bca8325 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -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
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue
  2018-05-15  9:23 ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
@ 2018-05-15  9:23   ` Gavin Hu
  2018-05-15 17:05     ` Yongseok Koh
  2018-05-15  9:23   ` [PATCH v2 3/4] cryptodev: fix the clang " Gavin Hu
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 30+ messages in thread
From: Gavin Hu @ 2018-05-15  9:23 UTC (permalink / raw)
  To: dev; +Cc: Sirshak Das

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Sirshak Das <sirshak.das@arm.com>
Reviewed-by: Phil Yang <Phil.Yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index 2673d6b..71a5eaf 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -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
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v2 3/4] cryptodev: fix the clang compiling issue
  2018-05-15  9:23 ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
  2018-05-15  9:23   ` [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue Gavin Hu
@ 2018-05-15  9:23   ` Gavin Hu
  2018-05-15 11:41     ` Jerin Jacob
  2018-05-15  9:23   ` [PATCH v2 4/4] ifpgai_rawdev: " Gavin Hu
  2018-05-15 11:38   ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Jerin Jacob
  3 siblings, 1 reply; 30+ messages in thread
From: Gavin Hu @ 2018-05-15  9:23 UTC (permalink / raw)
  To: dev

~/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));

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c
index 831f842..0f34fe0 100644
--- a/lib/librte_eventdev/rte_event_crypto_adapter.c
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
@@ -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)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v2 4/4] ifpgai_rawdev: fix the clang compiling issue
  2018-05-15  9:23 ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
  2018-05-15  9:23   ` [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue Gavin Hu
  2018-05-15  9:23   ` [PATCH v2 3/4] cryptodev: fix the clang " Gavin Hu
@ 2018-05-15  9:23   ` Gavin Hu
  2018-05-16  5:13     ` Jerin Jacob
  2018-05-15 11:38   ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Jerin Jacob
  3 siblings, 1 reply; 30+ messages in thread
From: Gavin Hu @ 2018-05-15  9:23 UTC (permalink / raw)
  To: dev

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.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
index 0b9622d..aa02527 100644
--- a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
+++ b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
@@ -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_ */
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib
  2018-05-15  9:00   ` Bruce Richardson
@ 2018-05-15 10:10     ` Gavin Hu
  0 siblings, 0 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-15 10:10 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

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 <bruce.richardson@intel.com>
Sent: Tuesday, May 15, 2018 5:00 PM
To: Gavin Hu <Gavin.Hu@arm.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib

On Tue, May 15, 2018 at 04:28:41AM -0400, Gavin Hu wrote:
> 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'
>
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> ---

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.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib
  2018-05-15  9:23 ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
                     ` (2 preceding siblings ...)
  2018-05-15  9:23   ` [PATCH v2 4/4] ifpgai_rawdev: " Gavin Hu
@ 2018-05-15 11:38   ` Jerin Jacob
  3 siblings, 0 replies; 30+ messages in thread
From: Jerin Jacob @ 2018-05-15 11:38 UTC (permalink / raw)
  To: Gavin Hu; +Cc: dev

-----Original Message-----
> Date: Tue, 15 May 2018 05:23:44 -0400
> From: Gavin Hu <gavin.hu@arm.com>
> To: dev@dpdk.org
> 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'
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>


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

> ---
>  mk/rte.app.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mk/rte.app.mk b/mk/rte.app.mk
> index 438f99d..bca8325 100644
> --- a/mk/rte.app.mk
> +++ b/mk/rte.app.mk
> @@ -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
> -- 
> 2.1.4
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 3/4] cryptodev: fix the clang compiling issue
  2018-05-15  9:23   ` [PATCH v2 3/4] cryptodev: fix the clang " Gavin Hu
@ 2018-05-15 11:41     ` Jerin Jacob
  2018-05-15 13:34       ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 30+ messages in thread
From: Jerin Jacob @ 2018-05-15 11:41 UTC (permalink / raw)
  To: Gavin Hu; +Cc: dev

-----Original Message-----
> Date: Tue, 15 May 2018 05:23:46 -0400
> From: Gavin Hu <gavin.hu@arm.com>
> To: dev@dpdk.org
> 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));
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> ---
>  lib/librte_eventdev/rte_event_crypto_adapter.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c
> index 831f842..0f34fe0 100644
> --- a/lib/librte_eventdev/rte_event_crypto_adapter.c
> +++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
> @@ -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));

>  		ev->event_ptr = ops[i];
>  		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
>  		if (adapter->implicit_release_disabled)
> -- 
> 2.1.4
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 3/4] cryptodev: fix the clang compiling issue
  2018-05-15 11:41     ` Jerin Jacob
@ 2018-05-15 13:34       ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 30+ messages in thread
From: De Lara Guarch, Pablo @ 2018-05-15 13:34 UTC (permalink / raw)
  To: Jerin Jacob, Gavin Hu; +Cc: dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jerin Jacob
> Sent: Tuesday, May 15, 2018 12:42 PM
> To: Gavin Hu <gavin.hu@arm.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 3/4] cryptodev: fix the clang compiling issue
> 
> -----Original Message-----
> > Date: Tue, 15 May 2018 05:23:46 -0400
> > From: Gavin Hu <gavin.hu@arm.com>
> > To: dev@dpdk.org
> > 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".

> >
> > ~/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));
> >
> > Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> > Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > ---
> >  lib/librte_eventdev/rte_event_crypto_adapter.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c
> > b/lib/librte_eventdev/rte_event_crypto_adapter.c
> > index 831f842..0f34fe0 100644
> > --- a/lib/librte_eventdev/rte_event_crypto_adapter.c
> > +++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
> > @@ -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));
> 
> >  		ev->event_ptr = ops[i];
> >  		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
> >  		if (adapter->implicit_release_disabled)
> > --
> > 2.1.4
> >

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue
  2018-05-15  9:23   ` [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue Gavin Hu
@ 2018-05-15 17:05     ` Yongseok Koh
  2018-05-15 17:52       ` Sirshak Das
  0 siblings, 1 reply; 30+ messages in thread
From: Yongseok Koh @ 2018-05-15 17:05 UTC (permalink / raw)
  To: Gavin Hu
  Cc: dev, Sirshak Das, Nélio Laranjeiro, Adrien Mazarguil, Shahaf Shuler


> On May 15, 2018, at 2:23 AM, Gavin Hu <gavin.hu@arm.com> wrote:

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

> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Signed-off-by: Sirshak Das <sirshak.das@arm.com>
> Reviewed-by: Phil Yang <Phil.Yang@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> ---
> drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
> index 2673d6b..71a5eaf 100644
> --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
> +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
> @@ -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
> -- 
> 2.1.4
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue
  2018-05-15 17:05     ` Yongseok Koh
@ 2018-05-15 17:52       ` Sirshak Das
  2018-05-15 18:38         ` Yongseok Koh
  0 siblings, 1 reply; 30+ messages in thread
From: Sirshak Das @ 2018-05-15 17:52 UTC (permalink / raw)
  To: Yongseok Koh
  Cc: Gavin Hu, dev, Sirshak Das, Nélio Laranjeiro,
	Adrien Mazarguil, Shahaf Shuler

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.

Yongseok Koh writes:

>> On May 15, 2018, at 2:23 AM, Gavin Hu <gavin.hu@arm.com> wrote:
>
> 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
>
>> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
>> Signed-off-by: Sirshak Das <sirshak.das@arm.com>
>> Reviewed-by: Phil Yang <Phil.Yang@arm.com>
>> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
>> ---
>> drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>> 
>> diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
>> index 2673d6b..71a5eaf 100644
>> --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
>> +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
>> @@ -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
>> -- 
>> 2.1.4
>> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue
  2018-05-15 17:52       ` Sirshak Das
@ 2018-05-15 18:38         ` Yongseok Koh
  0 siblings, 0 replies; 30+ messages in thread
From: Yongseok Koh @ 2018-05-15 18:38 UTC (permalink / raw)
  To: Sirshak Das
  Cc: Gavin Hu, dev, Nélio Laranjeiro, Adrien Mazarguil, Shahaf Shuler


> On May 15, 2018, at 10:52 AM, Sirshak Das <sirshak.das@arm.com> wrote:
> 
> 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.

Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thank you for contribution!
Yongseok

> Yongseok Koh writes:
> 
>>> On May 15, 2018, at 2:23 AM, Gavin Hu <gavin.hu@arm.com> wrote:
>> 
>> 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
>> 
>>> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
>>> Signed-off-by: Sirshak Das <sirshak.das@arm.com>
>>> Reviewed-by: Phil Yang <Phil.Yang@arm.com>
>>> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
>>> ---
>>> drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
>>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>> 
>>> diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
>>> index 2673d6b..71a5eaf 100644
>>> --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
>>> +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
>>> @@ -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
>>> -- 
>>> 2.1.4
>>> 
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 4/4] ifpgai_rawdev: fix the clang compiling issue
  2018-05-15  9:23   ` [PATCH v2 4/4] ifpgai_rawdev: " Gavin Hu
@ 2018-05-16  5:13     ` Jerin Jacob
  0 siblings, 0 replies; 30+ messages in thread
From: Jerin Jacob @ 2018-05-16  5:13 UTC (permalink / raw)
  To: Gavin Hu; +Cc: dev

-----Original Message-----
> Date: Tue, 15 May 2018 05:23:47 -0400
> From: Gavin Hu <gavin.hu@arm.com>
> To: dev@dpdk.org
> 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.
> 
> The fix is to change the #pragma pack alignment locally and not have
> effect on other files who included this header file.
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>

Perhaps this fixes compilation issues clang6 + x86 too.

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

With above change:
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>



> ---
>  drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> index 0b9622d..aa02527 100644
> --- a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> +++ b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> @@ -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_ */
> -- 
> 2.1.4
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v3 1/3] net/mlx5: fix the clang compiling issue
  2018-05-15  8:28 [PATCH 0/4] *** fix native clang compiling errors on ARM64 *** Gavin Hu
                   ` (4 preceding siblings ...)
  2018-05-15  9:23 ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
@ 2018-05-16  6:08 ` Gavin Hu
  2018-05-16  6:08   ` [PATCH v3 2/3] eventdev: " Gavin Hu
  2018-05-16  6:08   ` [PATCH v3 3/3] raw/ifpga_rawdev: " Gavin Hu
  2018-05-17  2:46 ` [PATCH v4 1/3] net/mlx5: " Gavin Hu
  6 siblings, 2 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-16  6:08 UTC (permalink / raw)
  To: dev; +Cc: gavin hu, stable, Sirshak Das

From: gavin hu <gavin.hu@arm.com>

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")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Sirshak Das <sirshak.das@arm.com>
Reviewed-by: Phil Yang <Phil.Yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index 2673d6b8c..71a5eaf23 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -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
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 2/3] eventdev: fix the clang compiling issue
  2018-05-16  6:08 ` [PATCH v3 1/3] net/mlx5: fix the clang compiling issue Gavin Hu
@ 2018-05-16  6:08   ` Gavin Hu
  2018-05-16  6:08   ` [PATCH v3 3/3] raw/ifpga_rawdev: " Gavin Hu
  1 sibling, 0 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-16  6:08 UTC (permalink / raw)
  To: dev; +Cc: gavin hu

From: gavin hu <gavin.hu@arm.com>

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")

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c
index 831f84248..ba63a87b7 100644
--- a/lib/librte_eventdev/rte_event_crypto_adapter.c
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
@@ -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)
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue
  2018-05-16  6:08 ` [PATCH v3 1/3] net/mlx5: fix the clang compiling issue Gavin Hu
  2018-05-16  6:08   ` [PATCH v3 2/3] eventdev: " Gavin Hu
@ 2018-05-16  6:08   ` Gavin Hu
  2018-05-16  6:45     ` Jerin Jacob
  1 sibling, 1 reply; 30+ messages in thread
From: Gavin Hu @ 2018-05-16  6:08 UTC (permalink / raw)
  To: dev; +Cc: gavin hu

From: gavin hu <gavin.hu@arm.com>

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")

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
index 0b9622d5f..aa0252720 100644
--- a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
+++ b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
@@ -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_ */
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue
  2018-05-16  6:08   ` [PATCH v3 3/3] raw/ifpga_rawdev: " Gavin Hu
@ 2018-05-16  6:45     ` Jerin Jacob
  2018-05-17  1:47       ` Gavin Hu
  0 siblings, 1 reply; 30+ messages in thread
From: Jerin Jacob @ 2018-05-16  6:45 UTC (permalink / raw)
  To: Gavin Hu; +Cc: dev

-----Original Message-----
> Date: Wed, 16 May 2018 14:08:02 +0800
> From: Gavin Hu <gavin.hu@arm.com>
> To: dev@dpdk.org
> CC: gavin hu <gavin.hu@arm.com>
> 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 <gavin.hu@arm.com>
> 
> 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.

> 
> 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")
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

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

> ---
>  drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> index 0b9622d5f..aa0252720 100644
> --- a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> +++ b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> @@ -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_ */
> -- 
> 2.17.0
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue
  2018-05-16  6:45     ` Jerin Jacob
@ 2018-05-17  1:47       ` Gavin Hu
  2018-05-20 22:28         ` Thomas Monjalon
  0 siblings, 1 reply; 30+ messages in thread
From: Gavin Hu @ 2018-05-17  1:47 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev

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 <jerin.jacob@caviumnetworks.com>
Sent: Wednesday, May 16, 2018 2:46 PM
To: Gavin Hu <Gavin.Hu@arm.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue

-----Original Message-----
> Date: Wed, 16 May 2018 14:08:02 +0800
> From: Gavin Hu <gavin.hu@arm.com>
> To: dev@dpdk.org
> CC: gavin hu <gavin.hu@arm.com>
> 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 <gavin.hu@arm.com>
>
> 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.

>
> 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")
>
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

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

> ---
>  drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> index 0b9622d5f..aa0252720 100644
> --- a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> +++ b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
> @@ -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_ */
> --
> 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.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v4 1/3] net/mlx5: fix the clang compiling issue
  2018-05-15  8:28 [PATCH 0/4] *** fix native clang compiling errors on ARM64 *** Gavin Hu
                   ` (5 preceding siblings ...)
  2018-05-16  6:08 ` [PATCH v3 1/3] net/mlx5: fix the clang compiling issue Gavin Hu
@ 2018-05-17  2:46 ` Gavin Hu
  2018-05-17  2:46   ` [PATCH v4 2/3] eventdev: " Gavin Hu
                     ` (2 more replies)
  6 siblings, 3 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-17  2:46 UTC (permalink / raw)
  To: dev; +Cc: jerin.jacob, gavin hu, stable, Sirshak Das

From: gavin hu <gavin.hu@arm.com>

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")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Sirshak Das <sirshak.das@arm.com>
Reviewed-by: Phil Yang <Phil.Yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index 2673d6b8c..71a5eaf23 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -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
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v4 2/3] eventdev: fix the clang compiling issue
  2018-05-17  2:46 ` [PATCH v4 1/3] net/mlx5: " Gavin Hu
@ 2018-05-17  2:46   ` Gavin Hu
  2018-05-17  2:46   ` [PATCH v4 3/3] raw/ifpga: " Gavin Hu
  2018-05-20 23:02   ` [PATCH v4 1/3] net/mlx5: " Thomas Monjalon
  2 siblings, 0 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-17  2:46 UTC (permalink / raw)
  To: dev; +Cc: jerin.jacob, gavin hu

From: gavin hu <gavin.hu@arm.com>

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")

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c
index 831f84248..ba63a87b7 100644
--- a/lib/librte_eventdev/rte_event_crypto_adapter.c
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
@@ -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)
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v4 3/3] raw/ifpga: fix the clang compiling issue
  2018-05-17  2:46 ` [PATCH v4 1/3] net/mlx5: " Gavin Hu
  2018-05-17  2:46   ` [PATCH v4 2/3] eventdev: " Gavin Hu
@ 2018-05-17  2:46   ` Gavin Hu
  2018-05-20 23:02   ` [PATCH v4 1/3] net/mlx5: " Thomas Monjalon
  2 siblings, 0 replies; 30+ messages in thread
From: Gavin Hu @ 2018-05-17  2:46 UTC (permalink / raw)
  To: dev; +Cc: jerin.jacob, gavin hu

From: gavin hu <gavin.hu@arm.com>

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")

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 drivers/raw/ifpga_rawdev/base/ifpga_defines.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
index 0b9622d5f..aa0252720 100644
--- a/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
+++ b/drivers/raw/ifpga_rawdev/base/ifpga_defines.h
@@ -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_ */
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 3/3] raw/ifpga_rawdev: fix the clang compiling issue
  2018-05-17  1:47       ` Gavin Hu
@ 2018-05-20 22:28         ` Thomas Monjalon
  0 siblings, 0 replies; 30+ messages in thread
From: Thomas Monjalon @ 2018-05-20 22:28 UTC (permalink / raw)
  To: Gavin Hu; +Cc: dev, Jerin Jacob

17/05/2018 03:47, Gavin Hu:
> 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.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v4 1/3] net/mlx5: fix the clang compiling issue
  2018-05-17  2:46 ` [PATCH v4 1/3] net/mlx5: " Gavin Hu
  2018-05-17  2:46   ` [PATCH v4 2/3] eventdev: " Gavin Hu
  2018-05-17  2:46   ` [PATCH v4 3/3] raw/ifpga: " Gavin Hu
@ 2018-05-20 23:02   ` Thomas Monjalon
  2 siblings, 0 replies; 30+ messages in thread
From: Thomas Monjalon @ 2018-05-20 23:02 UTC (permalink / raw)
  To: Gavin Hu; +Cc: dev, jerin.jacob, stable, Sirshak Das

17/05/2018 04:46, Gavin Hu:
> From: gavin hu <gavin.hu@arm.com>
> 
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Signed-off-by: Sirshak Das <sirshak.das@arm.com>
> Reviewed-by: Phil Yang <Phil.Yang@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Acked-by: Yongseok Koh <yskoh@mellanox.com>

Series applied, thanks

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2018-05-20 23:02 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15  8:28 [PATCH 0/4] *** fix native clang compiling errors on ARM64 *** Gavin Hu
2018-05-15  8:28 ` [PATCH 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
2018-05-15  9:00   ` Bruce Richardson
2018-05-15 10:10     ` Gavin Hu
2018-05-15  9:07   ` Jerin Jacob
2018-05-15  8:28 ` [PATCH 2/4] Driver/Mellanox: fix PMD compiling issue Gavin Hu
2018-05-15  9:11   ` Jerin Jacob
2018-05-15  8:28 ` [PATCH 3/4] cryptodev: fix the clang " Gavin Hu
2018-05-15  8:28 ` [PATCH 4/4] ifpgai_rawdev: " Gavin Hu
2018-05-15  9:23 ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Gavin Hu
2018-05-15  9:23   ` [PATCH v2 2/4] Driver/Mellanox: fix PMD compiling issue Gavin Hu
2018-05-15 17:05     ` Yongseok Koh
2018-05-15 17:52       ` Sirshak Das
2018-05-15 18:38         ` Yongseok Koh
2018-05-15  9:23   ` [PATCH v2 3/4] cryptodev: fix the clang " Gavin Hu
2018-05-15 11:41     ` Jerin Jacob
2018-05-15 13:34       ` De Lara Guarch, Pablo
2018-05-15  9:23   ` [PATCH v2 4/4] ifpgai_rawdev: " Gavin Hu
2018-05-16  5:13     ` Jerin Jacob
2018-05-15 11:38   ` [PATCH v2 1/4] app: add LDFLAGS -latomic to link atomic lib Jerin Jacob
2018-05-16  6:08 ` [PATCH v3 1/3] net/mlx5: fix the clang compiling issue Gavin Hu
2018-05-16  6:08   ` [PATCH v3 2/3] eventdev: " Gavin Hu
2018-05-16  6:08   ` [PATCH v3 3/3] raw/ifpga_rawdev: " Gavin Hu
2018-05-16  6:45     ` Jerin Jacob
2018-05-17  1:47       ` Gavin Hu
2018-05-20 22:28         ` Thomas Monjalon
2018-05-17  2:46 ` [PATCH v4 1/3] net/mlx5: " Gavin Hu
2018-05-17  2:46   ` [PATCH v4 2/3] eventdev: " Gavin Hu
2018-05-17  2:46   ` [PATCH v4 3/3] raw/ifpga: " Gavin Hu
2018-05-20 23:02   ` [PATCH v4 1/3] net/mlx5: " Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.