DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ring: fix build with icc
@ 2017-04-05 15:03 Ferruh Yigit
  2017-04-05 15:29 ` Thomas Monjalon
  2017-04-05 16:13 ` Bruce Richardson
  0 siblings, 2 replies; 5+ messages in thread
From: Ferruh Yigit @ 2017-04-05 15:03 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Thomas Monjalon, dev, Ferruh Yigit

build error:
In file included from .../lib/librte_ring/rte_ring.c(90):
.../lib/librte_ring/rte_ring.h(162):
error #1366: a reduction in alignment without the "packed" attribute
is ignored
  } __rte_cache_aligned;
      ^

Alignment attribute moved to first element of the struct

Fixes: a6619414e0a9 ("ring: make struct and macros type agnostic")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_ring/rte_ring.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index 6642e18..28b7b2a 100644
--- a/lib/librte_ring/rte_ring.h
+++ b/lib/librte_ring/rte_ring.h
@@ -147,7 +147,7 @@ struct rte_ring {
 	 * compatibility requirements, it could be changed to RTE_RING_NAMESIZE
 	 * next time the ABI changes
 	 */
-	char name[RTE_MEMZONE_NAMESIZE];    /**< Name of the ring. */
+	char name[RTE_MEMZONE_NAMESIZE] __rte_cache_aligned; /**< Name of the ring. */
 	int flags;               /**< Flags supplied at creation. */
 	const struct rte_memzone *memzone;
 			/**< Memzone, if any, containing the rte_ring */
@@ -159,7 +159,7 @@ struct rte_ring {
 
 	/** Ring consumer status. */
 	struct rte_ring_headtail cons __rte_aligned(CONS_ALIGN);
-} __rte_cache_aligned;
+};
 
 #define RING_F_SP_ENQ 0x0001 /**< The default enqueue is "single-producer". */
 #define RING_F_SC_DEQ 0x0002 /**< The default dequeue is "single-consumer". */
-- 
2.9.3

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

* Re: [dpdk-dev] [PATCH] ring: fix build with icc
  2017-04-05 15:03 [dpdk-dev] [PATCH] ring: fix build with icc Ferruh Yigit
@ 2017-04-05 15:29 ` Thomas Monjalon
  2017-04-05 15:56   ` Bruce Richardson
  2017-04-05 16:13 ` Bruce Richardson
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2017-04-05 15:29 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Bruce Richardson, dev

2017-04-05 16:03, Ferruh Yigit:
> build error:
> In file included from .../lib/librte_ring/rte_ring.c(90):
> .../lib/librte_ring/rte_ring.h(162):
> error #1366: a reduction in alignment without the "packed" attribute
> is ignored
>   } __rte_cache_aligned;
>       ^
> 
> Alignment attribute moved to first element of the struct

The fix is surprising.
Is it really doing the same thing as
	} __rte_cache_aligned;
at the end of the struct?

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

* Re: [dpdk-dev] [PATCH] ring: fix build with icc
  2017-04-05 15:29 ` Thomas Monjalon
@ 2017-04-05 15:56   ` Bruce Richardson
  0 siblings, 0 replies; 5+ messages in thread
From: Bruce Richardson @ 2017-04-05 15:56 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Ferruh Yigit, dev

On Wed, Apr 05, 2017 at 05:29:48PM +0200, Thomas Monjalon wrote:
> 2017-04-05 16:03, Ferruh Yigit:
> > build error:
> > In file included from .../lib/librte_ring/rte_ring.c(90):
> > .../lib/librte_ring/rte_ring.h(162):
> > error #1366: a reduction in alignment without the "packed" attribute
> > is ignored
> >   } __rte_cache_aligned;
> >       ^
> > 
> > Alignment attribute moved to first element of the struct
> 
> The fix is surprising.
> Is it really doing the same thing as
> 	} __rte_cache_aligned;
> at the end of the struct?
> 
It should be. Aligning the whole structure to start on a cache-line
boundary should be exactly the same as telling the compiler to put
the first field of the structure on a cacheline boundary.

/Bruce

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

* Re: [dpdk-dev] [PATCH] ring: fix build with icc
  2017-04-05 15:03 [dpdk-dev] [PATCH] ring: fix build with icc Ferruh Yigit
  2017-04-05 15:29 ` Thomas Monjalon
@ 2017-04-05 16:13 ` Bruce Richardson
  2017-04-05 16:15   ` Thomas Monjalon
  1 sibling, 1 reply; 5+ messages in thread
From: Bruce Richardson @ 2017-04-05 16:13 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Thomas Monjalon, dev

On Wed, Apr 05, 2017 at 04:03:12PM +0100, Ferruh Yigit wrote:
> build error:
> In file included from .../lib/librte_ring/rte_ring.c(90):
> .../lib/librte_ring/rte_ring.h(162):
> error #1366: a reduction in alignment without the "packed" attribute
> is ignored
>   } __rte_cache_aligned;
>       ^
> 
> Alignment attribute moved to first element of the struct
> 
> Fixes: a6619414e0a9 ("ring: make struct and macros type agnostic")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
Patch looks ok to me

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [PATCH] ring: fix build with icc
  2017-04-05 16:13 ` Bruce Richardson
@ 2017-04-05 16:15   ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2017-04-05 16:15 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Bruce Richardson, dev

2017-04-05 17:13, Bruce Richardson:
> On Wed, Apr 05, 2017 at 04:03:12PM +0100, Ferruh Yigit wrote:
> > build error:
> > In file included from .../lib/librte_ring/rte_ring.c(90):
> > .../lib/librte_ring/rte_ring.h(162):
> > error #1366: a reduction in alignment without the "packed" attribute
> > is ignored
> >   } __rte_cache_aligned;
> >       ^
> > 
> > Alignment attribute moved to first element of the struct
> > 
> > Fixes: a6619414e0a9 ("ring: make struct and macros type agnostic")
> > 
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
> Patch looks ok to me
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks

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

end of thread, other threads:[~2017-04-05 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 15:03 [dpdk-dev] [PATCH] ring: fix build with icc Ferruh Yigit
2017-04-05 15:29 ` Thomas Monjalon
2017-04-05 15:56   ` Bruce Richardson
2017-04-05 16:13 ` Bruce Richardson
2017-04-05 16:15   ` Thomas Monjalon

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