Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/138200/?format=api
http://patchwork.dpdk.org/api/patches/138200/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1710229908-31704-3-git-send-email-roretzla@linux.microsoft.com/", "project": { "id": 1, "url": "http://patchwork.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": "<1710229908-31704-3-git-send-email-roretzla@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1710229908-31704-3-git-send-email-roretzla@linux.microsoft.com", "date": "2024-03-12T07:51:47", "name": "[2/3] eal: import and export data variables for MSVC", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "43ec47e9c46d74d6cbdb5d88336ab6937b9434be", "submitter": { "id": 2077, "url": "http://patchwork.dpdk.org/api/people/2077/?format=api", "name": "Tyler Retzlaff", "email": "roretzla@linux.microsoft.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1710229908-31704-3-git-send-email-roretzla@linux.microsoft.com/mbox/", "series": [ { "id": 31470, "url": "http://patchwork.dpdk.org/api/series/31470/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31470", "date": "2024-03-12T07:51:48", "name": "RFC fix import/export MSVC data variables", "version": 1, "mbox": "http://patchwork.dpdk.org/series/31470/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/138200/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/138200/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 7E4E243C8E;\n\tTue, 12 Mar 2024 08:52:02 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7F5B040E78;\n\tTue, 12 Mar 2024 08:51:54 +0100 (CET)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id B565740282\n for <dev@dpdk.org>; Tue, 12 Mar 2024 08:51:50 +0100 (CET)", "by linux.microsoft.com (Postfix, from userid 1086)\n id 0A29820B74C3; Tue, 12 Mar 2024 00:51:49 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 0A29820B74C3", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1710229910;\n bh=INHMifypSW4i0apkPTNXJeg8/qtwK/Seo/PHx2L3heI=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=bl35pjS7BsIoGKFXHr++eoE87vgQcsLckjmaPJZrFCT3ufEGe45Z485QXAdShj1TZ\n nboBMQGP3MmbciSbxdOM5dKRqUm03TOzmZ6ikACzOBcvLYj9uP/3w0YoQ4x7GLVz3I\n J8Ws2Kuw5Oyo4gLI1r77oRWCASbHs/jWES0sCW7w=", "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>", "To": "dev@dpdk.org", "Cc": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Thomas Monjalon <thomas@monjalon.net>,\n Bruce Richardson <bruce.richardson@intel.com>,\n David Marchand <david.marchand@redhat.com>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>", "Subject": "[PATCH 2/3] eal: import and export data variables for MSVC", "Date": "Tue, 12 Mar 2024 00:51:47 -0700", "Message-Id": "<1710229908-31704-3-git-send-email-roretzla@linux.microsoft.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1710229908-31704-1-git-send-email-roretzla@linux.microsoft.com>", "References": "<1710229908-31704-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": "MSVC requires that data variables be explicitly declared as either\nimported or exported. Provide macros that allow dpdk to correctly\ndeclare data variables as exported for itself and imported for\napplications.\n\nUse new per-library macro to declare variables exported or imported for\nper-lcore data variables.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n lib/eal/include/meson.build | 1 +\n lib/eal/include/rte_common.h | 8 ++++++++\n lib/eal/include/rte_eal.h | 2 ++\n lib/eal/include/rte_eal_export.h | 23 +++++++++++++++++++++++\n lib/eal/include/rte_errno.h | 2 ++\n lib/eal/version.map | 6 +++---\n lib/meson.build | 2 ++\n 7 files changed, 41 insertions(+), 3 deletions(-)\n create mode 100644 lib/eal/include/rte_eal_export.h", "diff": "diff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build\nindex e94b056..376ae81 100644\n--- a/lib/eal/include/meson.build\n+++ b/lib/eal/include/meson.build\n@@ -16,6 +16,7 @@ headers += files(\n 'rte_dev.h',\n 'rte_devargs.h',\n 'rte_eal.h',\n+ 'rte_eal_export.h',\n 'rte_eal_memconfig.h',\n 'rte_eal_trace.h',\n 'rte_errno.h',\ndiff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h\nindex 298a5c6..ad80122 100644\n--- a/lib/eal/include/rte_common.h\n+++ b/lib/eal/include/rte_common.h\n@@ -26,6 +26,14 @@\n /* OS specific include */\n #include <rte_os.h>\n \n+#ifdef RTE_TOOLCHAIN_MSVC\n+#define __rte_declare_import __declspec(dllimport)\n+#define __rte_declare_export __declspec(dllexport)\n+#else\n+#define __rte_declare_import\n+#define __rte_declare_export\n+#endif\n+\n #ifndef RTE_TOOLCHAIN_MSVC\n #ifndef typeof\n #define typeof __typeof__\ndiff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h\nindex c2256f8..d0dc91b 100644\n--- a/lib/eal/include/rte_eal.h\n+++ b/lib/eal/include/rte_eal.h\n@@ -16,6 +16,7 @@\n \n #include <rte_config.h>\n #include <rte_compat.h>\n+#include <rte_eal_export.h>\n #include <rte_per_lcore.h>\n #include <rte_uuid.h>\n \n@@ -426,6 +427,7 @@ typedef int (*rte_mp_async_reply_t)(const struct rte_mp_msg *request,\n */\n int rte_sys_gettid(void);\n \n+__rte_eal_export\n RTE_DECLARE_PER_LCORE(int, _thread_id);\n \n /**\ndiff --git a/lib/eal/include/rte_eal_export.h b/lib/eal/include/rte_eal_export.h\nnew file mode 100644\nindex 0000000..3901760\n--- /dev/null\n+++ b/lib/eal/include/rte_eal_export.h\n@@ -0,0 +1,23 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2024 Microsoft Corporation\n+ */\n+\n+#ifndef _RTE_EAL_EXPORT_H_\n+#define _RTE_EAL_EXPORT_H_\n+\n+/**\n+ * @file\n+ *\n+ * Import / Export macros for eal data variables.\n+ */\n+\n+#include <rte_common.h>\n+\n+#ifndef __rte_eal_export\n+#define __rte_eal_export __rte_declare_import\n+#else\n+#undef __rte_eal_export\n+#define __rte_eal_export __rte_declare_export\n+#endif\n+\n+#endif\ndiff --git a/lib/eal/include/rte_errno.h b/lib/eal/include/rte_errno.h\nindex ba45591..311732f 100644\n--- a/lib/eal/include/rte_errno.h\n+++ b/lib/eal/include/rte_errno.h\n@@ -15,8 +15,10 @@\n extern \"C\" {\n #endif\n \n+#include <rte_eal_export.h>\n #include <rte_per_lcore.h>\n \n+__rte_eal_export\n RTE_DECLARE_PER_LCORE(int, _rte_errno); /**< Per core error number. */\n \n /**\ndiff --git a/lib/eal/version.map b/lib/eal/version.map\nindex c06ceaa..62914d2 100644\n--- a/lib/eal/version.map\n+++ b/lib/eal/version.map\n@@ -4,9 +4,9 @@ DPDK_24 {\n \t__rte_panic;\n \teal_parse_sysfs_value; # WINDOWS_NO_EXPORT\n \teal_timer_source; # WINDOWS_NO_EXPORT\n-\tper_lcore__lcore_id;\n-\tper_lcore__rte_errno;\n-\tper_lcore__thread_id;\n+\tper_lcore__lcore_id; # MSVC_NO_EXPORT\n+\tper_lcore__rte_errno; # MSVC_NO_EXPORT\n+\tper_lcore__thread_id; # MSVC_NO_EXPORT\n \trte_bus_dump;\n \trte_bus_find;\n \trte_bus_find_by_device;\ndiff --git a/lib/meson.build b/lib/meson.build\nindex f8836a4..f8d88d2 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -235,6 +235,8 @@ foreach l:libraries\n cflags += '-Wthread-safety'\n endif\n \n+ cflags += '-D__rte_@0@_export'.format(name)\n+\n # first build static lib\n static_lib = static_library(libname,\n sources,\n", "prefixes": [ "2/3" ] }{ "id": 138200, "url": "