[v2,3/3] mbuf: use structure marker typedef in eal

Message ID 20191219112507.3142025-3-jerinj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/3] eal: introduce structure marker typedefs |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot warning Travis build: failed
ci/Intel-compilation success Compilation OK

Commit Message

Jerin Jacob Kollanukkaran Dec. 19, 2019, 11:25 a.m. UTC
  From: Jerin Jacob <jerinj@marvell.com>

Use new marker typedef available in EAL and remove private marker
typedef.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/librte_mbuf/rte_mbuf_core.h | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)
  

Comments

Olivier Matz Dec. 26, 2019, 4:24 p.m. UTC | #1
On Thu, Dec 19, 2019 at 04:55:07PM +0530, jerinj@marvell.com wrote:
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Use new marker typedef available in EAL and remove private marker
> typedef.
> 
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

Thanks
  
Thomas Monjalon Jan. 20, 2020, 9:55 p.m. UTC | #2
26/12/2019 17:24, Olivier Matz:
> On Thu, Dec 19, 2019 at 04:55:07PM +0530, jerinj@marvell.com wrote:
> > From: Jerin Jacob <jerinj@marvell.com>
> > 
> > Use new marker typedef available in EAL and remove private marker
> > typedef.
> > 
> > Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Series applied, thanks

Note: I reverted the use of RTE_STD_C11 to __extension__ (as in your v1)
which seems more correct (and allow pedantic mlx PMDs to build).
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h
index 9a8557d1c..b9a59c879 100644
--- a/lib/librte_mbuf/rte_mbuf_core.h
+++ b/lib/librte_mbuf/rte_mbuf_core.h
@@ -406,19 +406,6 @@  extern "C" {
 #define	RTE_MBUF_DEFAULT_BUF_SIZE	\
 	(RTE_MBUF_DEFAULT_DATAROOM + RTE_PKTMBUF_HEADROOM)
 
-/*
- * define a set of marker types that can be used to refer to set points in the
- * mbuf.
- */
-__extension__
-typedef void    *MARKER[0];   /**< generic marker for a point in a structure */
-__extension__
-typedef uint8_t  MARKER8[0];  /**< generic marker with 1B alignment */
-
- /** marker that allows us to overwrite 8 bytes with a single assignment */
-__extension__
-typedef uint64_t MARKER64[0];
-
 struct rte_mbuf_sched {
 	uint32_t queue_id;   /**< Queue ID. */
 	uint8_t traffic_class;
@@ -478,7 +465,7 @@  enum {
  * The generic rte_mbuf, containing a packet mbuf.
  */
 struct rte_mbuf {
-	MARKER cacheline0;
+	RTE_MARKER cacheline0;
 
 	void *buf_addr;           /**< Virtual address of segment buffer. */
 	/**
@@ -494,7 +481,7 @@  struct rte_mbuf {
 	} __rte_aligned(sizeof(rte_iova_t));
 
 	/* next 8 bytes are initialised on RX descriptor rearm */
-	MARKER64 rearm_data;
+	RTE_MARKER64 rearm_data;
 	uint16_t data_off;
 
 	/**
@@ -522,7 +509,7 @@  struct rte_mbuf {
 	uint64_t ol_flags;        /**< Offload features. */
 
 	/* remaining bytes are set on RX when pulling packet from descriptor */
-	MARKER rx_descriptor_fields1;
+	RTE_MARKER rx_descriptor_fields1;
 
 	/*
 	 * The packet type, which is the combination of outer/inner L2, L3, L4
@@ -610,7 +597,7 @@  struct rte_mbuf {
 	uint64_t timestamp;
 
 	/* second cache line - fields only used in slow path or on TX */
-	MARKER cacheline1 __rte_cache_min_aligned;
+	RTE_MARKER cacheline1 __rte_cache_min_aligned;
 
 	RTE_STD_C11
 	union {