From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6AAA443C8E; Tue, 12 Mar 2024 08:51:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 130AE402E6; Tue, 12 Mar 2024 08:51:52 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id C2C2A402E6 for ; Tue, 12 Mar 2024 08:51:50 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 174F920B74C4; Tue, 12 Mar 2024 00:51:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 174F920B74C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710229910; bh=2Y8fhp16FKui49ckXxrT6HSlKdL9mBzDBngBD6Y1UxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JCnYVqezyXnnZx1ZlbJ3cKMJcAbecXSeuPY6sph5+J1RonMy3AzLeOiA4R52dashv NcrwuIEMuu/gvy96Bbj1SDF+sAb9Cakm1T2y9silvCgNMH/IB7FjexLIP3g+2+XAom 0XKzfxqQa7ttHrzDXpyf4asMGzaQzOdUAH6CBGTo= From: Tyler Retzlaff To: dev@dpdk.org Cc: Dmitry Kozlyuk , Thomas Monjalon , Bruce Richardson , David Marchand , Tyler Retzlaff Subject: [PATCH 3/3] ethdev: import and export data variables for MSVC Date: Tue, 12 Mar 2024 00:51:48 -0700 Message-Id: <1710229908-31704-4-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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org MSVC requires that data variables be explicitly declared as either imported or exported. Provide macros that allow dpdk to correctly declare data variables as exported for itself and imported for applications. Use new per-library macro to declare variables exported or imported for per-lcore data variables. Signed-off-by: Tyler Retzlaff --- lib/ethdev/meson.build | 1 + lib/ethdev/rte_ethdev_core.h | 3 +++ lib/ethdev/rte_ethdev_export.h | 23 +++++++++++++++++++++++ lib/ethdev/version.map | 2 +- 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 lib/ethdev/rte_ethdev_export.h diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index f1d2586..b270e02 100644 --- a/lib/ethdev/meson.build +++ b/lib/ethdev/meson.build @@ -23,6 +23,7 @@ sources = files( headers = files( 'rte_cman.h', 'rte_ethdev.h', + 'rte_ethdev_export.h', 'rte_ethdev_trace_fp.h', 'rte_dev_info.h', 'rte_flow.h', diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h index e55fb42..4e7939f 100644 --- a/lib/ethdev/rte_ethdev_core.h +++ b/lib/ethdev/rte_ethdev_core.h @@ -16,6 +16,8 @@ * Applications should not use these directly. */ +#include + struct rte_eth_dev_callback; /** @internal Structure to keep track of registered callbacks */ RTE_TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback); @@ -126,6 +128,7 @@ struct __rte_cache_aligned rte_eth_fp_ops { }; +__rte_ethdev_export extern struct rte_eth_fp_ops rte_eth_fp_ops[RTE_MAX_ETHPORTS]; #endif /* _RTE_ETHDEV_CORE_H_ */ diff --git a/lib/ethdev/rte_ethdev_export.h b/lib/ethdev/rte_ethdev_export.h new file mode 100644 index 0000000..7887bee --- /dev/null +++ b/lib/ethdev/rte_ethdev_export.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Microsoft Corporation + */ + +#ifndef _RTE_ETHDEV_EXPORT_H_ +#define _RTE_ETHDEV_EXPORT_H_ + +/** + * @file + * + * Import / Export macros for ethdev data variables. + */ + +#include + +#ifndef __rte_ethdev_export +#define __rte_ethdev_export __rte_declare_import +#else +#undef __rte_ethdev_export +#define __rte_ethdev_export __rte_declare_export +#endif + +#endif diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 79f6f52..efe426f 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -83,7 +83,7 @@ DPDK_24 { rte_eth_find_next_of; rte_eth_find_next_owned_by; rte_eth_find_next_sibling; - rte_eth_fp_ops; + rte_eth_fp_ops; # MSVC_NO_EXPORT rte_eth_iterator_cleanup; rte_eth_iterator_init; rte_eth_iterator_next; -- 1.8.3.1