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 9A72DA0508 for ; Wed, 13 Apr 2022 09:33:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8ECE24068B; Wed, 13 Apr 2022 09:33:49 +0200 (CEST) Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120095.outbound.protection.outlook.com [40.107.12.95]) by mails.dpdk.org (Postfix) with ESMTP id 7B900415D7; Mon, 11 Apr 2022 16:55:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lQ56VYWvb0hiXwjB4cdxKtdRJMXbU87jN2RkPQ+hh7XyKQgAGMJOl6G+geacd1TzHbaZ4e98FYkLcv7i2PZy6nwLMgoj/bAy3FnMzYQXjwM0Rb+0KenYG55gq9EIDQEFED4TSqFQ1+WQGucML+GdDU7ZiTZFH2SS/t8843rzuakssoNWCHTbEDjo3J7qhKZP2nXO9v650psF6CgQXZw9/oWEI5UforZUkRNFJNbSy6tA9otTkTBYSZz3sIYAiLxLseFVxk+pm+IdDAzfRzXPVqAVs1Y/Cy/rNh/imi2WTx13MEmbCOkvZ9/QbaV8rbk9aqKz4OddJJsqpKhVnAsHGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ra0CxRAbOLsjuBEkxFUMBBs4T6twxy7O6VsV9g1VZmw=; b=ICQuAtRBE3OmeRgupQV5pcouNXSWQe49Ow3HsZm9NsDCtPPhByFLi5KDkM4Cq/M8is7AZpkOaSeil8PC8NrlLfImz5BVN5xB24A2BTkt+JKgbzkpDBkqagDJrLDDaeplqiPOBf39SEREJ1w7ADqcjymBDD2Z2lc4QhJcei5FElyfDp07/ENPqpxUA/aVCLfamtSfHPTQ/xXaSp8PHhgwFL3SQ4724vh9Z9nPyOPOkhPa3sFZDD9V3UudYxQZvY2spq21qCf2u2801IOhWhDFu+0z0IqBPuSRoSMT/HE2JhGGMvCb/S2ZrXEScWvxBKVVNtp5qz7sR+v6/tKS8s+Ykw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ekinops.com; dmarc=pass action=none header.from=ekinops.com; dkim=pass header.d=ekinops.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ekinops.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ra0CxRAbOLsjuBEkxFUMBBs4T6twxy7O6VsV9g1VZmw=; b=g9Xt8VGEtleIeNwQ5gj6shLPW2rpBDJw8pNZyeVkplP4MH3Xa2HftoiB6UFkR5UrcpuYAYGKFzcOZaHTwqjHWHitaPhSP2qq/JLrbgpJWHvRi6h6E8IjgB99Tx60E9+CUh7ZrBRU94vrVOJBl9ZsciWnb0/pXoVo6SRlkqWswW4= Received: from PR1P264MB2030.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1b0::22) by PAZP264MB3749.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:12b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Mon, 11 Apr 2022 14:55:00 +0000 Received: from PR1P264MB2030.FRAP264.PROD.OUTLOOK.COM ([fe80::38d4:2647:f3af:9e57]) by PR1P264MB2030.FRAP264.PROD.OUTLOOK.COM ([fe80::38d4:2647:f3af:9e57%9]) with mapi id 15.20.5144.029; Mon, 11 Apr 2022 14:55:00 +0000 From: Abdelfattah Chehab To: "dev@dpdk.org" CC: "stable@dpdk.org" Subject: [PATCH] vmbus: get current rte_vmbus_bus struct Thread-Topic: [PATCH] vmbus: get current rte_vmbus_bus struct Thread-Index: AdhNs06mJ2zGT2tgQlyLgQGzR9HS6w== Date: Mon, 11 Apr 2022 14:54:59 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ekinops.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cefb48a6-b5a5-406a-5327-08da1bcb4079 x-ms-traffictypediagnostic: PAZP264MB3749:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: h3jARHTAOhyYJGKT1u+deZ5aD7hsDY4+Fo+FizyzI1z7ivDAixzOatApR/fLLaxLZO6iqDxXCKZtf0Ca+/5K//zzpBLL8D3dcsLY4uvv5Gpbr2H7j+UPoDGVTe2tU91ZkiYYm8A+Q27ZES0FXviweRQ28MKuX82kjlHkTyZXNrcE5tp4XoUri0vtFa/pxzQspVcHMYGneW5ZkOly9zJny3c2fqi5r7IrOfqU2n8+MVGVWzlOyizBVI2JInVsv+48nj4C3MUQLxKZt86Td6zTcOiBfiOZEqPWaMz/JsHKT0ptGNBSONWeoC5+oFC14egvj+2iPbR/qoNWGIyEmhvrLPwuAevfcCwx0VhIvvay+K01yq9w1tCma1+C7RD63J8AoersUjNV7AHHJaLaehulPrK8dUEIqpOWHt41/Dn2JI79uWwZfnnjAsZqXcApZVU4NCvu9mvcp6QRszZpxVX0yW5jhiy3eM4AEWvNZ0WoeqFDcQa5jTWXoYrWTdnFD8nELo/1wnw29N7oPMKVK6s6LG61n8JJw+w/rfOFESfaxI4JMJcPhTXyGXYiRPooMODfnfo/DORmcCX7jgxuVw9kDgPfFi0iS3gomtHEXI8H7oxbRZmOoKeF2uUDQZHOqAr2FnJSvsbqzl2AP7psE662l7REg/FfwV9Q7xhO38Bxy5Y+Jt+3MiVWsh6JzSa6UeNhpVxs70xuLbfEisgqAjJLgw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR1P264MB2030.FRAP264.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(366004)(5660300002)(6916009)(8676002)(2906002)(66946007)(8936002)(66476007)(66556008)(9326002)(76116006)(55016003)(122000001)(83380400001)(52536014)(86362001)(66446008)(316002)(38070700005)(7696005)(9686003)(6506007)(186003)(38100700002)(450100002)(4326008)(64756008)(71200400001)(26005)(508600001)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Xqzf5eK59pihrAjtnV0R304g7FzSGmC0vext87w2bSEiFzOY0DsjJxYC+DUP?= =?us-ascii?Q?idoaGlC3iQMz69DcMi3MfrlemWZeTfus0g8FOS2Tgx1flBx5MeuWTh4LVfEA?= =?us-ascii?Q?6MsV757dqAi3qoMex+xs5Yfpo7mSa6WRaNxTnmVkIA9k/XkqEUEJs9X3J3XO?= =?us-ascii?Q?n3l8D6U0/K3ropG1swxZ14LeE6xGEYElVcRUzdjDFywdsjWwewLEENdOdS1Y?= =?us-ascii?Q?EWYZ8key8ptb3s+W+paWcmoseifmuyoz7+TOmR9M9n/H2kDbS5tqMjmFIvxo?= =?us-ascii?Q?gwh83Ji3mo6mSDHYXz5pqEwkbJXCUjfNt3YXeG7JT3pLqhRNsQv7n4WUeCyh?= =?us-ascii?Q?gDoB80zIKA1q4HVXDqx3uRTjhFzC5wV6XlcElFAbSDelBZqGWto4uDWB9YQC?= =?us-ascii?Q?h8JjoJFxF/a3iXjNt941FL+ptCpLszufyIgpQ8rrCAAsrcUm1U84etpxoWrQ?= =?us-ascii?Q?CQz3gSimekNbPXvdUJMpOX/iI2+nLcysMUxOvfQA0znGQguw4PMGbBoHwXKv?= =?us-ascii?Q?TLx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uiILiKkewqZYAFyOUvg3WUVrVYd?= =?us-ascii?Q?71EhPKF+hnCF10kr2YObNkUBs6KyB+wUvTA446ucUmnuSHg7ioDAsab+lAH5?= =?us-ascii?Q?tbV5xiBMPs4ICXOfPI9wRE8e8B4HYa5nJmb7DJYpp9MmNyJtOJTnv4uM/ACu?= =?us-ascii?Q?bbWAMXbxu3jU3eSQPvIoom0xvlXC9BDYMa9jHRb3YDxRAasaGd3PjmCqrR5h?= =?us-ascii?Q?O0sKUkU//o/qvBJW/W7pIFUAtRQLecGp9ATB4yocQtphHdFKTWl2DBv9U/O+?= =?us-ascii?Q?NIc/lMwkZVKI94zqpXt4taZCArehBG1kISG5QBhkzFPek91gi/g0E4hKQTLV?= =?us-ascii?Q?nTsPMQ/sdhfEIS/g7T5hwJZyoyxtSmjgTK94p7L64kTthSnsGQQT?= Content-Type: multipart/alternative; boundary="_000_PR1P264MB2030EB80D45C19826E935ADFDFEA9PR1P264MB2030FRAP_" MIME-Version: 1.0 X-OriginatorOrg: ekinops.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PR1P264MB2030.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: cefb48a6-b5a5-406a-5327-08da1bcb4079 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2022 14:54:59.8944 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f57b78a6-c654-4771-a72f-837275f46179 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bFsOdEcLL25hWM8anr1X9ohVkhCvT/EgDKI2opYe5pOGBeRVuFBNtSlh75SWAS/ZawsFreu7R8GJ2LN7PJXGW8r6RshCRMhKFIN0aNb3wI+bI73j4dnHmQkJyN4+r+Ug X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAZP264MB3749 X-Mailman-Approved-At: Wed, 13 Apr 2022 09:33:48 +0200 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org --_000_PR1P264MB2030EB80D45C19826E935ADFDFEA9PR1P264MB2030FRAP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi All, FOREACH_DEVICE_ON_VMBUS needs rte_vmbus_bus to work on If static link to libdpdk.a : no issues If dynamic link to *.so: linker issue, global variable not found. I suggest this patch to get a current rte_vmbus_bus struct: Thanks. diff --git a/dpdk-20.11/drivers/bus/vmbus/rte_bus_vmbus.h b/dpdk-20.11/driv= ers/bus/vmbus/rte_bus_vmbus.h --- a/dpdk-20.11/drivers/bus/vmbus/rte_bus_vmbus.h +++ b/dpdk-20.11/drivers/bus/vmbus/rte_bus_vmbus.h @@ -414,6 +414,16 @@ } = \ RTE_PMD_EXPORT_NAME(nm, __COUNTER__) +/** + * Gets the global rte_vmbus_bus struct + * + * @param bus + * Pointer to rte_vmbus_bus structure. + * @return + * Return 0 if success. + */ +int rte_vmbus_get_bus(struct rte_vmbus_bus *bus); + #ifdef __cplusplus } #endif diff --git a/dpdk-20.11/drivers/bus/vmbus/version.map b/dpdk-20.11/drivers/= bus/vmbus/version.map --- a/dpdk-20.11/drivers/bus/vmbus/version.map +++ b/dpdk-20.11/drivers/bus/vmbus/version.map @@ -23,6 +23,7 @@ rte_vmbus_subchan_open; rte_vmbus_unmap_device; rte_vmbus_unregister; + rte_vmbus_get_bus; local: *; }; diff --git a/dpdk-20.11/drivers/bus/vmbus/vmbus_common.c b/dpdk-20.11/drive= rs/bus/vmbus/vmbus_common.c --- a/dpdk-20.11/drivers/bus/vmbus/vmbus_common.c +++ b/dpdk-20.11/drivers/bus/vmbus/vmbus_common.c @@ -25,6 +25,17 @@ extern struct rte_vmbus_bus rte_vmbus_bus; +/* Gets the global rte_vmbus_bus struct*/ +int rte_vmbus_get_bus(struct rte_vmbus_bus *bus){ + + if (!bus) + return 1; + + memcpy(bus, &rte_vmbus_bus, sizeof(struct rte_vmbus_bus)); + + return 0; +} + /* map a particular resource from a file */ void * vmbus_map_resource(void *requested_addr, int fd, off_t offset, size_t size, --_000_PR1P264MB2030EB80D45C19826E935ADFDFEA9PR1P264MB2030FRAP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi All,

FOREACH_DEVICE_ON_VMBUS needs rte_vmbus_bus to work = on

If static link to libdpdk.a : no issues

If dynamic link to *.so: linker issue, global variab= le not found.

 

I suggest this patch to get a current rte_vmbus_bus = struct:

Thanks.

 

 

diff --git a/dpdk-20.11/drivers/bus/vmbus/rte_bus_vm= bus.h b/dpdk-20.11/drivers/bus/vmbus/rte_bus_vmbus.h

--- a/dpdk-20.11/drivers/bus/vmbus/rte_bus_vmbus.h

+++ b/dpdk-20.11/drivers/bus/vmbus/rte_bus_vmbus.h

@@ -414,6 +414,16 @@

        &nbs= p;      }       = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            \<= /o:p>

        &nbs= p;      RTE_PMD_EXPORT_NAME(nm, __COUNTER__)<= /o:p>

+/**

+ * Gets the global rte_vmbus_bus struct<= /p>

+ *

+ * @param bus

+ *        &= nbsp; Pointer to rte_vmbus_bus structure.

+ * @return

+ *        &= nbsp; Return 0 if success.

+ */

+int rte_vmbus_get_bus(struct rte_vmbus_bus *bus);

+

#ifdef __cplusplus

}

#endif

diff --git a/dpdk-20.11/drivers/bus/vmbus/version.ma= p b/dpdk-20.11/drivers/bus/vmbus/version.map

--- a/dpdk-20.11/drivers/bus/vmbus/version.map<= /o:p>

+++ b/dpdk-20.11/drivers/bus/vmbus/version.map<= /o:p>

@@ -23,6 +23,7 @@

        &nbs= p;      rte_vmbus_subchan_open;

        &nbs= p;      rte_vmbus_unmap_device;

        &nbs= p;      rte_vmbus_unregister;

+        &nb= sp;    rte_vmbus_get_bus;

        &nbs= p;       local: *;

};

diff --git a/dpdk-20.11/drivers/bus/vmbus/vmbus_comm= on.c b/dpdk-20.11/drivers/bus/vmbus/vmbus_common.c

--- a/dpdk-20.11/drivers/bus/vmbus/vmbus_common.c

+++ b/dpdk-20.11/drivers/bus/vmbus/vmbus_common.c

@@ -25,6 +25,17 @@

 extern struct rte_vmbus_bus rte_vmbus_bus;

+/* Gets the global rte_vmbus_bus struct*/

+int rte_vmbus_get_bus(struct rte_vmbus_bus *bus){

+

+  if (!bus)

+    return 1;

+

+  memcpy(bus, &rte_vmbus_bus, sizeof(struc= t rte_vmbus_bus));

+

+  return 0;

+}

+

/* map a particular resource from a file */

void *

vmbus_map_resource(void *requested_addr, int fd, off= _t offset, size_t size,

--_000_PR1P264MB2030EB80D45C19826E935ADFDFEA9PR1P264MB2030FRAP_--