From patchwork Tue Apr 16 00:04:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139398 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 DDA1A43E80; Tue, 16 Apr 2024 02:05:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9217B402E4; Tue, 16 Apr 2024 02:05:17 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 96EE340293 for ; Tue, 16 Apr 2024 02:05:15 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id DC55520FD433; Mon, 15 Apr 2024 17:05:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DC55520FD433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225914; bh=Voq+F+SyxuZBC+ZYqhgF2Bm6b+40Msje8TCyGJ0TmoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XnULCzRl1QO9w8AwAyWbpsqFSPL8dg7g2AwTdINLM1WsLbQFTLy89GYrxo+Dnz7p8 aLwNVJwr9USGq69348CAFoRrxvA1oafBHvS8wjg3T/EJEEaSMigL4nNA5VrrkHBW/h lYmvVZZzkAG7lsGa/OV0B4Px3kVo/NkEvv1N5oak= 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 v4 01/16] eal: provide pack start macro for MSVC Date: Mon, 15 Apr 2024 17:04:58 -0700 Message-Id: <1713225913-20792-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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 MSVC struct packing is not compatible with GCC provide a macro that can be used to push existing pack value and sets packing to 1-byte. The existing __rte_packed macro is then used to restore the pack value prior to the push. Instead of providing macros exclusively for MSVC and for GCC the existing macro is deliberately utilized to trigger a warning if no existing packing has been pushed allowing easy identification of locations where the __rte_msvc_pack is missing. Signed-off-by: Tyler Retzlaff --- lib/eal/include/rte_common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index 298a5c6..44825ed 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -97,8 +97,10 @@ * Force a structure to be packed */ #ifdef RTE_TOOLCHAIN_MSVC -#define __rte_packed +#define __rte_msvc_pack __pragma(pack(push, 1)) +#define __rte_packed __pragma(pack(pop)) #else +#define __rte_msvc_pack #define __rte_packed __attribute__((__packed__)) #endif From patchwork Tue Apr 16 00:04:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139399 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 1B5C443E80; Tue, 16 Apr 2024 02:05:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE47040A4B; Tue, 16 Apr 2024 02:05:20 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A110F402E4 for ; Tue, 16 Apr 2024 02:05:15 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id EA50420FD436; Mon, 15 Apr 2024 17:05:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com EA50420FD436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225914; bh=kp0voLVlsgnm3SiFtSQj+udwRi2MiyRQcwM5S0HhLJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nHkmzXnspyP/oQZoGbuiag+mhSNmVYW+/zWN5Z2LIgOYwulkvFSoiZy+//G6EC81K uNw4vvCb+Bm6CBb6MIonD8swaLhzPXqx8sr9WWCOu9BgNV5/P+5auxvU9fmYZxRWFi T4OmeXopX//vL8smC6IxxPqQsTEn20+pYUKttTGs= 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 v4 02/16] eal: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:04:59 -0700 Message-Id: <1713225913-20792-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Remove __rte_packed where it appears natural alignment without packing would produce the same layout or the struct is internal. Signed-off-by: Tyler Retzlaff --- lib/eal/common/eal_private.h | 2 +- lib/eal/include/rte_memory.h | 1 + lib/eal/include/rte_memzone.h | 1 + lib/eal/include/rte_trace_point.h | 2 +- lib/eal/x86/include/rte_memcpy.h | 3 +++ 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h index 71523cf..4c929fb 100644 --- a/lib/eal/common/eal_private.h +++ b/lib/eal/common/eal_private.h @@ -62,7 +62,7 @@ struct rte_config { * DPDK instances */ struct rte_mem_config *mem_config; -} __rte_packed; +}; /** * Get the global configuration structure. diff --git a/lib/eal/include/rte_memory.h b/lib/eal/include/rte_memory.h index 842362d..73bb00d 100644 --- a/lib/eal/include/rte_memory.h +++ b/lib/eal/include/rte_memory.h @@ -46,6 +46,7 @@ /** * Physical memory segment descriptor. */ +__rte_msvc_pack struct rte_memseg { rte_iova_t iova; /**< Start IO address. */ union { diff --git a/lib/eal/include/rte_memzone.h b/lib/eal/include/rte_memzone.h index 931497f..ca312c0 100644 --- a/lib/eal/include/rte_memzone.h +++ b/lib/eal/include/rte_memzone.h @@ -45,6 +45,7 @@ * A structure describing a memzone, which is a contiguous portion of * physical memory identified by a name. */ +__rte_msvc_pack struct rte_memzone { #define RTE_MEMZONE_NAMESIZE 32 /**< Maximum length of memory zone name.*/ diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index 41e2a7f..e786ee3 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -297,7 +297,7 @@ struct __rte_trace_stream_header { rte_uuid_t uuid; uint32_t lcore_id; char thread_name[__RTE_TRACE_EMIT_STRING_LEN_MAX]; -} __rte_packed; +}; struct __rte_trace_header { uint32_t offset; diff --git a/lib/eal/x86/include/rte_memcpy.h b/lib/eal/x86/include/rte_memcpy.h index 72a9229..fdc5df0 100644 --- a/lib/eal/x86/include/rte_memcpy.h +++ b/lib/eal/x86/include/rte_memcpy.h @@ -57,12 +57,15 @@ * Use the following structs to avoid violating C standard * alignment requirements and to avoid strict aliasing bugs */ + __rte_msvc_pack struct rte_uint64_alias { uint64_t val; } __rte_packed __rte_may_alias; + __rte_msvc_pack struct rte_uint32_alias { uint32_t val; } __rte_packed __rte_may_alias; + __rte_msvc_pack struct rte_uint16_alias { uint16_t val; } __rte_packed __rte_may_alias; From patchwork Tue Apr 16 00:05:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139400 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 387C043E80; Tue, 16 Apr 2024 02:05:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CB8840A72; Tue, 16 Apr 2024 02:05:22 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A76CB402EC for ; Tue, 16 Apr 2024 02:05:15 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 0548020FD43A; Mon, 15 Apr 2024 17:05:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0548020FD43A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=a+PsRZzEH3bT/P2GtEDBunvC9BgIKXGNqgvC2OWKtkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rBecpqbBKjR2YVkcsHCZmizdUBpU3wxWR93SoRMHLBe7C+1isWO0LyawEKrGuJ7Y9 pqRu4j2bc+GvDVsZJ2GEzQ2q45tvrqzBrn0p+2Dd/tcs+b4b7KO/KkPv3F1KV+FqAD oUUhqPZt1HT/7GAuDJP8nrYdMk+qkNm1ZkG2Jqkk= 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 v4 03/16] net: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:00 -0700 Message-Id: <1713225913-20792-4-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- lib/net/rte_arp.h | 2 ++ lib/net/rte_dtls.h | 1 + lib/net/rte_esp.h | 2 ++ lib/net/rte_ether.h | 1 + lib/net/rte_geneve.h | 1 + lib/net/rte_gre.h | 4 ++++ lib/net/rte_gtp.h | 5 +++++ lib/net/rte_ib.h | 1 + lib/net/rte_icmp.h | 3 +++ lib/net/rte_ip.h | 4 ++++ lib/net/rte_l2tpv2.h | 4 ++++ lib/net/rte_macsec.h | 2 ++ lib/net/rte_mpls.h | 1 + lib/net/rte_pdcp_hdr.h | 4 ++++ lib/net/rte_ppp.h | 1 + lib/net/rte_sctp.h | 1 + lib/net/rte_tcp.h | 1 + lib/net/rte_tls.h | 1 + lib/net/rte_udp.h | 1 + lib/net/rte_vxlan.h | 2 ++ 20 files changed, 42 insertions(+) diff --git a/lib/net/rte_arp.h b/lib/net/rte_arp.h index 668cea1..35d68c1 100644 --- a/lib/net/rte_arp.h +++ b/lib/net/rte_arp.h @@ -21,6 +21,7 @@ /** * ARP header IPv4 payload. */ +__rte_msvc_pack struct __rte_aligned(2) rte_arp_ipv4 { struct rte_ether_addr arp_sha; /**< sender hardware address */ rte_be32_t arp_sip; /**< sender IP address */ @@ -31,6 +32,7 @@ struct __rte_aligned(2) rte_arp_ipv4 { /** * ARP header. */ +__rte_msvc_pack struct __rte_aligned(2) rte_arp_hdr { rte_be16_t arp_hardware; /**< format of hardware address */ #define RTE_ARP_HRD_ETHER 1 /**< ARP Ethernet address format */ diff --git a/lib/net/rte_dtls.h b/lib/net/rte_dtls.h index 4f541df..0c75b06 100644 --- a/lib/net/rte_dtls.h +++ b/lib/net/rte_dtls.h @@ -34,6 +34,7 @@ * DTLS Header */ __extension__ +__rte_msvc_pack struct rte_dtls_hdr { /** Content type of DTLS packet. Defined as RTE_DTLS_TYPE_*. */ uint8_t type; diff --git a/lib/net/rte_esp.h b/lib/net/rte_esp.h index 464c513..27c9287 100644 --- a/lib/net/rte_esp.h +++ b/lib/net/rte_esp.h @@ -20,6 +20,7 @@ /** * ESP Header */ +__rte_msvc_pack struct rte_esp_hdr { rte_be32_t spi; /**< Security Parameters Index */ rte_be32_t seq; /**< packet sequence number */ @@ -28,6 +29,7 @@ struct rte_esp_hdr { /** * ESP Trailer */ +__rte_msvc_pack struct rte_esp_tail { uint8_t pad_len; /**< number of pad bytes (0-255) */ uint8_t next_proto; /**< IPv4 or IPv6 or next layer header */ diff --git a/lib/net/rte_ether.h b/lib/net/rte_ether.h index 32ed515..354e3a5 100644 --- a/lib/net/rte_ether.h +++ b/lib/net/rte_ether.h @@ -301,6 +301,7 @@ struct __rte_aligned(2) rte_ether_hdr { * Contains the 16-bit VLAN Tag Control Identifier and the Ethernet type * of the encapsulated frame. */ +__rte_msvc_pack struct rte_vlan_hdr { rte_be16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */ rte_be16_t eth_proto; /**< Ethernet type of encapsulated frame. */ diff --git a/lib/net/rte_geneve.h b/lib/net/rte_geneve.h index 3bbc561..5c02526 100644 --- a/lib/net/rte_geneve.h +++ b/lib/net/rte_geneve.h @@ -38,6 +38,7 @@ * More-bits (optional) variable length options. */ __extension__ +__rte_msvc_pack struct rte_geneve_hdr { #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN uint8_t ver:2; /**< Version. */ diff --git a/lib/net/rte_gre.h b/lib/net/rte_gre.h index 8da8027..77882e7 100644 --- a/lib/net/rte_gre.h +++ b/lib/net/rte_gre.h @@ -27,6 +27,7 @@ * GRE Header */ __extension__ +__rte_msvc_pack struct rte_gre_hdr { #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN uint16_t res2:4; /**< Reserved */ @@ -51,6 +52,7 @@ struct rte_gre_hdr { /** * Optional field checksum in GRE header */ +__rte_msvc_pack struct rte_gre_hdr_opt_checksum_rsvd { rte_be16_t checksum; rte_be16_t reserved1; @@ -59,6 +61,7 @@ struct rte_gre_hdr_opt_checksum_rsvd { /** * Optional field key in GRE header */ +__rte_msvc_pack struct rte_gre_hdr_opt_key { rte_be32_t key; } __rte_packed; @@ -66,6 +69,7 @@ struct rte_gre_hdr_opt_key { /** * Optional field sequence in GRE header */ +__rte_msvc_pack struct rte_gre_hdr_opt_sequence { rte_be32_t sequence; } __rte_packed; diff --git a/lib/net/rte_gtp.h b/lib/net/rte_gtp.h index 9849872..26fc80a 100644 --- a/lib/net/rte_gtp.h +++ b/lib/net/rte_gtp.h @@ -28,6 +28,7 @@ * No optional fields and next extension header. */ __extension__ +__rte_msvc_pack struct rte_gtp_hdr { union { uint8_t gtp_hdr_info; /**< GTP header info */ @@ -55,6 +56,7 @@ struct rte_gtp_hdr { } __rte_packed; /* Optional word of GTP header, present if any of E, S, PN is set. */ +__rte_msvc_pack struct rte_gtp_hdr_ext_word { rte_be16_t sqn; /**< Sequence Number. */ uint8_t npdu; /**< N-PDU number. */ @@ -66,6 +68,7 @@ struct rte_gtp_hdr_ext_word { * defined based on RFC 38415-g30. */ __extension__ +__rte_msvc_pack struct rte_gtp_psc_generic_hdr { uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN @@ -89,6 +92,7 @@ struct rte_gtp_psc_generic_hdr { * type0 defined based on RFC 38415-g30 */ __extension__ +__rte_msvc_pack struct rte_gtp_psc_type0_hdr { uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN @@ -116,6 +120,7 @@ struct rte_gtp_psc_type0_hdr { * type1 defined based on RFC 38415-g30 */ __extension__ +__rte_msvc_pack struct rte_gtp_psc_type1_hdr { uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN diff --git a/lib/net/rte_ib.h b/lib/net/rte_ib.h index 9eab5f9..c4c5d39 100644 --- a/lib/net/rte_ib.h +++ b/lib/net/rte_ib.h @@ -26,6 +26,7 @@ * IB Specification Vol 1-Release-1.4. */ __extension__ +__rte_msvc_pack struct rte_ib_bth { uint8_t opcode; /**< Opcode. */ #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN diff --git a/lib/net/rte_icmp.h b/lib/net/rte_icmp.h index 4bf64d7..e865db4 100644 --- a/lib/net/rte_icmp.h +++ b/lib/net/rte_icmp.h @@ -25,6 +25,7 @@ /** * ICMP base header */ +__rte_msvc_pack struct rte_icmp_base_hdr { uint8_t type; uint8_t code; @@ -34,6 +35,7 @@ struct rte_icmp_base_hdr { /** * ICMP echo header */ +__rte_msvc_pack struct rte_icmp_echo_hdr { struct rte_icmp_base_hdr base; rte_be16_t identifier; @@ -45,6 +47,7 @@ struct rte_icmp_echo_hdr { * * @see rte_icmp_echo_hdr which is similar. */ +__rte_msvc_pack struct rte_icmp_hdr { uint8_t icmp_type; /* ICMP packet type. */ uint8_t icmp_code; /* ICMP packet code. */ diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h index 0d103d4..908a25c 100644 --- a/lib/net/rte_ip.h +++ b/lib/net/rte_ip.h @@ -38,6 +38,7 @@ /** * IPv4 Header */ +__rte_msvc_pack struct rte_ipv4_hdr { __extension__ union { @@ -523,6 +524,7 @@ struct rte_ipv4_hdr { /** * IPv6 Header */ +__rte_msvc_pack struct rte_ipv6_hdr { rte_be32_t vtc_flow; /**< IP version, traffic class & flow label. */ rte_be16_t payload_len; /**< IP payload size, including ext. headers */ @@ -538,6 +540,7 @@ struct rte_ipv6_hdr { /** * IPv6 Routing Extension Header */ +__rte_msvc_pack struct rte_ipv6_routing_ext { uint8_t next_hdr; /**< Protocol, next header. */ uint8_t hdr_len; /**< Header length. */ @@ -783,6 +786,7 @@ struct rte_ipv6_routing_ext { #define RTE_IPV6_SET_FRAG_DATA(fo, mf) \ (((fo) & RTE_IPV6_EHDR_FO_MASK) | ((mf) & RTE_IPV6_EHDR_MF_MASK)) +__rte_msvc_pack struct rte_ipv6_fragment_ext { uint8_t next_header; /**< Next header type */ uint8_t reserved; /**< Reserved */ diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h index 9cda347..a917013 100644 --- a/lib/net/rte_l2tpv2.h +++ b/lib/net/rte_l2tpv2.h @@ -129,6 +129,7 @@ struct rte_l2tpv2_common_hdr { * L2TPv2 message Header contains all options(length, ns, nr, * offset size, offset padding). */ +__rte_msvc_pack struct rte_l2tpv2_msg_with_all_options { rte_be16_t length; /**< length(16) */ rte_be16_t tunnel_id; /**< tunnel ID(16) */ @@ -143,6 +144,7 @@ struct rte_l2tpv2_msg_with_all_options { * L2TPv2 message Header contains all options except length(ns, nr, * offset size, offset padding). */ +__rte_msvc_pack struct rte_l2tpv2_msg_without_length { rte_be16_t tunnel_id; /**< tunnel ID(16) */ rte_be16_t session_id; /**< session ID(16) */ @@ -180,6 +182,7 @@ struct rte_l2tpv2_msg_without_offset { /** * L2TPv2 message Header contains options offset size and offset padding. */ +__rte_msvc_pack struct rte_l2tpv2_msg_with_offset { rte_be16_t tunnel_id; /**< tunnel ID(16) */ rte_be16_t session_id; /**< session ID(16) */ @@ -217,6 +220,7 @@ struct rte_l2tpv2_msg_without_all_options { /** * L2TPv2 Combined Message Header Format: Common Header + Options */ +__rte_msvc_pack struct rte_l2tpv2_combined_msg_hdr { struct rte_l2tpv2_common_hdr common; /**< common header */ union { diff --git a/lib/net/rte_macsec.h b/lib/net/rte_macsec.h index d0cd2f6..54de1bd 100644 --- a/lib/net/rte_macsec.h +++ b/lib/net/rte_macsec.h @@ -29,6 +29,7 @@ * MACsec Header (SecTAG) */ __extension__ +__rte_msvc_pack struct rte_macsec_hdr { /** * Tag control information and Association number of secure channel. @@ -52,6 +53,7 @@ struct rte_macsec_hdr { * MACsec SCI header (8 bytes) after the MACsec header * which is present if SC bit is set in tci_an. */ +__rte_msvc_pack struct rte_macsec_sci_hdr { uint8_t sci[RTE_MACSEC_SCI_LEN]; /**< Optional secure channel ID. */ } __rte_packed; diff --git a/lib/net/rte_mpls.h b/lib/net/rte_mpls.h index 51523e7..d5f6026 100644 --- a/lib/net/rte_mpls.h +++ b/lib/net/rte_mpls.h @@ -22,6 +22,7 @@ * MPLS header. */ __extension__ +__rte_msvc_pack struct rte_mpls_hdr { rte_be16_t tag_msb; /**< Label(msb). */ #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN diff --git a/lib/net/rte_pdcp_hdr.h b/lib/net/rte_pdcp_hdr.h index 72ae9a6..6a20ad9 100644 --- a/lib/net/rte_pdcp_hdr.h +++ b/lib/net/rte_pdcp_hdr.h @@ -60,6 +60,7 @@ enum rte_pdcp_pdu_type { * 6.2.2.1 Data PDU for SRBs */ __extension__ +__rte_msvc_pack struct rte_pdcp_cp_data_pdu_sn_12_hdr { #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN uint8_t sn_11_8 : 4; /**< Sequence number bits 8-11 */ @@ -75,6 +76,7 @@ struct rte_pdcp_cp_data_pdu_sn_12_hdr { * 6.2.2.2 Data PDU for DRBs and MRBs with 12 bits PDCP SN */ __extension__ +__rte_msvc_pack struct rte_pdcp_up_data_pdu_sn_12_hdr { #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN uint8_t sn_11_8 : 4; /**< Sequence number bits 8-11 */ @@ -92,6 +94,7 @@ struct rte_pdcp_up_data_pdu_sn_12_hdr { * 6.2.2.3 Data PDU for DRBs and MRBs with 18 bits PDCP SN */ __extension__ +__rte_msvc_pack struct rte_pdcp_up_data_pdu_sn_18_hdr { #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN uint8_t sn_17_16 : 2; /**< Sequence number bits 16-17 */ @@ -110,6 +113,7 @@ struct rte_pdcp_up_data_pdu_sn_18_hdr { * 6.2.3.1 Control PDU for PDCP status report */ __extension__ +__rte_msvc_pack struct rte_pdcp_up_ctrl_pdu_hdr { #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN uint8_t r : 4; /**< Reserved */ diff --git a/lib/net/rte_ppp.h b/lib/net/rte_ppp.h index 7b86ac4..fde585f 100644 --- a/lib/net/rte_ppp.h +++ b/lib/net/rte_ppp.h @@ -21,6 +21,7 @@ /** * PPP Header */ +__rte_msvc_pack struct rte_ppp_hdr { uint8_t addr; /**< PPP address(8) */ uint8_t ctrl; /**< PPP control(8) */ diff --git a/lib/net/rte_sctp.h b/lib/net/rte_sctp.h index 965682d..a6cfe8f 100644 --- a/lib/net/rte_sctp.h +++ b/lib/net/rte_sctp.h @@ -25,6 +25,7 @@ /** * SCTP Header */ +__rte_msvc_pack struct rte_sctp_hdr { rte_be16_t src_port; /**< Source port. */ rte_be16_t dst_port; /**< Destin port. */ diff --git a/lib/net/rte_tcp.h b/lib/net/rte_tcp.h index 506ac4e..d11cb2c 100644 --- a/lib/net/rte_tcp.h +++ b/lib/net/rte_tcp.h @@ -25,6 +25,7 @@ /** * TCP Header */ +__rte_msvc_pack struct rte_tcp_hdr { rte_be16_t src_port; /**< TCP source port. */ rte_be16_t dst_port; /**< TCP destination port. */ diff --git a/lib/net/rte_tls.h b/lib/net/rte_tls.h index 2eb3c6d..81af4c7 100644 --- a/lib/net/rte_tls.h +++ b/lib/net/rte_tls.h @@ -32,6 +32,7 @@ * TLS Header */ __extension__ +__rte_msvc_pack struct rte_tls_hdr { /** Content type of TLS packet. Defined as RTE_TLS_TYPE_*. */ uint8_t type; diff --git a/lib/net/rte_udp.h b/lib/net/rte_udp.h index 6135494..5416855 100644 --- a/lib/net/rte_udp.h +++ b/lib/net/rte_udp.h @@ -25,6 +25,7 @@ /** * UDP Header */ +__rte_msvc_pack struct rte_udp_hdr { rte_be16_t src_port; /**< UDP source port. */ rte_be16_t dst_port; /**< UDP destination port. */ diff --git a/lib/net/rte_vxlan.h b/lib/net/rte_vxlan.h index 997fc78..bcfd579 100644 --- a/lib/net/rte_vxlan.h +++ b/lib/net/rte_vxlan.h @@ -31,6 +31,7 @@ * Reserved fields (24 bits and 8 bits) */ __extension__ /* no named member in struct */ +__rte_msvc_pack struct rte_vxlan_hdr { union { struct { @@ -57,6 +58,7 @@ struct rte_vxlan_hdr { * Identifier and Reserved fields (16 bits and 8 bits). */ __extension__ /* no named member in struct */ +__rte_msvc_pack struct rte_vxlan_gpe_hdr { union { struct { From patchwork Tue Apr 16 00:05:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139401 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 BDA3F43E80; Tue, 16 Apr 2024 02:05:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA42540A81; Tue, 16 Apr 2024 02:05:23 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id BFBFE40647 for ; Tue, 16 Apr 2024 02:05:15 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 15E4520FD43F; Mon, 15 Apr 2024 17:05:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 15E4520FD43F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=6vAZIqm95iFE8Dig4Bc4UzirlaLEgn+OiNgyHbGfsyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CaA5XXfCvnOLsvrsf2Kz6jh5PPAPFkC51UEB1pYcxL1uue95CpDQFoCx+TICeSEhU J/DlCJXKLnKcJTKXrwhMd0mRIUNwYp9ierw1DMMLKL1jipPXwTuRp1ktmrL/eUV4jT LFb/Lt4X6B2QJCrObhvggCNyUglfM7F1DYcsjrTY= 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 v4 04/16] common/iavf: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:01 -0700 Message-Id: <1713225913-20792-5-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack 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; From patchwork Tue Apr 16 00:05:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139402 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 1EB3E43E80; Tue, 16 Apr 2024 02:05:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF17C40A6F; Tue, 16 Apr 2024 02:05:25 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 68D044027F for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 2402920FD440; Mon, 15 Apr 2024 17:05:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2402920FD440 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=18VQAH33g+/54Ox7ZJf5WMTkeQPEq8q+TfUaFJulH88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IJ/aHtTI7ax9K8BUBvbPOW1Dd8X6ZRDl0nseaaFm1J2W32wuCIejgd5nLZZBlf3ty FXnE/vj9gPQC9ACE/YQwXiEHhJgeNC2r15aK7peUTG4WEIvUwmClePnm/pBkw8a2gO wt71TTKcccAxAqT9ctrn06C+I/fOc40d3OM3vI9c= 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 v4 05/16] common/idpf: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:02 -0700 Message-Id: <1713225913-20792-6-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- drivers/common/idpf/base/idpf_osdep.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/common/idpf/base/idpf_osdep.h b/drivers/common/idpf/base/idpf_osdep.h index 74a376c..f5fcdc3 100644 --- a/drivers/common/idpf/base/idpf_osdep.h +++ b/drivers/common/idpf/base/idpf_osdep.h @@ -180,6 +180,7 @@ static inline uint64_t idpf_read_addr64(volatile void *addr) #define BITS_PER_BYTE 8 /* memory allocation tracking */ +__rte_msvc_pack struct idpf_dma_mem { void *va; u64 pa; @@ -187,6 +188,7 @@ struct idpf_dma_mem { const void *zone; } __rte_packed; +__rte_msvc_pack struct idpf_virt_mem { void *va; u32 size; From patchwork Tue Apr 16 00:05:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139403 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 1B13B43E80; Tue, 16 Apr 2024 02:05:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F24F340DF6; Tue, 16 Apr 2024 02:05:28 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 69A9340293 for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 336C020FD443; Mon, 15 Apr 2024 17:05:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 336C020FD443 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=pswuTHB8tOI4VzEoGoxKVDnljd+JDcT94yUxr73xshs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oUHl+A2LFgOsY1OnjkRAe3z85SMNyZsGXhJMQT0ndnegvPjpc/Y71zp+X4DyH1287 fNr7N6vgiHP0MlMZjCLUZKQu6yK3jW4gzeDEv+FnMfMwWsSfzq/kWmChg0/DISlpNr OC8owcAQORDqBQHP+HpBOf+LEPAW6OFZfPOrQFBk= 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 v4 06/16] common/mlx5: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:03 -0700 Message-Id: <1713225913-20792-7-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- drivers/common/mlx5/mlx5_common_mr.h | 4 ++++ drivers/common/mlx5/mlx5_common_utils.h | 1 + drivers/common/mlx5/mlx5_prm.h | 28 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h index 8789d40..4f4bd73 100644 --- a/drivers/common/mlx5/mlx5_common_mr.h +++ b/drivers/common/mlx5/mlx5_common_mr.h @@ -49,6 +49,7 @@ struct mlx5_mr { }; /* Cache entry for Memory Region. */ +__rte_msvc_pack struct mr_cache_entry { uintptr_t start; /* Start address of MR. */ uintptr_t end; /* End address of MR. */ @@ -56,6 +57,7 @@ struct mr_cache_entry { } __rte_packed; /* MR Cache table for Binary search. */ +__rte_msvc_pack struct mlx5_mr_btree { uint32_t len; /* Number of entries. */ uint32_t size; /* Total number of entries. */ @@ -65,6 +67,7 @@ struct mlx5_mr_btree { struct mlx5_common_device; /* Per-queue MR control descriptor. */ +__rte_msvc_pack struct mlx5_mr_ctrl { uint32_t *dev_gen_ptr; /* Generation number of device to poll. */ uint32_t cur_gen; /* Generation number saved to flush caches. */ @@ -78,6 +81,7 @@ struct mlx5_mr_ctrl { LIST_HEAD(mlx5_mempool_reg_list, mlx5_mempool_reg); /* Global per-device MR cache. */ +__rte_msvc_pack struct mlx5_mr_share_cache { uint32_t dev_gen; /* Generation number to flush local caches. */ rte_rwlock_t rwlock; /* MR cache Lock. */ diff --git a/drivers/common/mlx5/mlx5_common_utils.h b/drivers/common/mlx5/mlx5_common_utils.h index ae15119..a44975c 100644 --- a/drivers/common/mlx5/mlx5_common_utils.h +++ b/drivers/common/mlx5/mlx5_common_utils.h @@ -27,6 +27,7 @@ * Structure of the entry in the mlx5 list, user should define its own struct * that contains this in order to store the data. */ +__rte_msvc_pack struct mlx5_list_entry { LIST_ENTRY(mlx5_list_entry) next; /* Entry pointers in the list. */ uint32_t ref_cnt __rte_aligned(8); /* 0 means, entry is invalid. */ diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index c671c75..bf9ecd1 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -319,6 +319,7 @@ enum mlx5_mpw_mode { }; /* WQE Control segment. */ +__rte_msvc_pack struct mlx5_wqe_cseg { uint32_t opcode; uint32_t sq_ds; @@ -336,10 +337,12 @@ struct mlx5_wqe_cseg { #define WQE_CSEG_WQE_INDEX_OFFSET 8 /* Header of data segment. Minimal size Data Segment */ +__rte_msvc_pack struct mlx5_wqe_dseg { uint32_t bcount; union { uint8_t inline_data[MLX5_DSEG_MIN_INLINE_SIZE]; + __rte_msvc_pack struct { uint32_t lkey; uint64_t pbuf; @@ -348,8 +351,10 @@ struct mlx5_wqe_dseg { } __rte_packed; /* Subset of struct WQE Ethernet Segment. */ +__rte_msvc_pack struct mlx5_wqe_eseg { union { + __rte_msvc_pack struct { uint32_t swp_offs; uint8_t cs_flags; @@ -362,6 +367,7 @@ struct mlx5_wqe_eseg { uint16_t vlan_tag; }; } __rte_packed; + __rte_msvc_pack struct { uint32_t offsets; uint32_t flags; @@ -371,6 +377,7 @@ struct mlx5_wqe_eseg { }; } __rte_packed; +__rte_msvc_pack struct mlx5_wqe_qseg { uint32_t reserved0; uint32_t reserved1; @@ -378,6 +385,7 @@ struct mlx5_wqe_qseg { uint32_t qpn_cqn; } __rte_packed; +__rte_msvc_pack struct mlx5_wqe_wseg { uint32_t operation; uint32_t lkey; @@ -388,6 +396,7 @@ struct mlx5_wqe_wseg { } __rte_packed; /* The title WQEBB, header of WQE. */ +__rte_msvc_pack struct mlx5_wqe { union { struct mlx5_wqe_cseg cseg; @@ -437,6 +446,7 @@ struct mlx5_cqe { uint8_t lro_num_seg; union { uint8_t user_index_bytes[3]; + __rte_msvc_pack struct { uint8_t user_index_hi; uint16_t user_index_low; @@ -460,6 +470,7 @@ struct mlx5_cqe_ts { uint8_t op_own; }; +__rte_msvc_pack struct mlx5_wqe_rseg { uint64_t raddr; uint32_t rkey; @@ -479,6 +490,7 @@ struct mlx5_wqe_rseg { #define MLX5_UMR_KLM_NUM_ALIGN \ (MLX5_UMR_KLM_PTR_ALIGN / sizeof(struct mlx5_klm)) +__rte_msvc_pack struct mlx5_wqe_umr_cseg { uint32_t if_cf_toe_cq_res; uint32_t ko_to_bs; @@ -486,6 +498,7 @@ struct mlx5_wqe_umr_cseg { uint32_t rsvd1[8]; } __rte_packed; +__rte_msvc_pack struct mlx5_wqe_mkey_cseg { uint32_t fr_res_af_sf; uint32_t qpn_mkey; @@ -549,6 +562,7 @@ enum { #define MLX5_CRYPTO_MMO_TYPE_OFFSET 24 #define MLX5_CRYPTO_MMO_OP_OFFSET 20 +__rte_msvc_pack struct mlx5_wqe_umr_bsf_seg { /* * bs_bpt_eo_es contains: @@ -582,6 +596,7 @@ struct mlx5_wqe_umr_bsf_seg { #pragma GCC diagnostic ignored "-Wpedantic" #endif +__rte_msvc_pack struct mlx5_umr_wqe { struct mlx5_wqe_cseg ctr; struct mlx5_wqe_umr_cseg ucseg; @@ -592,18 +607,21 @@ struct mlx5_umr_wqe { }; } __rte_packed; +__rte_msvc_pack struct mlx5_rdma_write_wqe { struct mlx5_wqe_cseg ctr; struct mlx5_wqe_rseg rseg; struct mlx5_wqe_dseg dseg[]; } __rte_packed; +__rte_msvc_pack struct mlx5_wqe_send_en_seg { uint32_t reserve[2]; uint32_t sqnpc; uint32_t qpn; } __rte_packed; +__rte_msvc_pack struct mlx5_wqe_send_en_wqe { struct mlx5_wqe_cseg ctr; struct mlx5_wqe_send_en_seg sseg; @@ -650,6 +668,7 @@ struct mlx5_wqe_metadata_seg { uint64_t addr; }; +__rte_msvc_pack struct mlx5_gga_wqe { uint32_t opcode; uint32_t sq_ds; @@ -663,16 +682,19 @@ struct mlx5_gga_wqe { } __rte_packed; union mlx5_gga_compress_opaque { + __rte_msvc_pack struct { uint32_t syndrome; uint32_t reserved0; uint32_t scattered_length; union { + __rte_msvc_pack struct { uint32_t reserved1[5]; uint32_t crc32; uint32_t adler32; } v1 __rte_packed; + __rte_msvc_pack struct { uint32_t crc32; uint32_t adler32; @@ -685,9 +707,11 @@ struct mlx5_gga_wqe { }; union mlx5_gga_crypto_opaque { + __rte_msvc_pack struct { uint32_t syndrome; uint32_t reserved0[2]; + __rte_msvc_pack struct { uint32_t iv[3]; uint32_t tag_size; @@ -4134,6 +4158,7 @@ enum mlx5_aso_op { #define MLX5_ASO_CSEG_READ_ENABLE 1 /* ASO WQE CTRL segment. */ +__rte_msvc_pack struct mlx5_aso_cseg { uint32_t va_h; uint32_t va_l_r; @@ -4150,6 +4175,7 @@ struct mlx5_aso_cseg { #define MLX5_MTR_MAX_TOKEN_VALUE INT32_MAX /* A meter data segment - 2 per ASO WQE. */ +__rte_msvc_pack struct mlx5_aso_mtr_dseg { uint32_t v_bo_sc_bbog_mm; /* @@ -4191,6 +4217,7 @@ struct mlx5_aso_mtr_dseg { #define MLX5_ASO_MTRS_PER_POOL 128 /* ASO WQE data segment. */ +__rte_msvc_pack struct mlx5_aso_dseg { union { uint8_t data[MLX5_ASO_WQE_DSEG_SIZE]; @@ -4199,6 +4226,7 @@ struct mlx5_aso_dseg { } __rte_packed; /* ASO WQE. */ +__rte_msvc_pack struct mlx5_aso_wqe { struct mlx5_wqe_cseg general_cseg; struct mlx5_aso_cseg aso_cseg; From patchwork Tue Apr 16 00:05:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139404 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 0056343E80; Tue, 16 Apr 2024 02:05:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D648B40DFD; Tue, 16 Apr 2024 02:05:30 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 7D950402D9 for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 417B020FD446; Mon, 15 Apr 2024 17:05:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 417B020FD446 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=+DCFmFC0p4BvYipKFAowBHzeQu5qAkvNSo8caonnMQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fMFycqFuxCD7oAvregUca75m+kgQqcOdwjnlDiDrDlRX9XCbYUywtVks7CQyj2jMb YtlwqNwHN+gCnTMW0zwK8jSgbokWsQvHhgJeihD74srny/nyVnS+0nCGjlSl4LGZus cdkVeZMF7wPipDHYT7FaSS9xw/C225PG7XNpq39g= 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 v4 07/16] dma/ioat: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:04 -0700 Message-Id: <1713225913-20792-8-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- drivers/dma/ioat/ioat_hw_defs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/ioat/ioat_hw_defs.h b/drivers/dma/ioat/ioat_hw_defs.h index dc3493a..6e32807 100644 --- a/drivers/dma/ioat/ioat_hw_defs.h +++ b/drivers/dma/ioat/ioat_hw_defs.h @@ -52,6 +52,7 @@ #define IOAT_DMACAP_PQ (1 << 9) #define IOAT_DMACAP_DMA_DIF (1 << 10) +__rte_msvc_pack struct ioat_registers { uint8_t chancnt; uint8_t xfercap; From patchwork Tue Apr 16 00:05:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139405 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 2F82E43E80; Tue, 16 Apr 2024 02:06:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73F9140E28; Tue, 16 Apr 2024 02:05:32 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 84844402E4 for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 5020B20FD449; Mon, 15 Apr 2024 17:05:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5020B20FD449 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=Lohe1jDo/MQyN08PnzweNZees0BhXMCMN94sGcgU4Qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VtvkRN+3b28S258NaeqSI4taUnSzHUACMYHYec+JJkFWXdj9pFkGkqMCoPI/4D2F0 Gg6lw+ZlqIvTbaX2/Juifrx9sKg9DtkkNncbIhmamoUMvwAsJbBAzX6dTdEKI5BowF 1AWglUllhjS3de+O6G7OtYpJRIKlWlgsI5tz/Oy0= 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 v4 08/16] net/i40e: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:05 -0700 Message-Id: <1713225913-20792-9-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- drivers/net/i40e/base/i40e_osdep.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h index aa5dc61..28439e3 100644 --- a/drivers/net/i40e/base/i40e_osdep.h +++ b/drivers/net/i40e/base/i40e_osdep.h @@ -177,6 +177,7 @@ static inline uint64_t i40e_read64_addr(volatile void *addr) #define ARRAY_SIZE(arr) RTE_DIM(arr) /* memory allocation tracking */ +__rte_msvc_pack struct i40e_dma_mem { void *va; u64 pa; @@ -188,6 +189,7 @@ struct i40e_dma_mem { i40e_allocate_dma_mem_d(h, m, s, a) #define i40e_free_dma_mem(h, m) i40e_free_dma_mem_d(h, m) +__rte_msvc_pack struct i40e_virt_mem { void *va; u32 size; From patchwork Tue Apr 16 00:05:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139406 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 52E6243E80; Tue, 16 Apr 2024 02:06:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2DC0B40E5E; Tue, 16 Apr 2024 02:05:34 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 91828402EC for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 6159020FD44F; Mon, 15 Apr 2024 17:05:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6159020FD44F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=WUZbOPcJWk08yEc50WYAEvbOAiU4m221P9DNOD0uPCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GnwhnAbVi7PV7Ta51zGiXUOIXYRsj28pBNQXpAYrxia/qgjmxCx8xdqY6nMbbK0wE AkQjU9t+XB5X8CRdLaN6rnucSqNUszHKx+q7KMlFDuxCrOueeqGHSY7yNa3pvQ1lof g+VUVzaKoVcTHKqdsHi1ah5gBOwCUS3KGVFoXy14= 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 v4 09/16] net/iavf: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:06 -0700 Message-Id: <1713225913-20792-10-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Remove __rte_packed where it appears natural alignment without packing would produce the same layout or the struct is internal. Signed-off-by: Tyler Retzlaff --- drivers/net/iavf/iavf_ipsec_crypto.h | 4 +++- drivers/net/iavf/iavf_rxtx.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_ipsec_crypto.h b/drivers/net/iavf/iavf_ipsec_crypto.h index 49f9202..0637ce2 100644 --- a/drivers/net/iavf/iavf_ipsec_crypto.h +++ b/drivers/net/iavf/iavf_ipsec_crypto.h @@ -11,12 +11,14 @@ +__rte_msvc_pack struct iavf_tx_ipsec_desc { union { struct { __le64 qw0; __le64 qw1; }; + __rte_msvc_pack struct { __le16 l4payload_length; __le32 esn; @@ -97,7 +99,7 @@ struct iavf_ipsec_crypto_pkt_metadata { uint8_t next_proto; /* Next Protocol (8b/1B) */ uint32_t esn; /* Extended Sequence Number (32b/4B) */ -} __rte_packed; +}; /** * Inline IPsec Crypto offload is supported diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index 0a5246d..61309c3 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -53,7 +53,7 @@ struct simple_gre_hdr { uint16_t flags; uint16_t proto; -} __rte_packed; +}; /* structure that caches offload info for the current packet */ struct offload_info { From patchwork Tue Apr 16 00:05: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: 139408 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 CC7D943E80; Tue, 16 Apr 2024 02:06:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88B3E40E7C; Tue, 16 Apr 2024 02:05:37 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A5DF14067B for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 6EFF320FD452; Mon, 15 Apr 2024 17:05:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6EFF320FD452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=eULN58hi2akBv8ceqO90t3ezRRwV5T0hrnHSydsJNRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dslKCeYXsrAIWASmbxWpISDnMOf90YNA9Lyb2V8TDcIC1WpKEUoxfI1uR5fLL1Gnm xp4lYSr+gyH7/oGIGzEnI743VhhkGUyHJ/g3wYSiX8V8CSuUAiOJkSA/gOsE0DKlIj T1yaKENV3GdXKIFCWfhZCoevRuTA0KIMWftkDmy0= 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 v4 10/16] net/ice: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:07 -0700 Message-Id: <1713225913-20792-11-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- drivers/net/ice/base/ice_osdep.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h index 0e14b93..087dc6a 100644 --- a/drivers/net/ice/base/ice_osdep.h +++ b/drivers/net/ice/base/ice_osdep.h @@ -187,6 +187,7 @@ #define BITS_PER_BYTE 8 /* memory allocation tracking */ +__rte_msvc_pack struct ice_dma_mem { void *va; u64 pa; @@ -194,6 +195,7 @@ struct ice_dma_mem { const void *zone; } __rte_packed; +__rte_msvc_pack struct ice_virt_mem { void *va; u32 size; From patchwork Tue Apr 16 00:05:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139411 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 1E61443E80; Tue, 16 Apr 2024 02:06:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DFE240EF0; Tue, 16 Apr 2024 02:05:42 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A1C9740647 for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 7D98D20FD454; Mon, 15 Apr 2024 17:05:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7D98D20FD454 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=FwzU4Tynj385YOa5Ce/7bdtn47N8DAUvd61/GghvVvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n2s4ulTdxnz/PaXXVagpzPVdOJCIdIGVYgdJvgBmnV0QobtkBa4DjeTOt8uX1Smcf DpytYMoS5oCW51jkklXXjfqd4e61vJa4x8LrfJd6LwpV0faL2J3EVke9C8j1jR9jz0 bRoK2rpUzKIrZyjngpWxJ8JVsUg6dekHxI6eknKw= 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 v4 11/16] net/mlx5: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:08 -0700 Message-Id: <1713225913-20792-12-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- drivers/net/mlx5/hws/mlx5dr.h | 1 + drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.h | 5 +++++ drivers/net/mlx5/mlx5_hws_cnt.h | 1 + drivers/net/mlx5/mlx5_utils.h | 4 ++++ 5 files changed, 12 insertions(+) diff --git a/drivers/net/mlx5/hws/mlx5dr.h b/drivers/net/mlx5/hws/mlx5dr.h index 80e118a..cd5bb05 100644 --- a/drivers/net/mlx5/hws/mlx5dr.h +++ b/drivers/net/mlx5/hws/mlx5dr.h @@ -300,6 +300,7 @@ struct mlx5dr_action_dest_attr { }; }; +__rte_msvc_pack struct mlx5dr_crc_encap_entropy_hash_fields { union mlx5dr_crc_encap_entropy_hash_ip_field dst; union mlx5dr_crc_encap_entropy_hash_ip_field src; diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 0091a24..6228ee8 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -221,6 +221,7 @@ struct mlx5_dev_spawn_data { } /** Data associated with socket messages. */ +__rte_msvc_pack struct mlx5_flow_dump_req { uint32_t port_id; /**< There are plans in DPDK to extend port_id. */ uint64_t flow_id; diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 0065727..da0f8b7 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -658,6 +658,7 @@ struct mlx5_flow_dv_tag_resource { }; /* Modify resource structure */ +__rte_msvc_pack struct mlx5_flow_dv_modify_hdr_resource { struct mlx5_list_entry entry; void *action; /**< Modify header action object. */ @@ -812,6 +813,7 @@ struct mlx5_flow_dv_dest_array_resource { /** Device flow handle structure for DV mode only. */ +__rte_msvc_pack struct mlx5_flow_handle_dv { /* Flow DV api: */ struct mlx5_flow_dv_matcher *matcher; /**< Cache to matcher. */ @@ -830,6 +832,7 @@ struct mlx5_flow_handle_dv { } __rte_packed; /** Device flow handle structure: used both for creating & destroying. */ +__rte_msvc_pack struct mlx5_flow_handle { SILIST_ENTRY(uint32_t)next; struct mlx5_vf_vlan vf_vlan; /**< Structure for VF VLAN workaround. */ @@ -1231,6 +1234,7 @@ struct mlx5_flow_attr { }; /* Flow structure. */ +__rte_msvc_pack struct rte_flow { uint32_t dev_handles; /**< Device flow handles that are part of the flow. */ @@ -1304,6 +1308,7 @@ enum { #endif /** HWS flow struct. */ +__rte_msvc_pack struct rte_flow_hw { /** The table flow allcated from. */ struct rte_flow_template_table *table; diff --git a/drivers/net/mlx5/mlx5_hws_cnt.h b/drivers/net/mlx5/mlx5_hws_cnt.h index e005960..1f53a1a 100644 --- a/drivers/net/mlx5/mlx5_hws_cnt.h +++ b/drivers/net/mlx5/mlx5_hws_cnt.h @@ -133,6 +133,7 @@ enum { }; /* HWS counter age parameter. */ +__rte_msvc_pack struct mlx5_hws_age_param { uint32_t timeout; /* Aging timeout in seconds (atomically accessed). */ uint32_t sec_since_last_hit; diff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h index f3c0d76..cf80e5e 100644 --- a/drivers/net/mlx5/mlx5_utils.h +++ b/drivers/net/mlx5/mlx5_utils.h @@ -118,6 +118,7 @@ struct mlx5_l3t_level_tbl { }; /* L3 word entry table data structure. */ +__rte_msvc_pack struct mlx5_l3t_entry_word { uint32_t idx; /* Table index. */ uint64_t ref_cnt; /* Table ref_cnt. */ @@ -128,6 +129,7 @@ struct mlx5_l3t_entry_word { } __rte_packed; /* L3 double word entry table data structure. */ +__rte_msvc_pack struct mlx5_l3t_entry_dword { uint32_t idx; /* Table index. */ uint64_t ref_cnt; /* Table ref_cnt. */ @@ -138,6 +140,7 @@ struct mlx5_l3t_entry_dword { } __rte_packed; /* L3 quad word entry table data structure. */ +__rte_msvc_pack struct mlx5_l3t_entry_qword { uint32_t idx; /* Table index. */ uint64_t ref_cnt; /* Table ref_cnt. */ @@ -148,6 +151,7 @@ struct mlx5_l3t_entry_qword { } __rte_packed; /* L3 pointer entry table data structure. */ +__rte_msvc_pack struct mlx5_l3t_entry_ptr { uint32_t idx; /* Table index. */ uint64_t ref_cnt; /* Table ref_cnt. */ From patchwork Tue Apr 16 00:05:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139407 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 41F1443E80; Tue, 16 Apr 2024 02:06:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1DAD40EA5; Tue, 16 Apr 2024 02:05:35 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id AB16140684 for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8BA0820FD456; Mon, 15 Apr 2024 17:05:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8BA0820FD456 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=TNHiLBZWGgCg+96u8CBxVkroSguQhhykExAYYcSZrv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DA4FP45vYBmShYNHurkK+EsKocYTITIM54GvdSc7ZDHO7ktel3sfEVnWY2o1/nCv+ fI+htxK5rrBGs77scrLcIloVIwO+YGJhAfnDXd6XPHc/CjxKbAxix0vV6OvsVEZ/MB hNDNNyrtlJUH7Qw0eRhfly65M4LVCo55W6/f+0rI= 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 v4 12/16] net/octeon_ep: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:09 -0700 Message-Id: <1713225913-20792-13-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- drivers/net/octeon_ep/otx_ep_mbox.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/octeon_ep/otx_ep_mbox.h b/drivers/net/octeon_ep/otx_ep_mbox.h index a3fc15c..005fce3 100644 --- a/drivers/net/octeon_ep/otx_ep_mbox.h +++ b/drivers/net/octeon_ep/otx_ep_mbox.h @@ -70,6 +70,7 @@ enum otx_ep_link_autoneg { #define OTX_EP_MBOX_MORE_FRAG_FLAG 1 #define OTX_EP_MBOX_WRITE_WAIT_TIME msecs_to_jiffies(1) +__rte_msvc_pack union otx_ep_mbox_word { uint64_t u64; struct { From patchwork Tue Apr 16 00:05:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139409 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 C983043E80; Tue, 16 Apr 2024 02:06:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C1A340EE2; Tue, 16 Apr 2024 02:05:39 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id B60AF40689 for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 9A4EA20FD45B; Mon, 15 Apr 2024 17:05:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9A4EA20FD45B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=fTpGz0owsMziUVv/1k4uD9EhUOqUwQpJqd1z5dQpBCo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aYYT84R9UKb3T6k3pbf0ASU9b/qo6Tl4vaZddBRvJrGNpfY5+1Q2HC8YI45Qdkk3H Aedt8H9TNyUzFx9SYwbVsuCqf/isup/fJE/gEhTv9d01ZVzA2iT2Z9cKFAsZ8YDFsm ecQWgBWJZiZBhqxMMbPkiYaM3dSWz5KJ+lCudzGU= 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 v4 13/16] app/testpmd: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:10 -0700 Message-Id: <1713225913-20792-14-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Remove __rte_packed where it appears natural alignment without packing would produce the same layout or the struct is internal. Signed-off-by: Tyler Retzlaff --- app/test-pmd/csumonly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 6711dda..f24c381 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -92,7 +92,7 @@ struct testpmd_offload_info { struct simple_gre_hdr { uint16_t flags; uint16_t proto; -} __rte_packed; +}; static uint16_t get_udptcp_checksum(struct rte_mbuf *m, void *l3_hdr, uint16_t l4_off, From patchwork Tue Apr 16 00:05:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139410 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 9CF0043E80; Tue, 16 Apr 2024 02:06:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5247D40F35; Tue, 16 Apr 2024 02:05:40 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id BBDDD40691 for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id A912520FD460; Mon, 15 Apr 2024 17:05:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A912520FD460 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=8pPmE8g6BWRwhjE28M/qsiqDl8hWRd/fIeIpPIuJxdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XBIU1PZEtde1ELB3DDT76WWe5YKdxQoldm7PJe9dmCp9QsyJxo3z06Fsz8EJKzHtt 3dcQe4xLFmZ1iSB82s9d3jZi9mZEBLx3JfSCO/Ozg07bS1/OHqT83jakPaPQc3pWNW uDZtpvo5dW8v+7kxasECcbaMxQRO/GvNDA7xP3Bg= 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 v4 14/16] app/test: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:11 -0700 Message-Id: <1713225913-20792-15-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- app/test/test_efd.c | 1 + app/test/test_hash.c | 1 + app/test/test_member.c | 1 + 3 files changed, 3 insertions(+) diff --git a/app/test/test_efd.c b/app/test/test_efd.c index 1c0986b..df176a0 100644 --- a/app/test/test_efd.c +++ b/app/test/test_efd.c @@ -33,6 +33,7 @@ static unsigned int test_socket_id; /* 5-tuple key type */ +__rte_msvc_pack struct flow_key { uint32_t ip_src; uint32_t ip_dst; diff --git a/app/test/test_hash.c b/app/test/test_hash.c index d586878..08c1773 100644 --- a/app/test/test_hash.c +++ b/app/test/test_hash.c @@ -79,6 +79,7 @@ * Should be packed to avoid holes with potentially * undefined content in the middle. */ +__rte_msvc_pack struct flow_key { uint32_t ip_src; uint32_t ip_dst; diff --git a/app/test/test_member.c b/app/test/test_member.c index 5a4d275..ccd481a 100644 --- a/app/test/test_member.c +++ b/app/test/test_member.c @@ -32,6 +32,7 @@ struct rte_member_setsum *setsum_sketch; /* 5-tuple key type */ +__rte_msvc_pack struct flow_key { uint32_t ip_src; uint32_t ip_dst; From patchwork Tue Apr 16 00:05:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139412 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 23AFE43E80; Tue, 16 Apr 2024 02:06:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3B1C40E96; Tue, 16 Apr 2024 02:05:43 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id DF5A04027F for ; Tue, 16 Apr 2024 02:05:16 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id B71C320FD463; Mon, 15 Apr 2024 17:05:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B71C320FD463 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=1L1f/WbzBRlO5juzTnvoc0NadRn8LVJ/ugRGM7ikz9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NKepIjAk+ywFz0w5EH7fp9FwTJH+T5rJ8/rH6U2kEzT9aTW3uaNeE2ynZEp361vIM ri0E+iRiI9q1Ez6BhBN47c7rZ8Q5Ru5tVhRuNNKLK6NVbv1FEJORivdJy5P05p3AN5 zd1QGInJ/OMnODyDuhlvf5P4Hisnz6Od52/nBvAA= 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 v4 15/16] examples: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:12 -0700 Message-Id: <1713225913-20792-16-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Remove __rte_packed where it appears natural alignment without packing would produce the same layout or the struct is internal. Signed-off-by: Tyler Retzlaff --- examples/common/neon/port_group.h | 1 + examples/ip_pipeline/cli.c | 10 +++++----- examples/ipsec-secgw/ipsec.h | 1 + examples/l3fwd-power/main.c | 2 ++ examples/ptpclient/ptpclient.c | 8 ++++++++ 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/examples/common/neon/port_group.h b/examples/common/neon/port_group.h index 421e2e8..bd40590 100644 --- a/examples/common/neon/port_group.h +++ b/examples/common/neon/port_group.h @@ -21,6 +21,7 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1, uint16x8_t dp2) { + __rte_msvc_pack union { uint16_t u16[FWDSTEP + 1]; uint64_t u64; diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index e8269ea..aad6c78 100644 --- a/examples/ip_pipeline/cli.c +++ b/examples/ip_pipeline/cli.c @@ -2571,7 +2571,7 @@ struct pkt_key_qinq { uint16_t svlan; uint16_t ethertype_cvlan; uint16_t cvlan; -} __rte_packed; +}; struct pkt_key_ipv4_5tuple { uint8_t time_to_live; @@ -2581,7 +2581,7 @@ struct pkt_key_ipv4_5tuple { uint32_t da; uint16_t sp; uint16_t dp; -} __rte_packed; +}; struct pkt_key_ipv6_5tuple { uint16_t payload_length; @@ -2591,15 +2591,15 @@ struct pkt_key_ipv6_5tuple { uint8_t da[16]; uint16_t sp; uint16_t dp; -} __rte_packed; +}; struct pkt_key_ipv4_addr { uint32_t addr; -} __rte_packed; +}; struct pkt_key_ipv6_addr { uint8_t addr[16]; -} __rte_packed; +}; static uint32_t parse_match(char **tokens, diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h index bdcada1..bdc6045 100644 --- a/examples/ipsec-secgw/ipsec.h +++ b/examples/ipsec-secgw/ipsec.h @@ -277,6 +277,7 @@ struct socket_ctx { struct rte_mempool *session_pool; }; +__rte_msvc_pack struct cnt_blk { uint32_t salt; uint64_t iv; diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index f4adcf4..a3be37b 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -278,6 +278,7 @@ struct lcore_rx_queue { #define DEFAULT_HASH_FUNC rte_jhash #endif +__rte_msvc_pack struct ipv4_5tuple { uint32_t ip_dst; uint32_t ip_src; @@ -286,6 +287,7 @@ struct ipv4_5tuple { uint8_t proto; } __rte_packed; +__rte_msvc_pack struct ipv6_5tuple { uint8_t ip_dst[IPV6_ADDR_LEN]; uint8_t ip_src[IPV6_ADDR_LEN]; diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index afb61bb..cdd73fd 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -56,6 +56,7 @@ }; /* Structs used for PTP handling. */ +__rte_msvc_pack struct tstamp { uint16_t sec_msb; uint32_t sec_lsb; @@ -66,11 +67,13 @@ struct clock_id { uint8_t id[8]; }; +__rte_msvc_pack struct port_id { struct clock_id clock_id; uint16_t port_number; } __rte_packed; +__rte_msvc_pack struct ptp_header { uint8_t msg_type; uint8_t ver; @@ -86,22 +89,26 @@ struct ptp_header { int8_t log_message_interval; } __rte_packed; +__rte_msvc_pack struct sync_msg { struct ptp_header hdr; struct tstamp origin_tstamp; } __rte_packed; +__rte_msvc_pack struct follow_up_msg { struct ptp_header hdr; struct tstamp precise_origin_tstamp; uint8_t suffix[]; } __rte_packed; +__rte_msvc_pack struct delay_req_msg { struct ptp_header hdr; struct tstamp origin_tstamp; } __rte_packed; +__rte_msvc_pack struct delay_resp_msg { struct ptp_header hdr; struct tstamp rx_tstamp; @@ -110,6 +117,7 @@ struct delay_resp_msg { } __rte_packed; struct ptp_message { + __rte_msvc_pack union { struct ptp_header header; struct sync_msg sync; From patchwork Tue Apr 16 00:05:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 139413 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 0BBC943E80; Tue, 16 Apr 2024 02:06:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4440A410ED; Tue, 16 Apr 2024 02:05:45 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 43DAD40293 for ; Tue, 16 Apr 2024 02:05:17 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id C571220FD465; Mon, 15 Apr 2024 17:05:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C571220FD465 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713225915; bh=sQpgLLMo/2qH43FrQcVHGP74Lt/JDda3MDs1PW3BJac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R36lc1YPYwPl1c5Ut0AAGsvjZelf2sWR2KowGDNcbRY6LqmzgVu/C5OwAO9J9evdL +6Jv7n3gjzAmUeqf5FiBFydQEBku/vC05mk81hwzpA+RlbYrir9NuK33lt0Uz4GWDk oMfRGCIfROkMr01ayrngk/s96zIot6asbeQT61lc= 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 v4 16/16] crypto/mlx5: pack structures when building with MSVC Date: Mon, 15 Apr 2024 17:05:13 -0700 Message-Id: <1713225913-20792-17-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713225913-20792-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1713225913-20792-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_pack to all __rte_packed structs to cause packing when building with MSVC. Signed-off-by: Tyler Retzlaff --- drivers/crypto/mlx5/mlx5_crypto.h | 1 + drivers/crypto/mlx5/mlx5_crypto_gcm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/crypto/mlx5/mlx5_crypto.h b/drivers/crypto/mlx5/mlx5_crypto.h index 36dacdc..3b4916d 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.h +++ b/drivers/crypto/mlx5/mlx5_crypto.h @@ -95,6 +95,7 @@ struct mlx5_crypto_devarg_params { uint32_t is_aes_gcm:1; }; +__rte_msvc_pack struct mlx5_crypto_session { union { /**< AES-XTS configuration. */ diff --git a/drivers/crypto/mlx5/mlx5_crypto_gcm.c b/drivers/crypto/mlx5/mlx5_crypto_gcm.c index fc6ade6..9a2c438 100644 --- a/drivers/crypto/mlx5/mlx5_crypto_gcm.c +++ b/drivers/crypto/mlx5/mlx5_crypto_gcm.c @@ -62,6 +62,7 @@ struct mlx5_crypto_gcm_data { uint32_t dst_mkey; }; +__rte_msvc_pack struct mlx5_crypto_gcm_tag_cpy_info { void *digest; uint8_t tag_len;