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 2988B43ABA; Tue, 13 Feb 2024 07:45:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F195B402AD; Tue, 13 Feb 2024 07:45:44 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 133804027B for ; Tue, 13 Feb 2024 07:45:43 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 667F1207ECB2; Mon, 12 Feb 2024 22:45:42 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 667F1207ECB2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707806742; bh=7XzZUynyolC15nZ4nwmmz7f1DY5dehSnddAAtIzhxsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sTDXVGJ/3VN2pOnlsdF1nnH+9A+CH/8XUbSKUpbqVi7GVVt7fZgY2Q9Y5RmeyUZdZ IIiv8IFmdX4BV9zCOjWC0UXSyujrAFoov0DVRnvlv8JVt0GJrmgrQsAdrBhnNjzMq4 zYie4bephNmz/aAoRNUnukk7phD/peRUucx+UEyk= From: Tyler Retzlaff To: dev@dpdk.org Cc: Andrew Boyer , Andrew Rybchenko , Bruce Richardson , Chenbo Xia , Konstantin Ananyev , Maxime Coquelin , mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH v2] RFC: replace GCC marker extension with C11 anonymous unions Date: Mon, 12 Feb 2024 22:45:40 -0800 Message-Id: <1707806741-29694-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1706657173-26166-2-git-send-email-roretzla@linux.microsoft.com> References: <1706657173-26166-2-git-send-email-roretzla@linux.microsoft.com> 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 The zero sized RTE_MARKER typedefs are a GCC extension unsupported by MSVC. Replace the use of the RTE_MARKER typedefs with anonymous unions. Note: v1 of the series tried to maintain the API after some study it has been discovered that some existing uses of the markers do not produce compilation failure but evaluate to unintended values in the absence of adaptation. For this reason the existing markers cannot be removed because it is too hard to identify what needs to be changed by consumers. While the ABI has been maintained the subtle API change is just too risky. The question I'm asking now is how to gracefully deprecate the markers while allowing consumption of the struct on Windows. I propose the following: * Introduce the unions as per-this series except instead of adding members that match the original RTE_MARKER field names provide *new* names. * Retain (conditionally compiled away on Windows) the existing RTE_MARKER fields with their original names. * Convert in-tree code to use the new names in the unions. The old names & markers would be announced for deprecation and eventually removed and when they are the conditional compilation would also go away. Thoughts? v2: * Introduce additional union/struct to agnostically pad cachline0 to RTE_CACHE_LINE_MIN_SIZE without conditional compilation. * Adapt ixgbe access of rearm_data field. * Move ol_flags field out of rearm_data union where it didn't belong. * Added a couple of static_asserts for offset of cacheline1 and sizeof struct rte_mbuf. Tyler Retzlaff (1): mbuf: replace GCC marker extension with C11 anonymous unions drivers/net/ionic/ionic_lif.c | 8 +- drivers/net/ionic/ionic_rxtx_sg.c | 4 +- drivers/net/ionic/ionic_rxtx_simple.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 8 +- drivers/net/sfc/sfc_ef100_rx.c | 8 +- drivers/net/sfc/sfc_ef10_rx.c | 12 +- drivers/net/virtio/virtio_rxtx_packed_avx.h | 8 +- lib/mbuf/rte_mbuf_core.h | 276 ++++++++++++++++------------ 8 files changed, 179 insertions(+), 147 deletions(-) -- 1.8.3.1