From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 0827346022;
	Fri, 10 Jan 2025 23:17:37 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 7BC864066A;
	Fri, 10 Jan 2025 23:17:07 +0100 (CET)
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
 by mails.dpdk.org (Postfix) with ESMTP id 2FF614026A
 for <dev@dpdk.org>; Fri, 10 Jan 2025 23:16:59 +0100 (CET)
Received: by linux.microsoft.com (Postfix, from userid 1213)
 id ACFCB203D5F8; Fri, 10 Jan 2025 14:16:57 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com ACFCB203D5F8
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
 s=default; t=1736547417;
 bh=CztIuau0cK8Umzy1WlTz3hJ2UluEtX+nSc4Ag7DR/64=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=I3IP0Plhv9DVU73qcBAnAbGvSztPDHdhRm5UCPtOIehCfCo8/N8pcjmfFrsuKwT5g
 D0m2o/fakCq1fMNJjLTcv0Vnish8PwoHwDT7T7Ki1LjbKQTs4NoWyNiTwO1ppWQ/SY
 5bH6gs+RtAolWNU47/Z2+DK+OC0LneOhm65n1DGU=
From: Andre Muezerie <andremue@linux.microsoft.com>
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, mb@smartsharesystems.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 <andremue@linux.microsoft.com>
Subject: [PATCH v11 05/30] doc/guides: replace packed attributes
Date: Fri, 10 Jan 2025 14:16:26 -0800
Message-Id: <1736547411-5895-6-git-send-email-andremue@linux.microsoft.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1736547411-5895-1-git-send-email-andremue@linux.microsoft.com>
References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com>
 <1736547411-5895-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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=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 <andremue@linux.microsoft.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 doc/guides/nics/ark.rst                              | 4 ++--
 doc/guides/prog_guide/packet_classif_access_ctrl.rst | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index a9f6d4cdb8..6aabde2ed5 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -172,10 +172,10 @@ during RX from user meta data coming from FPGA hardware.
    };
 
    /* RX tuser field based on user's hardware */
-   struct user_rx_meta {
+   struct __rte_packed_begin 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..e2cd60fb47 100644
--- a/doc/guides/prog_guide/packet_classif_access_ctrl.rst
+++ b/doc/guides/prog_guide/packet_classif_access_ctrl.rst
@@ -154,14 +154,14 @@ To define classification for the IPv6 2-tuple: <protocol, IPv6 source address> o
 
 .. code-block:: c
 
-    struct rte_ipv6_hdr {
+    struct __rte_packed_begin rte_ipv6_hdr {
         uint32_t vtc_flow;     /* IP version, traffic class & flow label. */
         uint16_t payload_len;  /* IP packet length - includes sizeof(ip_header). */
         uint8_t proto;         /* Protocol, next header. */
         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