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 BD06D45F25; Mon, 23 Dec 2024 20:13:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 76DA340696; Mon, 23 Dec 2024 20:12:39 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 43E28402CD for ; Mon, 23 Dec 2024 20:12:16 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 45000206ADDD; Mon, 23 Dec 2024 11:12:14 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 45000206ADDD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1734981135; bh=dy3BAsCFmxUzVaOfRuKXBLnvnWmdoSsWFrJL5OmY7U4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pXnId3tGQmRpjEOwYoQUER76OC54DoJ2ZucBTKKhXmY9hI/YdQNOggAJDhrM1Xheb bg2Xwt7GiNdTDkTqI8dJoWc/S3F2uBgXfeUNL9u3Ed6wWmorO+pCmkx2jrLPRkXxFG SpVvYrgSiLBUnDygKinvFJ1uyrr0ftHpiqWbi/9w= 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 15/29] drivers/raw: replace packed attributes Date: Mon, 23 Dec 2024 11:11:48 -0800 Message-Id: <1734981122-4729-16-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 Reviewed-by: Tyler Retzlaff --- drivers/raw/ifpga/afu_pmd_n3000.h | 8 ++++---- drivers/raw/ifpga/base/opae_hw_api.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/raw/ifpga/afu_pmd_n3000.h b/drivers/raw/ifpga/afu_pmd_n3000.h index f6b6e07c6b..a74025cb3c 100644 --- a/drivers/raw/ifpga/afu_pmd_n3000.h +++ b/drivers/raw/ifpga/afu_pmd_n3000.h @@ -211,7 +211,7 @@ typedef union { }; } msgdma_desc_ctrl; -typedef struct __rte_packed { +typedef __rte_packed_begin struct { uint32_t rd_address; uint32_t wr_address; uint32_t len; @@ -223,7 +223,7 @@ typedef struct __rte_packed { uint32_t rd_address_ext; uint32_t wr_address_ext; msgdma_desc_ctrl control; -} msgdma_ext_desc; +} __rte_packed_end msgdma_ext_desc; typedef union { uint32_t csr; @@ -279,13 +279,13 @@ typedef union { }; } msgdma_seq_num; -typedef struct __rte_packed { +typedef __rte_packed_begin struct { msgdma_status status; msgdma_ctrl ctrl; msgdma_fill_level fill_level; msgdma_rsp_level rsp; msgdma_seq_num seq_num; -} msgdma_csr; +} __rte_packed_end msgdma_csr; #define CSR_STATUS(csr) (&(((msgdma_csr *)(csr))->status)) #define CSR_CONTROL(csr) (&(((msgdma_csr *)(csr))->ctrl)) diff --git a/drivers/raw/ifpga/base/opae_hw_api.h b/drivers/raw/ifpga/base/opae_hw_api.h index 613563a0b4..5957f67417 100644 --- a/drivers/raw/ifpga/base/opae_hw_api.h +++ b/drivers/raw/ifpga/base/opae_hw_api.h @@ -343,9 +343,9 @@ static inline void opae_adapter_remove_acc(struct opae_adapter *adapter, /* OPAE vBNG network datastruct */ #define OPAE_ETHER_ADDR_LEN 6 -struct opae_ether_addr { +__rte_packed_begin struct opae_ether_addr { unsigned char addr_bytes[OPAE_ETHER_ADDR_LEN]; -} __rte_packed; +} __rte_packed_end; /* OPAE vBNG network API*/ int opae_manager_read_mac_rom(struct opae_manager *mgr, int port, -- 2.47.0.vfs.0.3