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 7023945D31; Wed, 27 Nov 2024 01:54:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2549C42D83; Wed, 27 Nov 2024 01:53:22 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id E0603427C3 for ; Wed, 27 Nov 2024 01:53:03 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 4F5EE20545BA; Tue, 26 Nov 2024 16:53:02 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4F5EE20545BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1732668782; bh=g3WhUkpUG9NiJHWnDcJN7x0PuEUlaVT5PLDi7NrI1qI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q06onQYBdh5ap8UjGfUfvtrAzFzSUQgX4wnv3vwB6cDqaM47CUUZVJQthEvkyDTlg w/HXYGHN2VOAxRggsn5LfHFCxMkeyNthEM3FPmHp93VYp0gL2HROa9LELUzjvb7Esq zXCiiNmacqr9ursRmB3FFPWhArrGammRrAvKSC4c= From: Andre Muezerie To: roretzla@linux.microsoft.com Cc: 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, Andre Muezerie Subject: [PATCH v6 05/30] doc/guides: replace packed attributes Date: Tue, 26 Nov 2024 16:52:16 -0800 Message-Id: <1732668761-5556-6-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1732668761-5556-1-git-send-email-andremue@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1732668761-5556-1-git-send-email-andremue@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 MSVC struct packing is not compatible with GCC. Replace macro __rte_packed with __rte_packed_begin to push existing pack value and set packing to 1-byte and macro __rte_packed_end to restore the pack value prior to the push. Macro __rte_packed_end is deliberately utilized to trigger a MSVC compiler warning if no existing packing has been pushed allowing easy identification of locations where the __rte_packed_begin is missing. Signed-off-by: Andre Muezerie --- doc/guides/nics/ark.rst | 3 ++- doc/guides/prog_guide/packet_classif_access_ctrl.rst | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst index a9f6d4cdb8..0cb5460199 100644 --- a/doc/guides/nics/ark.rst +++ b/doc/guides/nics/ark.rst @@ -172,10 +172,11 @@ during RX from user meta data coming from FPGA hardware. }; /* RX tuser field based on user's hardware */ + __rte_packed_begin struct user_rx_meta { uint64_t timestamp; uint32_t rss; - } __rte_packed; + } __rte_packed_end; /* Create ark_user_extension object for use in other hook functions */ void *rte_pmd_ark_dev_init(struct rte_eth_dev * dev, diff --git a/doc/guides/prog_guide/packet_classif_access_ctrl.rst b/doc/guides/prog_guide/packet_classif_access_ctrl.rst index c8844d0616..55db983a05 100644 --- a/doc/guides/prog_guide/packet_classif_access_ctrl.rst +++ b/doc/guides/prog_guide/packet_classif_access_ctrl.rst @@ -154,6 +154,7 @@ To define classification for the IPv6 2-tuple: o .. code-block:: c + __rte_packed_begin struct rte_ipv6_hdr { uint32_t vtc_flow; /* IP version, traffic class & flow label. */ uint16_t payload_len; /* IP packet length - includes sizeof(ip_header). */ @@ -161,7 +162,7 @@ To define classification for the IPv6 2-tuple: o uint8_t hop_limits; /* Hop limits. */ uint8_t src_addr[16]; /* IP address of source host. */ uint8_t dst_addr[16]; /* IP address of destination host(s). */ - } __rte_packed; + } __rte_packed_end; The following array of field definitions can be used: -- 2.34.1