From patchwork Wed Mar 27 23:09:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 138925 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 600DA43D5B; Thu, 28 Mar 2024 00:09:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AD8E41151; Thu, 28 Mar 2024 00:09:26 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3FAFF40EE3 for ; Thu, 28 Mar 2024 00:09:20 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 62AC120E6940; Wed, 27 Mar 2024 16:09:19 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 62AC120E6940 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1711580959; bh=vlaWpD6eQhjJAAAnq4XOEGcsLTHA5jfWElbk++Td5tg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=grEIZCFvp8nTL2hhDis8H8U0SQYXMXoS8vly8RqzpiyEq9JoeULtI35pwKVkAi7Ow OB1XWFWiGcRlGM6IfO1NP3unsGM8duMemFG4DCAf7kZzCcWQUUc2KN0h68vobJXwEQ yWGdXRMuAiOk8oQOJeEX5Q2+k6Z+z7onqPgrUyIw= From: Tyler Retzlaff To: dev@dpdk.org Cc: Akhil Goyal , Aman Singh , Anatoly Burakov , Bruce Richardson , Byron Marohn , Conor Walsh , Cristian Dumitrescu , Dariusz Sosnowski , David Hunt , Jerin Jacob , Jingjing Wu , Kirill Rybalchenko , Konstantin Ananyev , Matan Azrad , Ori Kam , Radu Nicolau , Ruifeng Wang , Sameh Gobriel , Sivaprasad Tummala , Suanming Mou , Sunil Kumar Kori , Vamsi Attunuru , Viacheslav Ovsiienko , Vladimir Medvedkin , Yipeng Wang , Yuying Zhang , Yuying Zhang , Tyler Retzlaff Subject: [PATCH v2 04/15] common/iavf: pack structures when building with MSVC Date: Wed, 27 Mar 2024 16:09:07 -0700 Message-Id: <1711580958-20808-5-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1711580958-20808-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1711580958-20808-1-git-send-email-roretzla@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 Add __rte_msvc_pushpack(1) to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- drivers/common/iavf/iavf_osdep.h | 2 ++ drivers/common/iavf/virtchnl_inline_ipsec.h | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/common/iavf/iavf_osdep.h b/drivers/common/iavf/iavf_osdep.h index 263d924..1fb057c 100644 --- a/drivers/common/iavf/iavf_osdep.h +++ b/drivers/common/iavf/iavf_osdep.h @@ -158,6 +158,7 @@ } while (0) /* memory allocation tracking */ +__rte_msvc_pack struct iavf_dma_mem { void *va; u64 pa; @@ -165,6 +166,7 @@ struct iavf_dma_mem { const void *zone; } __rte_packed; +__rte_msvc_pack struct iavf_virt_mem { void *va; u32 size; diff --git a/drivers/common/iavf/virtchnl_inline_ipsec.h b/drivers/common/iavf/virtchnl_inline_ipsec.h index 2f4bf15..feb0f44 100644 --- a/drivers/common/iavf/virtchnl_inline_ipsec.h +++ b/drivers/common/iavf/virtchnl_inline_ipsec.h @@ -109,6 +109,7 @@ enum inline_ipsec_ops { }; /* Not all valid, if certain field is invalid, set 1 for all bits */ +__rte_msvc_pack struct virtchnl_algo_cap { u32 algo_type; @@ -132,6 +133,7 @@ struct virtchnl_algo_cap { } __rte_packed; /* vf record the capability of crypto from the virtchnl */ +__rte_msvc_pack struct virtchnl_sym_crypto_cap { u8 crypto_type; u8 algo_cap_num; @@ -142,6 +144,7 @@ struct virtchnl_sym_crypto_cap { * VF pass virtchnl_ipsec_cap to PF * and PF return capability of ipsec from virtchnl. */ +__rte_msvc_pack struct virtchnl_ipsec_cap { /* max number of SA per VF */ u16 max_sa_num; @@ -172,6 +175,7 @@ struct virtchnl_ipsec_cap { } __rte_packed; /* configuration of crypto function */ +__rte_msvc_pack struct virtchnl_ipsec_crypto_cfg_item { u8 crypto_type; @@ -203,6 +207,7 @@ struct virtchnl_ipsec_sym_crypto_cfg { * PF create SA as configuration and PF driver will return * an unique index (sa_idx) for the created SA. */ +__rte_msvc_pack struct virtchnl_ipsec_sa_cfg { /* IPsec SA Protocol - AH/ESP */ u8 virtchnl_protocol_type; @@ -298,6 +303,7 @@ struct virtchnl_ipsec_sa_cfg { * VF send configuration of index of SA to PF * PF will update SA according to configuration */ +__rte_msvc_pack struct virtchnl_ipsec_sa_update { u32 sa_index; /* SA to update */ u32 esn_hi; /* high 32 bits of esn */ @@ -310,6 +316,7 @@ struct virtchnl_ipsec_sa_update { * flag bitmap indicate all SA or just selected SA will * be destroyed */ +__rte_msvc_pack struct virtchnl_ipsec_sa_destroy { /* All zero bitmap indicates all SA will be destroyed. * Non-zero bitmap indicates the selected SA in @@ -325,6 +332,7 @@ struct virtchnl_ipsec_sa_destroy { * VF send this SA configuration to PF using virtchnl; * PF read SA and will return configuration for the created SA. */ +__rte_msvc_pack struct virtchnl_ipsec_sa_read { /* SA valid - invalid/valid */ u8 valid; @@ -431,6 +439,7 @@ struct virtchnl_ipsec_sa_read { #define VIRTCHNL_IPSEC_INBOUND_SPD_TBL_IPV6 (1) /* Add allowlist entry in IES */ +__rte_msvc_pack struct virtchnl_ipsec_sp_cfg { u32 spi; u32 dip[4]; @@ -459,6 +468,7 @@ struct virtchnl_ipsec_sp_cfg { /* Delete allowlist entry in IES */ +__rte_msvc_pack struct virtchnl_ipsec_sp_destroy { /* 0 for IPv4 table, 1 for IPv6 table. */ u8 table_id; @@ -494,6 +504,7 @@ struct virtchnl_ipsec_resp { }; /* Internal message descriptor for VF <-> IPsec communication */ +__rte_msvc_pack struct inline_ipsec_msg { u16 ipsec_opcode; u16 req_id;