From patchwork Thu Dec 19 11:25:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob Kollanukkaran X-Patchwork-Id: 64008 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BCE16A04F0; Thu, 19 Dec 2019 12:24:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 473161BE8A; Thu, 19 Dec 2019 12:24:30 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id AE6C51BDFD for ; Thu, 19 Dec 2019 12:24:28 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBJBN8nF007138; Thu, 19 Dec 2019 03:24:27 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=B3WRrQgS3Xj+0WX1ohZk0W8NYXn21n8I6vhn0eyMzyQ=; b=qUyxoEWulw3Itre9mdStAf51SbbzrAfzP0B1VlsDdcJ0e2dMlZYMAIyfXcI1azUSxdBu qYKW8zqeCNoFuuJm5xHIDVpaXXjvF2SkX9fHeclPYeFQGu7+f49A/dDEizPvirX8EO72 FaoGctLYVC+52RlvUqpO1AXLxh+L/7kb+AZEOBobesn4OnlKiAPtgnBQOjoj3hzbIxtf lpoOMuHWgWv3DLGNHRDahpo/SnqNmBXKG6/I1jlm2w3qM8zjJDgzrJ1e/E86ooPfIFbJ pz8l0srhWEdPktIn86wcAyZfqq+xJzk/bXzU14Ba/7kFxTW0iUp9dXZ+6/eu2Vg14nYz 3w== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2wxneb2p8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2019 03:24:26 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 19 Dec 2019 03:24:25 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 19 Dec 2019 03:24:25 -0800 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 584A73F7041; Thu, 19 Dec 2019 03:24:23 -0800 (PST) From: To: CC: , , Jerin Jacob Date: Thu, 19 Dec 2019 16:55:05 +0530 Message-ID: <20191219112507.3142025-1-jerinj@marvell.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191208113413.2179329-1-jerinj@marvell.com> References: <20191208113413.2179329-1-jerinj@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-19_01:2019-12-17,2019-12-19 signatures=0 Subject: [dpdk-dev] [PATCH v2 1/3] eal: introduce structure marker typedefs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob 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 --- 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 From patchwork Thu Dec 19 11:25:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob Kollanukkaran X-Patchwork-Id: 64009 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D1D6A04F0; Thu, 19 Dec 2019 12:24:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D6721BF73; Thu, 19 Dec 2019 12:24:37 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id C36DF1BF73 for ; Thu, 19 Dec 2019 12:24:35 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBJBK5mG002508; Thu, 19 Dec 2019 03:24:33 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=T1N1Sr6GELSbE1NAKwTIHMu4ha4KmjmWNAD7MECIzRU=; b=pYXXFvOqqLGceRnQ+45lDRWsVqL6TPadhPZmygh7hHCELRyQgZ0MwdBEJE/0To3F8Mz0 amNvFFyXKwlt/dMu8T+Z/C/JImI4k6He1U4uLoMnvZQ0L7A5U9fUHvg74LS08RpJRz8j 8NTUBjUyBG7Ow2MBkosX5shVbZ01C3cA4R69rNEvNy+Ra7+4j6uEvi8LPHAFjwXjT90X Nb1RmENz62AQDIHOZlrZleYwf1AlJ7lkY8Tw0QvXkffN1XZJg1K/LdXXaW71aSQEO+Bi KrS5tBu9JK7gALsFMXKFkEGrN4fsQDDIq9MlLWy+hqRjIXOlJrX949w2EqTUZ7feE/N6 vw== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2wxn0wtqe7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2019 03:24:33 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 19 Dec 2019 03:24:30 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 19 Dec 2019 03:24:30 -0800 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id BC4343F703F; Thu, 19 Dec 2019 03:24:26 -0800 (PST) From: To: , Shepard Siegel , Ed Czeck , John Miller , "Jerin Jacob" , Nithin Dabilpuram , Kiran Kumar K , Maciej Czekaj CC: , Date: Thu, 19 Dec 2019 16:55:06 +0530 Message-ID: <20191219112507.3142025-2-jerinj@marvell.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219112507.3142025-1-jerinj@marvell.com> References: <20191208113413.2179329-1-jerinj@marvell.com> <20191219112507.3142025-1-jerinj@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-19_01:2019-12-17,2019-12-19 signatures=0 Subject: [dpdk-dev] [PATCH v2 2/3] drivers: use structure marker typedef in eal X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob Use new marker typedef available in EAL. Signed-off-by: Jerin Jacob --- 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; From patchwork Thu Dec 19 11:25:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob Kollanukkaran X-Patchwork-Id: 64010 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 26106A04F0; Thu, 19 Dec 2019 12:24:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C7DC41BF7B; Thu, 19 Dec 2019 12:24:38 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 503461BF73 for ; Thu, 19 Dec 2019 12:24:36 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBJBK5Ym002533; Thu, 19 Dec 2019 03:24:35 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=BoiWyqJCmSkba2bYO7BvQhYS9sl3dByto86cq7qJKTc=; b=CA1/BDCM2n95uFLNkZRT/WYEPCPNzogX2y4a4jKKItgocnlHPL9+bfbNxzfGyDZg7Z8H H1BHFv/UsGJV8P8Yofs3ZMXidCWBs9FgPWRyU5mFVLfX6FGcjkNBOszeW3ggMYv2lsrA uN53Dvtdn1JlIvCZ8GeODxOnHZ83aaAT4ifTV3+10ojDjCP+KbNyw+Zdt6uIOd+UCDad zwyqcA+5IHFM/EEj6zlUfzUTGbqWKFfoSeO2AgdAig+mAk+RGJkccueNit3/1EsPmW7a cvg/1cCWLuGG+ntP4nH4zbEpUkxuhGJKXgY//CDS4V0Ps6SL4SanL30Sg+6P+h1ziFO2 xQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2wxn0wtqeg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2019 03:24:35 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 19 Dec 2019 03:24:33 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 19 Dec 2019 03:24:33 -0800 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id DC89A3F703F; Thu, 19 Dec 2019 03:24:31 -0800 (PST) From: To: , Olivier Matz CC: , , Jerin Jacob Date: Thu, 19 Dec 2019 16:55:07 +0530 Message-ID: <20191219112507.3142025-3-jerinj@marvell.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219112507.3142025-1-jerinj@marvell.com> References: <20191208113413.2179329-1-jerinj@marvell.com> <20191219112507.3142025-1-jerinj@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-19_01:2019-12-17,2019-12-19 signatures=0 Subject: [dpdk-dev] [PATCH v2 3/3] mbuf: use structure marker typedef in eal X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob Use new marker typedef available in EAL and remove private marker typedef. Signed-off-by: Jerin Jacob Acked-by: Olivier Matz --- 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 {