DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] event/octeontx: fix clang 6 linker error
@ 2018-05-08 21:26 Pavan Nikhilesh
  2018-05-09  1:53 ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Pavan Nikhilesh @ 2018-05-08 21:26 UTC (permalink / raw)
  To: jerin.jacob, santosh.shukla, arybchenko; +Cc: dev, Pavan Nikhilesh

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

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 drivers/event/octeontx/timvf_evdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h
index b1b2a8464..1cac1e612 100644
--- a/drivers/event/octeontx/timvf_evdev.h
+++ b/drivers/event/octeontx/timvf_evdev.h
@@ -145,7 +145,7 @@ struct tim_mem_bucket {
 	};
 	uint64_t current_chunk;
 	uint64_t pad;
-} __rte_packed;
+} __rte_packed __rte_aligned(8);

 struct tim_mem_entry {
 	uint64_t w0;
--
2.17.0

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

* Re: [dpdk-dev] [PATCH] event/octeontx: fix clang 6 linker error
  2018-05-08 21:26 [dpdk-dev] [PATCH] event/octeontx: fix clang 6 linker error Pavan Nikhilesh
@ 2018-05-09  1:53 ` Jerin Jacob
  2018-05-09  9:09   ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Jerin Jacob @ 2018-05-09  1:53 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: santosh.shukla, arybchenko, dev

-----Original Message-----
> Date: Wed,  9 May 2018 02:56:00 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com,
>  arybchenko@solarflare.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] event/octeontx: fix clang 6 linker error
> X-Mailer: git-send-email 2.17.0
> 
> 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>


> ---
>  drivers/event/octeontx/timvf_evdev.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h
> index b1b2a8464..1cac1e612 100644
> --- a/drivers/event/octeontx/timvf_evdev.h
> +++ b/drivers/event/octeontx/timvf_evdev.h
> @@ -145,7 +145,7 @@ struct tim_mem_bucket {
>  	};
>  	uint64_t current_chunk;
>  	uint64_t pad;
> -} __rte_packed;
> +} __rte_packed __rte_aligned(8);
> 
>  struct tim_mem_entry {
>  	uint64_t w0;
> --
> 2.17.0
> 

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

* Re: [dpdk-dev] [PATCH] event/octeontx: fix clang 6 linker error
  2018-05-09  1:53 ` Jerin Jacob
@ 2018-05-09  9:09   ` Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2018-05-09  9:09 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: santosh.shukla, arybchenko, dev

-----Original Message-----
> Date: Wed, 9 May 2018 07:23:08 +0530
> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> CC: santosh.shukla@caviumnetworks.com, arybchenko@solarflare.com,
>  dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] event/octeontx: fix clang 6 linker error
> User-Agent: Mutt/1.9.5 (2018-04-13)
> 
> -----Original Message-----
> > Date: Wed,  9 May 2018 02:56:00 +0530
> > From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com,
> >  arybchenko@solarflare.com
> > Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH] event/octeontx: fix clang 6 linker error
> > X-Mailer: git-send-email 2.17.0
> > 
> > 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>

Applied to dpdk-next-eventdev/master. Thanks.

> 
> 
> > ---
> >  drivers/event/octeontx/timvf_evdev.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h
> > index b1b2a8464..1cac1e612 100644
> > --- a/drivers/event/octeontx/timvf_evdev.h
> > +++ b/drivers/event/octeontx/timvf_evdev.h
> > @@ -145,7 +145,7 @@ struct tim_mem_bucket {
> >  	};
> >  	uint64_t current_chunk;
> >  	uint64_t pad;
> > -} __rte_packed;
> > +} __rte_packed __rte_aligned(8);
> > 
> >  struct tim_mem_entry {
> >  	uint64_t w0;
> > --
> > 2.17.0
> > 

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

end of thread, other threads:[~2018-05-09  9:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-08 21:26 [dpdk-dev] [PATCH] event/octeontx: fix clang 6 linker error Pavan Nikhilesh
2018-05-09  1:53 ` Jerin Jacob
2018-05-09  9:09   ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).