From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1E6D43B39; Sun, 18 Feb 2024 13:40:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A95C4028A; Sun, 18 Feb 2024 13:40:04 +0100 (CET) Received: from wfhigh3-smtp.messagingengine.com (wfhigh3-smtp.messagingengine.com [64.147.123.154]) by mails.dpdk.org (Postfix) with ESMTP id 4709C40262 for ; Sun, 18 Feb 2024 13:40:03 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id 3D1C51800092; Sun, 18 Feb 2024 07:39:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 18 Feb 2024 07:40:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1708259998; x=1708346398; bh=BFhqE5W96hBT5XkF+yFU575EEJv2ngv50ohPclPN+h4=; b= qCK6poht2Ku+65krM534oWG44zmBREPBw0ddVoNQd9xqgCfsLMTQ8S6GhvoiTsL0 uPBz9SL43GVZp4Vn/ocgnF8pLa6P4Ow0ecsujJ8DlyrBbwFETti4dhr6nbauvuL+ 8lGi2R9T3jk6dyFyui3lukna7WVCpRLdrG4SUxm1uK8npAxyZRU+UMqxBytCbLKb wnPnhyf8CE30hB3fcBhi+P3sS0kB/z2qx55BPnYmRWBYUrQPdjR97+Lq/Cy81riq yFsIx3uueEFJ0bykNBYEbOCBjs2XsgHtrMBXTqfysGOXVZtvZNNe8TBXVIavOfdq oGGtS8d9PmgF4xmVgE5XmQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708259998; x= 1708346398; bh=BFhqE5W96hBT5XkF+yFU575EEJv2ngv50ohPclPN+h4=; b=F UMt8A4AHy4IKm1aHCxt2/Vlq0LKwAmzBTQUPYGZfnOdmgLMyZRHJjoJ7WVQ2etnH kzxvaHqGLQo4nZ55zXg5IPPBxxp1gWW/3ZB1EceBYB4tXUV3hrhasbdtTM9gYJCz OZ4yTk7KB/KZQ/K7n+bcQ7/rAYmVv8uEp+97KXx63RyumZO+qVTcQtbJMtzsQyJ/ ahJ9NikLM4b9jhEJN25IkM5lIqpML2r0+RD9A3zEjUUAZe+ddFz827ryrgiHhIBU 4xFB85CZXHzoflbyUMrpAhGwIiXwNp6uQqJH+tliQ6rspom9nP2LxTfGXhfoLgrW E2N5YU4jT4+R9I9NqN9uw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeigdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddtieek gfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 18 Feb 2024 07:39:54 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Ajit Khaparde , Andrew Boyer , Andrew Rybchenko , Bruce Richardson , Chenbo Xia , Chengwen Feng , Dariusz Sosnowski , David Christensen , Hyong Youb Kim , Jerin Jacob , Jie Hai , Jingjing Wu , John Daley , Kevin Laatz , Kiran Kumar K , Konstantin Ananyev , Maciej Czekaj , Matan Azrad , Maxime Coquelin , Nithin Dabilpuram , Ori Kam , Ruifeng Wang , Satha Rao , Somnath Kotur , Suanming Mou , Sunil Kumar Kori , Viacheslav Ovsiienko , Yisen Zhuang , Yuying Zhang , mb@smartsharesystems.com, Tyler Retzlaff Subject: Re: [PATCH v4 01/18] mbuf: deprecate GCC marker in rte mbuf struct Date: Sun, 18 Feb 2024 13:39:52 +0100 Message-ID: <7561963.alqRGMn8q6@thomas> In-Reply-To: <1707978080-28859-2-git-send-email-roretzla@linux.microsoft.com> References: <1706657173-26166-1-git-send-email-roretzla@linux.microsoft.com> <1707978080-28859-1-git-send-email-roretzla@linux.microsoft.com> <1707978080-28859-2-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 15/02/2024 07:21, Tyler Retzlaff: > Provide a macro that allows conditional expansion of RTE_MARKER fields > to empty to allow rte_mbuf to be used with MSVC. It is proposed that > we announce the fields to be __rte_deprecated (currently disabled). > > Introduce C11 anonymous unions to permit aliasing of well-known > offsets by name into the rte_mbuf structure by a *new* name and to > provide padding for cache alignment. > > Signed-off-by: Tyler Retzlaff > --- > doc/guides/rel_notes/deprecation.rst | 20 ++ > lib/eal/include/rte_common.h | 6 + > lib/mbuf/rte_mbuf_core.h | 375 +++++++++++++++++++---------------- > 3 files changed, 233 insertions(+), 168 deletions(-) > > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst > index 10630ba..8594255 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -17,6 +17,26 @@ Other API and ABI deprecation notices are to be posted below. > Deprecation Notices > ------------------- > > +* mbuf: Named zero sized fields of type ``RTE_MARKER`` and ``RTE_MARKER64`` > + will be removed from ``struct rte_mbuf`` and replaced with new fields > + in anonymous unions. > + > + The names of the fields impacted are: > + > + old name new name > + > + ``cacheline0`` ``mbuf_cachelin0`` > + ``rearm_data`` ``mbuf_rearm_data`` > + ``rx_descriptor_fields1`` ``mbuf_rx_descriptor_fields1`` > + ``cacheline1`` ``mbuf_cachelin1`` > + > + Contributions to DPDK should immediately start using the new names, > + applications should adapt to new names as soon as possible as the > + old names will be removed in a future DPDK release. > + > + Note: types of the new names are not API compatible with the old and > + some code conversion is required to maintain correct behavior. > + > * build: The ``enable_kmods`` option is deprecated and will be removed in a future release. > Setting/clearing the option has no impact on the build. > Instead, kernel modules will be always built for OS's where out-of-tree kernel modules > diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h > index d7d6390..af73f67 100644 > --- a/lib/eal/include/rte_common.h > +++ b/lib/eal/include/rte_common.h > @@ -582,6 +582,12 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) > /** Marker for 8B alignment in a structure. */ > __extension__ typedef uint64_t RTE_MARKER64[0]; > > +#define __rte_marker(type, name) type name /* __rte_deprecated */ > + > +#else > + > +#define __rte_marker(type, name) > + > #endif > > /*********** Macros for calculating min and max **********/ > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h > index 5688683..9e9590b 100644 > --- a/lib/mbuf/rte_mbuf_core.h > +++ b/lib/mbuf/rte_mbuf_core.h > @@ -16,7 +16,10 @@ > * New fields and flags should fit in the "dynamic space". > */ > > +#include > +#include > #include > +#include > > #include > #include > @@ -464,204 +467,240 @@ enum { > * The generic rte_mbuf, containing a packet mbuf. > */ > struct rte_mbuf { > - RTE_MARKER cacheline0; > - > - void *buf_addr; /**< Virtual address of segment buffer. */ > + __rte_marker(RTE_MARKER, cacheline0); You don't need to keep the first argument. This would be simpler: __rte_marker(cacheline0); You just need to create 2 functions: __rte_marker and __rte_marker64. You should replace all occurrences of RTE_MARKER in DPDK in one patch, and mark RTE_MARKER as deprecated (use #pragma GCC poison) > + union { > + char mbuf_cacheline0[RTE_CACHE_LINE_MIN_SIZE]; > + __extension__ > + struct { > + void *buf_addr; /**< Virtual address of segment buffer. I think it is ugly. Changing mbuf API is a serious issue.