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 9D30A45F25; Mon, 23 Dec 2024 20:12:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D87DB4042E; Mon, 23 Dec 2024 20:12:22 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A2D344026C for ; Mon, 23 Dec 2024 20:12:15 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 5BB0D206ADD3; Mon, 23 Dec 2024 11:12:14 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5BB0D206ADD3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1734981134; bh=a23kqk8PYB+z+fLTCCwcSIn/RXo9D0atJ6EjDciSGgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qzoerlC5CI9woUN1utHChT7/iN6lrVS9suBVfzztZ8NLGLHFvYpZ5bjm9VFAUu7j6 eKILFmZic7tFLxXt6d1+ntXL+8+YDAFHfup2q3mp7wE+A0eIclD1A7bvfovMr6RqPx jrOledMP53ySEx2S5RriNi+LkPO8pWf4WQ0sUxyA= 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 v7 05/29] doc/guides: replace packed attributes Date: Mon, 23 Dec 2024 11:11:38 -0800 Message-Id: <1734981122-4729-6-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1734981122-4729-1-git-send-email-andremue@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1734981122-4729-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 Acked-by: Tyler Retzlaff --- 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.47.0.vfs.0.3