DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH 1/3] eal: introduce structure marker typedefs
@ 2019-12-08 11:34 jerinj
  2019-12-08 11:34 ` [dpdk-dev] [PATCH 2/3] drivers: use structure marker typedef in eal jerinj
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: jerinj @ 2019-12-08 11:34 UTC (permalink / raw)
  To: dev; +Cc: thomas, david.marchand, Jerin Jacob

From: Jerin Jacob <jerinj@marvell.com>

Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking and
a generic marker for a point in a structure.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/librte_eal/common/include/rte_common.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 459d082d1..9556299ba 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -335,6 +335,18 @@ typedef uint64_t phys_addr_t;
 typedef uint64_t rte_iova_t;
 #define RTE_BAD_IOVA ((rte_iova_t)-1)
 
+/*********** Structure alignment markers ********/
+
+/** Generic marker for a point in a structure. */
+__extension__ typedef void    *RTE_MARKER[0];
+/** Marker for 1B alignment in a structure. */
+__extension__ typedef uint8_t  RTE_MARKER8[0];
+/** Marker for 2B alignment in a structure. */
+__extension__ typedef uint16_t RTE_MARKER16[0];
+/** Marker for 4B alignment in a structure. */
+__extension__ typedef uint16_t RTE_MARKER32[0];
+/** Marker for 8B alignment in a structure. */
+__extension__ typedef uint64_t RTE_MARKER64[0];
 
 /**
  * Combines 32b inputs most significant set bits into the least
-- 
2.24.0


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

* [dpdk-dev] [PATCH 2/3] drivers: use structure marker typedef in eal
  2019-12-08 11:34 [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs jerinj
@ 2019-12-08 11:34 ` jerinj
  2019-12-08 11:34 ` [dpdk-dev] [PATCH 3/3] mbuf: " jerinj
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: jerinj @ 2019-12-08 11:34 UTC (permalink / raw)
  To: dev, Shepard Siegel, Ed Czeck, John Miller, Jerin Jacob,
	Nithin Dabilpuram, Kiran Kumar K, Maciej Czekaj
  Cc: thomas, david.marchand

From: Jerin Jacob <jerinj@marvell.com>

Use new marker typedef available in EAL.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/ark/ark_ethdev_rx.c     | 2 +-
 drivers/net/ark/ark_ethdev_tx.c     | 2 +-
 drivers/net/octeontx2/otx2_ethdev.h | 6 +++---
 drivers/net/thunderx/nicvf_struct.h | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 6156730bb..4d518d558 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -57,7 +57,7 @@ struct ark_rx_queue {
 
 	/* separate cache line */
 	/* second cache line - fields only used in slow path */
-	MARKER cacheline1 __rte_cache_min_aligned;
+	RTE_MARKER cacheline1 __rte_cache_min_aligned;
 
 	volatile uint32_t prod_index;	/* step 2 filled by FPGA */
 } __rte_cache_aligned;
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 08bcf431a..289668774 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -42,7 +42,7 @@ struct ark_tx_queue {
 	uint32_t pad[1];
 
 	/* second cache line - fields only used in slow path */
-	MARKER cacheline1 __rte_cache_min_aligned;
+	RTE_MARKER cacheline1 __rte_cache_min_aligned;
 	uint32_t cons_index;		/* hw is done, can be freed */
 } __rte_cache_aligned;
 
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 987e7607c..a6e8483a0 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -254,7 +254,7 @@ struct otx2_vlan_info {
 
 struct otx2_eth_dev {
 	OTX2_DEV; /* Base class */
-	MARKER otx2_eth_dev_data_start;
+	RTE_MARKER otx2_eth_dev_data_start;
 	uint16_t sqb_size;
 	uint16_t rx_chan_base;
 	uint16_t tx_chan_base;
@@ -335,7 +335,7 @@ struct otx2_eth_txq {
 	rte_iova_t fc_iova;
 	uint16_t sqes_per_sqb_log2;
 	int16_t nb_sqb_bufs_adj;
-	MARKER slow_path_start;
+	RTE_MARKER slow_path_start;
 	uint16_t nb_sqb_bufs;
 	uint16_t sq;
 	uint64_t offloads;
@@ -357,7 +357,7 @@ struct otx2_eth_rxq {
 	uint32_t available;
 	uint16_t rq;
 	struct otx2_timesync_info *tstamp;
-	MARKER slow_path_start;
+	RTE_MARKER slow_path_start;
 	uint64_t aura;
 	uint64_t offloads;
 	uint32_t qlen;
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 5d1379803..cf1c281a0 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -55,7 +55,7 @@ union mbuf_initializer {
 };
 
 struct nicvf_rxq {
-	MARKER rxq_fastpath_data_start;
+	RTE_MARKER rxq_fastpath_data_start;
 	uint8_t  rbptr_offset;
 	uint16_t rx_free_thresh;
 	uint32_t head;
@@ -69,7 +69,7 @@ struct nicvf_rxq {
 	struct rte_mempool *pool;
 	union cq_entry_t *desc;
 	union mbuf_initializer mbuf_initializer;
-	MARKER rxq_fastpath_data_end;
+	RTE_MARKER rxq_fastpath_data_end;
 	uint8_t rx_drop_en;
 	uint16_t precharge_cnt;
 	uint16_t port_id;
-- 
2.24.0


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

* [dpdk-dev]  [PATCH 3/3] mbuf: use structure marker typedef in eal
  2019-12-08 11:34 [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs jerinj
  2019-12-08 11:34 ` [dpdk-dev] [PATCH 2/3] drivers: use structure marker typedef in eal jerinj
@ 2019-12-08 11:34 ` jerinj
  2019-12-10 22:46 ` [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs Thomas Monjalon
  2019-12-19 11:25 ` [dpdk-dev] [PATCH v2 " jerinj
  3 siblings, 0 replies; 16+ messages in thread
From: jerinj @ 2019-12-08 11:34 UTC (permalink / raw)
  To: dev, Olivier Matz; +Cc: thomas, david.marchand, Jerin Jacob

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

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 {
-- 
2.24.0


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

* Re: [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs
  2019-12-08 11:34 [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs jerinj
  2019-12-08 11:34 ` [dpdk-dev] [PATCH 2/3] drivers: use structure marker typedef in eal jerinj
  2019-12-08 11:34 ` [dpdk-dev] [PATCH 3/3] mbuf: " jerinj
@ 2019-12-10 22:46 ` Thomas Monjalon
  2019-12-19 10:34   ` Jerin Jacob
  2019-12-19 11:25 ` [dpdk-dev] [PATCH v2 " jerinj
  3 siblings, 1 reply; 16+ messages in thread
From: Thomas Monjalon @ 2019-12-10 22:46 UTC (permalink / raw)
  To: jerinj; +Cc: dev, david.marchand, Adrien Mazarguil

08/12/2019 12:34, jerinj@marvell.com:
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking and
> a generic marker for a point in a structure.
> 
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> ---
>  lib/librte_eal/common/include/rte_common.h | 12 ++++++++++++

Good idea, thanks.

> +/** Generic marker for a point in a structure. */

I think "a point" may be replaced with "any place" or something else?

> +__extension__ typedef void    *RTE_MARKER[0];

Why do we need an extension?
If it is part of C11, we should use RTE_STD_C11 instead.
If it is another reason, we could create another meaningful EAL macro.




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

* Re: [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs
  2019-12-10 22:46 ` [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs Thomas Monjalon
@ 2019-12-19 10:34   ` Jerin Jacob
  0 siblings, 0 replies; 16+ messages in thread
From: Jerin Jacob @ 2019-12-19 10:34 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Jerin Jacob, dpdk-dev, David Marchand, Adrien Mazarguil

On Wed, Dec 11, 2019 at 4:16 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 08/12/2019 12:34, jerinj@marvell.com:
> > From: Jerin Jacob <jerinj@marvell.com>
> >
> > Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking and
> > a generic marker for a point in a structure.
> >
> > Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> > ---
> >  lib/librte_eal/common/include/rte_common.h | 12 ++++++++++++
>
> Good idea, thanks.
>
> > +/** Generic marker for a point in a structure. */
>
> I think "a point" may be replaced with "any place" or something else?

Will fix it v2.

>
> > +__extension__ typedef void    *RTE_MARKER[0];
>
> Why do we need an extension?
> If it is part of C11, we should use RTE_STD_C11 instead.

Will fix it v2.

> If it is another reason, we could create another meaningful EAL macro.
>
>
>

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

* [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs
  2019-12-08 11:34 [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs jerinj
                   ` (2 preceding siblings ...)
  2019-12-10 22:46 ` [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs Thomas Monjalon
@ 2019-12-19 11:25 ` jerinj
  2019-12-19 11:25   ` [dpdk-dev] [PATCH v2 2/3] drivers: use structure marker typedef in eal jerinj
                     ` (4 more replies)
  3 siblings, 5 replies; 16+ messages in thread
From: jerinj @ 2019-12-19 11:25 UTC (permalink / raw)
  To: dev; +Cc: thomas, david.marchand, Jerin Jacob

From: Jerin Jacob <jerinj@marvell.com>

Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking and
a generic marker for a point in a structure.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---

v2:
- Changed __extension__  to  RTE_STD_C11 (Thomas)
- Change "a point" to "any place" of RTE_MARKER comment(Thomas)

 lib/librte_eal/common/include/rte_common.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 459d082d1..00c8b8434 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -335,6 +335,18 @@ typedef uint64_t phys_addr_t;
 typedef uint64_t rte_iova_t;
 #define RTE_BAD_IOVA ((rte_iova_t)-1)
 
+/*********** Structure alignment markers ********/
+
+/** Generic marker for any place in a structure. */
+RTE_STD_C11 typedef void    *RTE_MARKER[0];
+/** Marker for 1B alignment in a structure. */
+RTE_STD_C11 typedef uint8_t  RTE_MARKER8[0];
+/** Marker for 2B alignment in a structure. */
+RTE_STD_C11 typedef uint16_t RTE_MARKER16[0];
+/** Marker for 4B alignment in a structure. */
+RTE_STD_C11 typedef uint16_t RTE_MARKER32[0];
+/** Marker for 8B alignment in a structure. */
+RTE_STD_C11 typedef uint64_t RTE_MARKER64[0];
 
 /**
  * Combines 32b inputs most significant set bits into the least
-- 
2.24.1


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

* [dpdk-dev] [PATCH v2 2/3] drivers: use structure marker typedef in eal
  2019-12-19 11:25 ` [dpdk-dev] [PATCH v2 " jerinj
@ 2019-12-19 11:25   ` jerinj
  2019-12-19 11:25   ` [dpdk-dev] [PATCH v2 3/3] mbuf: " jerinj
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: jerinj @ 2019-12-19 11:25 UTC (permalink / raw)
  To: dev, Shepard Siegel, Ed Czeck, John Miller, Jerin Jacob,
	Nithin Dabilpuram, Kiran Kumar K, Maciej Czekaj
  Cc: thomas, david.marchand

From: Jerin Jacob <jerinj@marvell.com>

Use new marker typedef available in EAL.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/ark/ark_ethdev_rx.c     | 2 +-
 drivers/net/ark/ark_ethdev_tx.c     | 2 +-
 drivers/net/octeontx2/otx2_ethdev.h | 6 +++---
 drivers/net/thunderx/nicvf_struct.h | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 6156730bb..4d518d558 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -57,7 +57,7 @@ struct ark_rx_queue {
 
 	/* separate cache line */
 	/* second cache line - fields only used in slow path */
-	MARKER cacheline1 __rte_cache_min_aligned;
+	RTE_MARKER cacheline1 __rte_cache_min_aligned;
 
 	volatile uint32_t prod_index;	/* step 2 filled by FPGA */
 } __rte_cache_aligned;
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 08bcf431a..289668774 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -42,7 +42,7 @@ struct ark_tx_queue {
 	uint32_t pad[1];
 
 	/* second cache line - fields only used in slow path */
-	MARKER cacheline1 __rte_cache_min_aligned;
+	RTE_MARKER cacheline1 __rte_cache_min_aligned;
 	uint32_t cons_index;		/* hw is done, can be freed */
 } __rte_cache_aligned;
 
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 987e7607c..a6e8483a0 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -254,7 +254,7 @@ struct otx2_vlan_info {
 
 struct otx2_eth_dev {
 	OTX2_DEV; /* Base class */
-	MARKER otx2_eth_dev_data_start;
+	RTE_MARKER otx2_eth_dev_data_start;
 	uint16_t sqb_size;
 	uint16_t rx_chan_base;
 	uint16_t tx_chan_base;
@@ -335,7 +335,7 @@ struct otx2_eth_txq {
 	rte_iova_t fc_iova;
 	uint16_t sqes_per_sqb_log2;
 	int16_t nb_sqb_bufs_adj;
-	MARKER slow_path_start;
+	RTE_MARKER slow_path_start;
 	uint16_t nb_sqb_bufs;
 	uint16_t sq;
 	uint64_t offloads;
@@ -357,7 +357,7 @@ struct otx2_eth_rxq {
 	uint32_t available;
 	uint16_t rq;
 	struct otx2_timesync_info *tstamp;
-	MARKER slow_path_start;
+	RTE_MARKER slow_path_start;
 	uint64_t aura;
 	uint64_t offloads;
 	uint32_t qlen;
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 5d1379803..cf1c281a0 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -55,7 +55,7 @@ union mbuf_initializer {
 };
 
 struct nicvf_rxq {
-	MARKER rxq_fastpath_data_start;
+	RTE_MARKER rxq_fastpath_data_start;
 	uint8_t  rbptr_offset;
 	uint16_t rx_free_thresh;
 	uint32_t head;
@@ -69,7 +69,7 @@ struct nicvf_rxq {
 	struct rte_mempool *pool;
 	union cq_entry_t *desc;
 	union mbuf_initializer mbuf_initializer;
-	MARKER rxq_fastpath_data_end;
+	RTE_MARKER rxq_fastpath_data_end;
 	uint8_t rx_drop_en;
 	uint16_t precharge_cnt;
 	uint16_t port_id;
-- 
2.24.1


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

* [dpdk-dev] [PATCH v2 3/3] mbuf: use structure marker typedef in eal
  2019-12-19 11:25 ` [dpdk-dev] [PATCH v2 " jerinj
  2019-12-19 11:25   ` [dpdk-dev] [PATCH v2 2/3] drivers: use structure marker typedef in eal jerinj
@ 2019-12-19 11:25   ` jerinj
  2019-12-26 16:24     ` Olivier Matz
  2019-12-20  4:21   ` [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs Gavin Hu
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: jerinj @ 2019-12-19 11:25 UTC (permalink / raw)
  To: dev, Olivier Matz; +Cc: thomas, david.marchand, Jerin Jacob

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

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 {
-- 
2.24.1


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

* Re: [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs
  2019-12-19 11:25 ` [dpdk-dev] [PATCH v2 " jerinj
  2019-12-19 11:25   ` [dpdk-dev] [PATCH v2 2/3] drivers: use structure marker typedef in eal jerinj
  2019-12-19 11:25   ` [dpdk-dev] [PATCH v2 3/3] mbuf: " jerinj
@ 2019-12-20  4:21   ` Gavin Hu
  2019-12-26  8:15   ` Matan Azrad
  2020-01-20 20:11   ` Thomas Monjalon
  4 siblings, 0 replies; 16+ messages in thread
From: Gavin Hu @ 2019-12-20  4:21 UTC (permalink / raw)
  To: jerinj, dev; +Cc: thomas, david.marchand, jerinj, nd

Series-reviewed-by: Gavin Hu <gavin.hu@arm.com>

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

* Re: [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs
  2019-12-19 11:25 ` [dpdk-dev] [PATCH v2 " jerinj
                     ` (2 preceding siblings ...)
  2019-12-20  4:21   ` [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs Gavin Hu
@ 2019-12-26  8:15   ` Matan Azrad
  2020-01-02  6:27     ` Jerin Jacob
  2020-01-20 20:11   ` Thomas Monjalon
  4 siblings, 1 reply; 16+ messages in thread
From: Matan Azrad @ 2019-12-26  8:15 UTC (permalink / raw)
  To: jerinj, dev; +Cc: Thomas Monjalon, david.marchand

Hi

From: Jerin Jacob
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking and a
> generic marker for a point in a structure.
> 
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> ---
> 
> v2:
> - Changed __extension__  to  RTE_STD_C11 (Thomas)
> - Change "a point" to "any place" of RTE_MARKER comment(Thomas)
> 
>  lib/librte_eal/common/include/rte_common.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/lib/librte_eal/common/include/rte_common.h
> b/lib/librte_eal/common/include/rte_common.h
> index 459d082d1..00c8b8434 100644
> --- a/lib/librte_eal/common/include/rte_common.h
> +++ b/lib/librte_eal/common/include/rte_common.h
> @@ -335,6 +335,18 @@ typedef uint64_t phys_addr_t;  typedef uint64_t
> rte_iova_t;  #define RTE_BAD_IOVA ((rte_iova_t)-1)
> 
> +/*********** Structure alignment markers ********/
> +
> +/** Generic marker for any place in a structure. */
> +RTE_STD_C11 typedef void    *RTE_MARKER[0];
> +/** Marker for 1B alignment in a structure. */
> +RTE_STD_C11 typedef uint8_t  RTE_MARKER8[0];
> +/** Marker for 2B alignment in a structure. */
> +RTE_STD_C11 typedef uint16_t RTE_MARKER16[0];
> +/** Marker for 4B alignment in a structure. */
> +RTE_STD_C11 typedef uint16_t RTE_MARKER32[0];
> +/** Marker for 8B alignment in a structure. */
> +RTE_STD_C11 typedef uint64_t RTE_MARKER64[0];

I saw there are similar definitions in mbuf library.
What do you think about moving all libraries to use the same define from EAL?

>  /**
>   * Combines 32b inputs most significant set bits into the least
> --
> 2.24.1


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

* Re: [dpdk-dev] [PATCH v2 3/3] mbuf: use structure marker typedef in eal
  2019-12-19 11:25   ` [dpdk-dev] [PATCH v2 3/3] mbuf: " jerinj
@ 2019-12-26 16:24     ` Olivier Matz
  2020-01-20 21:55       ` Thomas Monjalon
  0 siblings, 1 reply; 16+ messages in thread
From: Olivier Matz @ 2019-12-26 16:24 UTC (permalink / raw)
  To: jerinj; +Cc: dev, thomas, david.marchand

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

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

* Re: [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs
  2019-12-26  8:15   ` Matan Azrad
@ 2020-01-02  6:27     ` Jerin Jacob
  2020-01-02  9:48       ` Matan Azrad
  0 siblings, 1 reply; 16+ messages in thread
From: Jerin Jacob @ 2020-01-02  6:27 UTC (permalink / raw)
  To: Matan Azrad; +Cc: jerinj, dev, Thomas Monjalon, david.marchand

On Thu, Dec 26, 2019 at 1:45 PM Matan Azrad <matan@mellanox.com> wrote:
>
> Hi
>
> From: Jerin Jacob
> > From: Jerin Jacob <jerinj@marvell.com>
> >
> > Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking and a
> > generic marker for a point in a structure.
> >
> > Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> > ---
> >
> > v2:
> > - Changed __extension__  to  RTE_STD_C11 (Thomas)
> > - Change "a point" to "any place" of RTE_MARKER comment(Thomas)
> >
> >  lib/librte_eal/common/include/rte_common.h | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> >
> > diff --git a/lib/librte_eal/common/include/rte_common.h
> > b/lib/librte_eal/common/include/rte_common.h
> > index 459d082d1..00c8b8434 100644
> > --- a/lib/librte_eal/common/include/rte_common.h
> > +++ b/lib/librte_eal/common/include/rte_common.h
> > @@ -335,6 +335,18 @@ typedef uint64_t phys_addr_t;  typedef uint64_t
> > rte_iova_t;  #define RTE_BAD_IOVA ((rte_iova_t)-1)
> >
> > +/*********** Structure alignment markers ********/
> > +
> > +/** Generic marker for any place in a structure. */
> > +RTE_STD_C11 typedef void    *RTE_MARKER[0];
> > +/** Marker for 1B alignment in a structure. */
> > +RTE_STD_C11 typedef uint8_t  RTE_MARKER8[0];
> > +/** Marker for 2B alignment in a structure. */
> > +RTE_STD_C11 typedef uint16_t RTE_MARKER16[0];
> > +/** Marker for 4B alignment in a structure. */
> > +RTE_STD_C11 typedef uint16_t RTE_MARKER32[0];
> > +/** Marker for 8B alignment in a structure. */
> > +RTE_STD_C11 typedef uint64_t RTE_MARKER64[0];
>
> I saw there are similar definitions in mbuf library.
> What do you think about moving all libraries to use the same define from EAL?

It is already done in 2/3 and 3/3 patches in the series.

>
> >  /**
> >   * Combines 32b inputs most significant set bits into the least
> > --
> > 2.24.1
>

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

* Re: [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs
  2020-01-02  6:27     ` Jerin Jacob
@ 2020-01-02  9:48       ` Matan Azrad
  2020-01-16 13:09         ` Jerin Jacob
  0 siblings, 1 reply; 16+ messages in thread
From: Matan Azrad @ 2020-01-02  9:48 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: jerinj, dev, Thomas Monjalon, david.marchand



From: Jerin Jacob 
> On Thu, Dec 26, 2019 at 1:45 PM Matan Azrad <matan@mellanox.com>
> wrote:
> >
> > Hi
> >
> > From: Jerin Jacob
> > > From: Jerin Jacob <jerinj@marvell.com>
> > >
> > > Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking
> > > and a generic marker for a point in a structure.
> > >
> > > Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> > > ---
> > >
> > > v2:
> > > - Changed __extension__  to  RTE_STD_C11 (Thomas)
> > > - Change "a point" to "any place" of RTE_MARKER comment(Thomas)
> > >
> > >  lib/librte_eal/common/include/rte_common.h | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > >
> > > diff --git a/lib/librte_eal/common/include/rte_common.h
> > > b/lib/librte_eal/common/include/rte_common.h
> > > index 459d082d1..00c8b8434 100644
> > > --- a/lib/librte_eal/common/include/rte_common.h
> > > +++ b/lib/librte_eal/common/include/rte_common.h
> > > @@ -335,6 +335,18 @@ typedef uint64_t phys_addr_t;  typedef uint64_t
> > > rte_iova_t;  #define RTE_BAD_IOVA ((rte_iova_t)-1)
> > >
> > > +/*********** Structure alignment markers ********/
> > > +
> > > +/** Generic marker for any place in a structure. */
> > > +RTE_STD_C11 typedef void    *RTE_MARKER[0];
> > > +/** Marker for 1B alignment in a structure. */
> > > +RTE_STD_C11 typedef uint8_t  RTE_MARKER8[0];
> > > +/** Marker for 2B alignment in a structure. */
> > > +RTE_STD_C11 typedef uint16_t RTE_MARKER16[0];
> > > +/** Marker for 4B alignment in a structure. */
> > > +RTE_STD_C11 typedef uint16_t RTE_MARKER32[0];
> > > +/** Marker for 8B alignment in a structure. */
> > > +RTE_STD_C11 typedef uint64_t RTE_MARKER64[0];
> >
> > I saw there are similar definitions in mbuf library.
> > What do you think about moving all libraries to use the same define from
> EAL?
> 
> It is already done in 2/3 and 3/3 patches in the series.

Sorry, missed it.
Series-acked-by: Matan Azrad <matan@mellanox.com>


> >
> > >  /**
> > >   * Combines 32b inputs most significant set bits into the least
> > > --
> > > 2.24.1
> >

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

* Re: [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs
  2020-01-02  9:48       ` Matan Azrad
@ 2020-01-16 13:09         ` Jerin Jacob
  0 siblings, 0 replies; 16+ messages in thread
From: Jerin Jacob @ 2020-01-16 13:09 UTC (permalink / raw)
  To: Matan Azrad; +Cc: jerinj, dev, Thomas Monjalon, david.marchand

On Thu, Jan 2, 2020 at 3:18 PM Matan Azrad <matan@mellanox.com> wrote:
>
>
>
> From: Jerin Jacob
> > On Thu, Dec 26, 2019 at 1:45 PM Matan Azrad <matan@mellanox.com>
> > wrote:
> > >
> > > Hi

>
> Sorry, missed it.
> Series-acked-by: Matan Azrad <matan@mellanox.com>

Ping for merge.


>
>
> > >
> > > >  /**
> > > >   * Combines 32b inputs most significant set bits into the least
> > > > --
> > > > 2.24.1
> > >

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

* Re: [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs
  2019-12-19 11:25 ` [dpdk-dev] [PATCH v2 " jerinj
                     ` (3 preceding siblings ...)
  2019-12-26  8:15   ` Matan Azrad
@ 2020-01-20 20:11   ` Thomas Monjalon
  4 siblings, 0 replies; 16+ messages in thread
From: Thomas Monjalon @ 2020-01-20 20:11 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, david.marchand

19/12/2019 12:25, jerinj@marvell.com:
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking and
> a generic marker for a point in a structure.
> 
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> ---
> 
> v2:
> - Changed __extension__  to  RTE_STD_C11 (Thomas)

Actually I was just asking a question to know if zero-size arrays
are part of C11 or not. It seems not, so better to keep as __extension__.
Or it could be a new macro.




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

* Re: [dpdk-dev] [PATCH v2 3/3] mbuf: use structure marker typedef in eal
  2019-12-26 16:24     ` Olivier Matz
@ 2020-01-20 21:55       ` Thomas Monjalon
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Monjalon @ 2020-01-20 21:55 UTC (permalink / raw)
  To: jerinj; +Cc: dev, Olivier Matz, gavin.hu, matan

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



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

end of thread, other threads:[~2020-01-20 21:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-08 11:34 [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs jerinj
2019-12-08 11:34 ` [dpdk-dev] [PATCH 2/3] drivers: use structure marker typedef in eal jerinj
2019-12-08 11:34 ` [dpdk-dev] [PATCH 3/3] mbuf: " jerinj
2019-12-10 22:46 ` [dpdk-dev] [PATCH 1/3] eal: introduce structure marker typedefs Thomas Monjalon
2019-12-19 10:34   ` Jerin Jacob
2019-12-19 11:25 ` [dpdk-dev] [PATCH v2 " jerinj
2019-12-19 11:25   ` [dpdk-dev] [PATCH v2 2/3] drivers: use structure marker typedef in eal jerinj
2019-12-19 11:25   ` [dpdk-dev] [PATCH v2 3/3] mbuf: " jerinj
2019-12-26 16:24     ` Olivier Matz
2020-01-20 21:55       ` Thomas Monjalon
2019-12-20  4:21   ` [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs Gavin Hu
2019-12-26  8:15   ` Matan Azrad
2020-01-02  6:27     ` Jerin Jacob
2020-01-02  9:48       ` Matan Azrad
2020-01-16 13:09         ` Jerin Jacob
2020-01-20 20:11   ` 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).