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 BF51B45F25; Mon, 23 Dec 2024 20:11:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F8634026C; Mon, 23 Dec 2024 20:11:13 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id E381A40263 for ; Mon, 23 Dec 2024 20:11:11 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id E5EB2206ADCE; Mon, 23 Dec 2024 11:11:10 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E5EB2206ADCE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1734981070; bh=OnujrdCW3r2cdCeGhsAu66jDAtjLaFCJs9HjYs2I1ac=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PL03slveljQvo4XOM5QFNm+tOsNVa9XnYLORT9ecC41N/o94KOYCPv0Frbydal3fL vl4r4jaftKdJDcCtvsxfIFLuCoCbx2pahilkaRzz1DvxV5jdIBJv16xq/hlzw1Btr0 X1BNeq2Eg2u742k3axR3vTOyFxGhE90HZTEIy9vY= Date: Mon, 23 Dec 2024 11:11:10 -0800 From: Andre Muezerie To: David Marchand Cc: roretzla@linux.microsoft.com, aman.deep.singh@intel.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, byron.marohn@intel.com, conor.walsh@intel.com, cristian.dumitrescu@intel.com, david.hunt@intel.com, dev@dpdk.org, dsosnowski@nvidia.com, gakhil@marvell.com, jerinj@marvell.com, jingjing.wu@intel.com, kirill.rybalchenko@intel.com, konstantin.v.ananyev@yandex.ru, matan@nvidia.com, orika@nvidia.com, radu.nicolau@intel.com, ruifeng.wang@arm.com, sameh.gobriel@intel.com, sivaprasad.tummala@amd.com, skori@marvell.com, stephen@networkplumber.org, suanmingm@nvidia.com, vattunuru@marvell.com, viacheslavo@nvidia.com, vladimir.medvedkin@intel.com, yipeng1.wang@intel.com Subject: Re: [PATCH v6 00/30] fix packing of structs when building with MSVC Message-ID: <20241223191110.GA4395@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1732668761-5556-1-git-send-email-andremue@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Mon, Dec 23, 2024 at 12:46:34PM +0100, David Marchand wrote: > On Mon, Dec 23, 2024 at 12:03 PM David Marchand > wrote: > > > v6: > > > * replace __rte_msvc_pack with __rte_packed_begin > > > * replace __rte_packed with __rte_packed_end > > > * update checkpatches.sh to ensure __rte_packed_begin and > > > __rte_packed_end are used in pairs > > > > I had mentionned this in a separate thread. > > Why not do like OVS and have a RTE_PACKED() macro? > > > > #ifdef RTE_TOOLCHAIN_MSVC > > #define RTE_PACKED(...) __pragma(pack(push, 1)) __VA_ARGS__ __pragma(pack(pop)) > > #else > > #define RTE_PACKED(...) __VA_ARGS__ __attribute__((__packed__)) > > #endif > > Mm, in practice, this would be problematic with struct where > endianness matters (for example). > > In file included from ../../../git/pub/dpdk.org/main/lib/net/rte_ip.h:9, > from ../../../git/pub/dpdk.org/main/lib/ethdev/rte_flow.h:25, > from > ../../../git/pub/dpdk.org/main/lib/ethdev/rte_eth_ctrl.h:11, > from > ../../../git/pub/dpdk.org/main/lib/ethdev/rte_ethdev.h:1472, > from > ../../../git/pub/dpdk.org/main/lib/ethdev/ethdev_driver.h:21, > from > ../../../git/pub/dpdk.org/main/drivers/net/failsafe/failsafe_ops.c:15: > ../../../git/pub/dpdk.org/main/lib/net/rte_ip4.h:48:1: error: > embedding a directive within macro arguments is not portable [-Werror] > 48 | #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN > | ^ > ../../../git/pub/dpdk.org/main/lib/net/rte_ip4.h:51:1: error: > embedding a directive within macro arguments is not portable [-Werror] > 51 | #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN > | ^ > ../../../git/pub/dpdk.org/main/lib/net/rte_ip4.h:54:1: error: > embedding a directive within macro arguments is not portable [-Werror] > 54 | #endif > | ^ > > > > > > This removes the need for updating checkpatch. > > Plus, builds on Linux will catch issues (hopefully by the author of > > the change, before submitting). > > > > > > > * remove __rte_packed > > > > Please mark it deprecated for now (see RTE_DEPRECATED / add a > > deprecation notice) and we will remove it in 25.11. > > Still, please rework this part. > > > -- > David Marchand Yes, I'll send out an updated series shortly. -- Andre Muezerie