Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/138936/?format=api
http://patches.dpdk.org/api/patches/138936/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1711580958-20808-16-git-send-email-roretzla@linux.microsoft.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1711580958-20808-16-git-send-email-roretzla@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1711580958-20808-16-git-send-email-roretzla@linux.microsoft.com", "date": "2024-03-27T23:09:18", "name": "[v2,15/15] examples: pack structures when building with MSVC", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "5620aa8d478cd872c8bc8bab3872fa2aa50e4dd4", "submitter": { "id": 2077, "url": "http://patches.dpdk.org/api/people/2077/?format=api", "name": "Tyler Retzlaff", "email": "roretzla@linux.microsoft.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1711580958-20808-16-git-send-email-roretzla@linux.microsoft.com/mbox/", "series": [ { "id": 31634, "url": "http://patches.dpdk.org/api/series/31634/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31634", "date": "2024-03-27T23:09:03", "name": "fix packing of structs when building with MSVC", "version": 2, "mbox": "http://patches.dpdk.org/series/31634/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/138936/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/138936/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C133943D5B;\n\tThu, 28 Mar 2024 00:10:47 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9D44642DCE;\n\tThu, 28 Mar 2024 00:09:42 +0100 (CET)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id AB228410FD\n for <dev@dpdk.org>; Thu, 28 Mar 2024 00:09:21 +0100 (CET)", "by linux.microsoft.com (Postfix, from userid 1086)\n id 13C0220E6AE7; Wed, 27 Mar 2024 16:09:19 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 13C0220E6AE7", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1711580960;\n bh=IiLvykGt2iCEyJSJ5MTAhrQafAxWQvwwTxjRVRlQqWg=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=aJMuJsjjWkSGfXqR7ZxLiQhSoZ7soum1BEuXN2NVWilCrylFSaiMoo8xDR1YhjjQX\n 3oyynVNEFXujeWJzIqtL+8tNe94DgScV7+ltDD7JrLleHqS8a4BLm3Gu4pY8CdDlrZ\n O8W22QclCGQLZVzxZMuJe97AfsPEINougJE++8UA=", "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>", "To": "dev@dpdk.org", "Cc": "Akhil Goyal <gakhil@marvell.com>, Aman Singh <aman.deep.singh@intel.com>,\n Anatoly Burakov <anatoly.burakov@intel.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Byron Marohn <byron.marohn@intel.com>, Conor Walsh <conor.walsh@intel.com>,\n Cristian Dumitrescu <cristian.dumitrescu@intel.com>,\n Dariusz Sosnowski <dsosnowski@nvidia.com>,\n David Hunt <david.hunt@intel.com>, Jerin Jacob <jerinj@marvell.com>,\n Jingjing Wu <jingjing.wu@intel.com>,\n Kirill Rybalchenko <kirill.rybalchenko@intel.com>,\n Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,\n Matan Azrad <matan@nvidia.com>, Ori Kam <orika@nvidia.com>,\n Radu Nicolau <radu.nicolau@intel.com>, Ruifeng Wang <ruifeng.wang@arm.com>,\n Sameh Gobriel <sameh.gobriel@intel.com>,\n Sivaprasad Tummala <sivaprasad.tummala@amd.com>,\n Suanming Mou <suanmingm@nvidia.com>, Sunil Kumar Kori <skori@marvell.com>,\n Vamsi Attunuru <vattunuru@marvell.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>,\n Yipeng Wang <yipeng1.wang@intel.com>,\n Yuying Zhang <Yuying.Zhang@intel.com>,\n Yuying Zhang <yuying.zhang@intel.com>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>", "Subject": "[PATCH v2 15/15] examples: pack structures when building with MSVC", "Date": "Wed, 27 Mar 2024 16:09:18 -0700", "Message-Id": "<1711580958-20808-16-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>\n <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 <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Add __rte_msvc_pushpack(1) to all __rte_packed structs to cause packing\nwhen building with MSVC.\n\nRemove __rte_packed where it appears natural alignment without\npacking would produce the same layout or the struct is internal.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n examples/common/neon/port_group.h | 1 +\n examples/ip_pipeline/cli.c | 10 +++++-----\n examples/ipsec-secgw/ipsec.h | 1 +\n examples/l3fwd-power/main.c | 2 ++\n examples/ptpclient/ptpclient.c | 8 ++++++++\n 5 files changed, 17 insertions(+), 5 deletions(-)", "diff": "diff --git a/examples/common/neon/port_group.h b/examples/common/neon/port_group.h\nindex 421e2e8..bd40590 100644\n--- a/examples/common/neon/port_group.h\n+++ b/examples/common/neon/port_group.h\n@@ -21,6 +21,7 @@\n port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1,\n \t\t uint16x8_t dp2)\n {\n+\t__rte_msvc_pack\n \tunion {\n \t\tuint16_t u16[FWDSTEP + 1];\n \t\tuint64_t u64;\ndiff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c\nindex e8269ea..aad6c78 100644\n--- a/examples/ip_pipeline/cli.c\n+++ b/examples/ip_pipeline/cli.c\n@@ -2571,7 +2571,7 @@ struct pkt_key_qinq {\n \tuint16_t svlan;\n \tuint16_t ethertype_cvlan;\n \tuint16_t cvlan;\n-} __rte_packed;\n+};\n \n struct pkt_key_ipv4_5tuple {\n \tuint8_t time_to_live;\n@@ -2581,7 +2581,7 @@ struct pkt_key_ipv4_5tuple {\n \tuint32_t da;\n \tuint16_t sp;\n \tuint16_t dp;\n-} __rte_packed;\n+};\n \n struct pkt_key_ipv6_5tuple {\n \tuint16_t payload_length;\n@@ -2591,15 +2591,15 @@ struct pkt_key_ipv6_5tuple {\n \tuint8_t da[16];\n \tuint16_t sp;\n \tuint16_t dp;\n-} __rte_packed;\n+};\n \n struct pkt_key_ipv4_addr {\n \tuint32_t addr;\n-} __rte_packed;\n+};\n \n struct pkt_key_ipv6_addr {\n \tuint8_t addr[16];\n-} __rte_packed;\n+};\n \n static uint32_t\n parse_match(char **tokens,\ndiff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h\nindex bdcada1..bdc6045 100644\n--- a/examples/ipsec-secgw/ipsec.h\n+++ b/examples/ipsec-secgw/ipsec.h\n@@ -277,6 +277,7 @@ struct socket_ctx {\n \tstruct rte_mempool *session_pool;\n };\n \n+__rte_msvc_pack\n struct cnt_blk {\n \tuint32_t salt;\n \tuint64_t iv;\ndiff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c\nindex f4adcf4..a3be37b 100644\n--- a/examples/l3fwd-power/main.c\n+++ b/examples/l3fwd-power/main.c\n@@ -278,6 +278,7 @@ struct lcore_rx_queue {\n #define DEFAULT_HASH_FUNC rte_jhash\n #endif\n \n+__rte_msvc_pack\n struct ipv4_5tuple {\n \tuint32_t ip_dst;\n \tuint32_t ip_src;\n@@ -286,6 +287,7 @@ struct ipv4_5tuple {\n \tuint8_t proto;\n } __rte_packed;\n \n+__rte_msvc_pack\n struct ipv6_5tuple {\n \tuint8_t ip_dst[IPV6_ADDR_LEN];\n \tuint8_t ip_src[IPV6_ADDR_LEN];\ndiff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c\nindex afb61bb..cdd73fd 100644\n--- a/examples/ptpclient/ptpclient.c\n+++ b/examples/ptpclient/ptpclient.c\n@@ -56,6 +56,7 @@\n };\n \n /* Structs used for PTP handling. */\n+__rte_msvc_pack\n struct tstamp {\n \tuint16_t sec_msb;\n \tuint32_t sec_lsb;\n@@ -66,11 +67,13 @@ struct clock_id {\n \tuint8_t id[8];\n };\n \n+__rte_msvc_pack\n struct port_id {\n \tstruct clock_id clock_id;\n \tuint16_t port_number;\n } __rte_packed;\n \n+__rte_msvc_pack\n struct ptp_header {\n \tuint8_t msg_type;\n \tuint8_t ver;\n@@ -86,22 +89,26 @@ struct ptp_header {\n \tint8_t log_message_interval;\n } __rte_packed;\n \n+__rte_msvc_pack\n struct sync_msg {\n \tstruct ptp_header hdr;\n \tstruct tstamp origin_tstamp;\n } __rte_packed;\n \n+__rte_msvc_pack\n struct follow_up_msg {\n \tstruct ptp_header hdr;\n \tstruct tstamp precise_origin_tstamp;\n \tuint8_t suffix[];\n } __rte_packed;\n \n+__rte_msvc_pack\n struct delay_req_msg {\n \tstruct ptp_header hdr;\n \tstruct tstamp origin_tstamp;\n } __rte_packed;\n \n+__rte_msvc_pack\n struct delay_resp_msg {\n \tstruct ptp_header hdr;\n \tstruct tstamp rx_tstamp;\n@@ -110,6 +117,7 @@ struct delay_resp_msg {\n } __rte_packed;\n \n struct ptp_message {\n+\t__rte_msvc_pack\n \tunion {\n \t\tstruct ptp_header header;\n \t\tstruct sync_msg sync;\n", "prefixes": [ "v2", "15/15" ] }{ "id": 138936, "url": "