From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20051.outbound.protection.outlook.com [40.107.2.51]) by dpdk.org (Postfix) with ESMTP id 170A46C9B for ; Sat, 13 Oct 2018 14:22:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CkEFTk3CP9AGVk3JE6vYupKgqjx+6KCsXKjlgw0iHbI=; b=nEcYtRABiA5oDQOPHW6X9eYSME4qTX88jGf2rAOgGTciHiVFvJTbc1IV4Du7Ra1zzs2GECg0fJAPBtFP+sIq7owTJqTn8c6lpB8Ye7wwbY1qB0qxgNCYyWQoFjWR8KOzZKXFqhXGUEMzvc0cXrlf7XnxtWPldI+SlVyVjzXojvg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by VI1PR04MB4686.eurprd04.prod.outlook.com (2603:10a6:803:71::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.27; Sat, 13 Oct 2018 12:22:21 +0000 From: Shreyansh Jain To: ferruh.yigit@intel.com, thomas@monjalon.net Cc: anatoly.burakov@intel.com, pbhagavatula@caviumnetworks.com, dev@dpdk.org, Shreyansh Jain Date: Sat, 13 Oct 2018 17:51:30 +0530 Message-Id: <20181013122130.22588-6-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181013122130.22588-1-shreyansh.jain@nxp.com> References: <20181009112548.7025-1-shreyansh.jain@nxp.com> <20181013122130.22588-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR0101CA0046.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::32) To VI1PR04MB4686.eurprd04.prod.outlook.com (2603:10a6:803:71::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c54e5d5a-4474-4d81-35d2-08d63106870f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4686; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4686; 3:m6eAE90Wgo3BqBjxl3FqmQxVv2pTIR9xhOpbRTly3uE1CT8poyRCKr80Oi6H7yjxt2NGBs4vc3tuuMSF061daFeRKjxcDoX1w9swLCml+J0FAfKRTwikB3rVsxcAo1gyJdU9MnxKSliXQti49b8UOtsBfBpB5Nc9sYIcaTcy3LaRkRogqxXY7CDUbfq8hYjUnO7K3rRgttnXGTAjLQghxjOL6z2B+zVmJPLvt0gru1pIPtNu2aV97L/8FAhROfAx; 25:3IQTLmpMH2z5yaSTCeC3vjVwgKCoR5Vc9rd2P7+gETzKozK5PMtOJs/XXw32iFl6qBbe23XcimU+XYnctKqhGc8hOmDKN0f61M9BPs1LBzpFp4Wnc2imrOEqoqDG0whTtFPYOr16aC+TK7QbCA1/z4Ye1gktuXhwNv2YWCHmViyv37ux/hKejN8Qe5fylqj/CYz3se9XYN8HT/b/O5MIiP2GquDrm1iYOjHchYW2eijGbPzjbz6m2IxMBJvQ14IoO1Nrf8iABHFwI33trpVEYeW5WsP3vLryZiC9e/iQjOlntLX1Ugzg61FY8yAaPI653Sr5NbatkqH7/GAcRMYDjw==; 31:J0Mii6HgL6n+bpkbkqOQGRTtvklzU3ZutpB8uqSKu7Tllsnc5T8biJjP5EfTv5KU8DtGuZ5svUmmkt9AxaBSSWe4FLCS6IU87nhhnI/vIsAZpAb8H1N9a7WI5uG2BqTIqECPdmeLJMeKNkZ4o0UcnWZDNpkvXbQOEnWpyNEuHyVa8UWOSwfuPoWeklML60aB+EEJnV/gbunD8F9XnkxM/MzDLm0VHLBGLZYnsWo+83o= X-MS-TrafficTypeDiagnostic: VI1PR04MB4686: X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4686; 20:SuRpLQdBedWxn2hd8oujFefimWmd3b7kud9rSC1fYPFjzxjMH5hZwA+oaI0y8Zql4PlcxLKT205fXL//XWtbLGc2MqI52aXzQYlm3vHbQe1IVZmYlR+O6qTR9H+eJC0KX4CiuXLKYFL0Q/403uaY3eBvZNG03LbE+TvooLHtWpd1CdDbBcbVa9y3NRio7wG30CREIRXjF7IEYlrYV1LnU8Z1OmHYL/fJOdn8RGpPfFOdc+NWSBA2WjFWSfkgrCNUufFh7jpeWA6Qjq9lA9KFKePZwXulc+UZSJa0TbsJHAzI9skIDCzfpNt38ufQU8iDMK8ZTxsv1IdJODrILlyFhUGNPrgGe+6tmKbiRSgwFmNDL9ujYt/Tb4HBtlJ5T6MPEAib7lCZhnxPJV0NgupYN0gE01eF9aj28Jz8BZjAppNYVG9DhUveYD4mZZsAvf4ecOfLqrtcB/NBzN9/QDJpeqzlAslT8oPL7c1xHufMlkjdNIzlHDZJrnDs/7IqHzrC; 4:irU3w/B3jPjJPOYBdGe5+sN1cD5EiXhvyxPJolw9RznvCb8vXwWsMZGaFzsddpSv05q14gixZBQMuVETykdAKL00OdDCaYRtRMHdlNIpMHahAeysSkzU1/hnrd3Aks7BK8q0LEdbi6U1NCpMrRFjF/WvIF+ujxFDuvDbFtYVU+Yzjqh9DP0vMQE0oGmy+Sg5Vgq5SCJvixja4E84Q8z4zq36mgSld66Mhp67BbitQIV/PJP5E9gzy8ZDxa0tM6NLfq6y1e5G0MBz8MjVm3QgHriAG1MfN21MQQPr1+c06JBoyqRJAMG5EvlHn8SW+sZ324cvD+ny9p/yHFA/DnDtfd8MW+QRmCivzadm7fnZBY0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699051); SRVR:VI1PR04MB4686; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4686; X-Forefront-PRVS: 082465FB26 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(396003)(346002)(376002)(366004)(199004)(189003)(6666004)(14444005)(36756003)(486006)(47776003)(11346002)(44832011)(476003)(956004)(6116002)(446003)(2616005)(106356001)(66066001)(1076002)(3846002)(16586007)(5660300001)(316002)(2906002)(1006002)(97736004)(478600001)(50226002)(25786009)(26005)(16526019)(186003)(6486002)(6512007)(8676002)(55236004)(4326008)(6506007)(8936002)(48376002)(50466002)(53936002)(68736007)(386003)(76176011)(52116002)(7736002)(105586002)(575784001)(305945005)(86362001)(81166006)(81156014)(51416003)(78486010)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4686; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB4686; 23:5Y/OwmvOKhQUJ3c2noisTksoA0ckhzi5zloV6B8lw?= =?us-ascii?Q?bZhIZSLkqvVxT2Pn4hRLGWwXsPP9sMQuugV+Of+IOqzy/RoxlzsAv+tbqk9K?= =?us-ascii?Q?WlWmj0BAKd105Z+X2c6QdMX4T6xTCKcMcMOZ4n5MreMjUA1Si1eWI1xI5qOS?= =?us-ascii?Q?kw7l4QJ/621kfW4B5QgHvdquM1VYxEX3SkFGulu12rG4JhxXq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3oz04wN8zWQ6D/UZpGcnognetL0YARcHsQA3ZF16GWl4NIrywT8DifLij/mdsscttftsfGL5rujioOECW55A/w2ksCMVP65EPfN7a8w8gfbJkO8udOQ46PCGwJ32h1gNLsNLW/Lz+xWsQ9FyYw==; 5:PGT+eGjd2udoetDGqM1XkREJjShJ1BfPC+s2kALQ/tX1hw/3nL92CAhU7oFVSk28HXEt8N4LTID5pNgZJ2EuMbA+gmhXOM5lWo3rVVOXy/JD5c32ox0xvgtHg3BkpXCFv5EYVPLMOh5IXE3oQhIhe5o1Xd6P6Qo5hUJ0s6m+2vc=; 7:lp6yGGmcggdejZ3ImvDIsyjlio5KBBt4jVkfA5q5rHIbJAZqefs8pL6Gbtwmk85So+o38hOJzSqMvszzxqbMq71F+EOUsRr0gtPPSokqdKeXRTJiRrh9QhzE/ypM8Pwkb6EOqgyQYdPkTIl+pNGqTAkl4wtBX4PGUJxqLWkHtmNGtM/s42ez1QbLZ4NrapjvbF1vxth9zavCfeqcVLSkOVtpN0duclXQYY4JXHLfFVQYn0Kn9VWh6YWT523bATOG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2018 12:22:21.1810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c54e5d5a-4474-4d81-35d2-08d63106870f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4686 Subject: [dpdk-dev] [PATCH v3 5/5] fslmc: enable dpaax library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Oct 2018 12:22:24 -0000 With this patch, fslmc bus and ethernet devices on this bus would start using the physical-virtual library interfaces. This patch impacts mempool/dpaa2, event/dpaa2, net/dpaa2, raw/dpaa2_cmdif and raw/dpaa2_qdma as they are dependent on the bus/fslmc and thus impact linkage of libraries. Signed-off-by: Shreyansh Jain --- drivers/bus/fslmc/Makefile | 1 + drivers/bus/fslmc/fslmc_bus.c | 20 ++++++++++++++++ drivers/bus/fslmc/meson.build | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 21 ++++++++--------- drivers/crypto/dpaa2_sec/Makefile | 1 + drivers/event/dpaa2/Makefile | 1 + drivers/mempool/dpaa2/Makefile | 1 + drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 29 ++++-------------------- drivers/net/dpaa2/Makefile | 1 + drivers/raw/dpaa2_cmdif/Makefile | 1 + drivers/raw/dpaa2_qdma/Makefile | 1 + mk/rte.app.mk | 1 + 12 files changed, 43 insertions(+), 37 deletions(-) diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile index e95551980..218d9bd28 100644 --- a/drivers/bus/fslmc/Makefile +++ b/drivers/bus/fslmc/Makefile @@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev +LDLIBS += -lrte_common_dpaax # versioning export map EXPORT_MAP := rte_bus_fslmc_version.map diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 19e33caf1..f2784ce51 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -20,6 +20,8 @@ #include #include "fslmc_logs.h" +#include + int dpaa2_logtype_bus; #define VFIO_IOMMU_GROUP_PATH "/sys/kernel/iommu_groups" @@ -377,6 +379,19 @@ rte_fslmc_probe(void) probe_all = rte_fslmc_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST; + /* In case of PA, the FD addresses returned by qbman APIs are physical + * addresses, which need conversion into equivalent VA address for + * rte_mbuf. For that, a table (a serial array, in memory) is used to + * increase translation efficiency. + * This has to be done before probe as some device initialization + * (during) probe allocate memory (dpaa2_sec) which needs to be pinned + * to this table. + */ + ret = dpaax_iova_table_populate(); + if (ret) { + DPAA2_BUS_WARN("PA->VA Translation table not available;"); + } + TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) { TAILQ_FOREACH(drv, &rte_fslmc_bus.driver_list, next) { ret = rte_fslmc_match(drv, dev); @@ -456,6 +471,11 @@ rte_fslmc_driver_unregister(struct rte_dpaa2_driver *driver) fslmc_bus = driver->fslmc_bus; + /* Cleanup the PA->VA Translation table; From whereever this function + * is called from. + */ + dpaax_iova_table_depopulate(); + TAILQ_REMOVE(&fslmc_bus->driver_list, driver, next); /* Update Bus references */ driver->fslmc_bus = NULL; diff --git a/drivers/bus/fslmc/meson.build b/drivers/bus/fslmc/meson.build index 54ca92d0c..18c45495b 100644 --- a/drivers/bus/fslmc/meson.build +++ b/drivers/bus/fslmc/meson.build @@ -7,7 +7,7 @@ if host_machine.system() != 'linux' build = false endif -deps += ['eventdev', 'kvargs'] +deps += ['common_dpaax', 'eventdev', 'kvargs'] sources = files('fslmc_bus.c', 'fslmc_vfio.c', 'mc/dpbp.c', diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 820759360..678ee34b8 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -9,6 +9,7 @@ #define _DPAA2_HW_PVT_H_ #include +#include #include #include @@ -275,28 +276,26 @@ extern struct dpaa2_memseg_list rte_dpaa2_memsegs; #ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA extern uint8_t dpaa2_virt_mode; static void *dpaa2_mem_ptov(phys_addr_t paddr) __attribute__((unused)); -/* todo - this is costly, need to write a fast coversion routine */ + static void *dpaa2_mem_ptov(phys_addr_t paddr) { - struct dpaa2_memseg *ms; + void *va; if (dpaa2_virt_mode) return (void *)(size_t)paddr; - /* Check if the address is already part of the memseg list internally - * maintained by the dpaa2 driver. - */ - TAILQ_FOREACH(ms, &rte_dpaa2_memsegs, next) { - if (paddr >= ms->iova && paddr < - ms->iova + ms->len) - return RTE_PTR_ADD(ms->vaddr, (uintptr_t)(paddr - ms->iova)); - } + va = (void *)dpaax_iova_table_get_va(paddr); + if (likely(va != NULL)) + return va; /* If not, Fallback to full memseg list searching */ - return rte_mem_iova2virt(paddr); + va = rte_mem_iova2virt(paddr); + + return va; } static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused)); + static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr) { const struct rte_memseg *memseg; diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile index da3d8f84f..1f951a14b 100644 --- a/drivers/crypto/dpaa2_sec/Makefile +++ b/drivers/crypto/dpaa2_sec/Makefile @@ -51,5 +51,6 @@ LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_mempool_dpaa2 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_cryptodev +LDLIBS += -lrte_common_dpaax include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/event/dpaa2/Makefile b/drivers/event/dpaa2/Makefile index 5e1a63200..7a71161de 100644 --- a/drivers/event/dpaa2/Makefile +++ b/drivers/event/dpaa2/Makefile @@ -21,6 +21,7 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal LDLIBS += -lrte_eal -lrte_eventdev LDLIBS += -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 LDLIBS += -lrte_bus_vdev +LDLIBS += -lrte_common_dpaax CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc diff --git a/drivers/mempool/dpaa2/Makefile b/drivers/mempool/dpaa2/Makefile index 9e4c87d79..0fc69c3bf 100644 --- a/drivers/mempool/dpaa2/Makefile +++ b/drivers/mempool/dpaa2/Makefile @@ -30,6 +30,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL) += dpaa2_hw_mempool.c LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_eal -lrte_mempool -lrte_ring +LDLIBS += -lrte_common_dpaax SYMLINK-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL)-include := rte_dpaa2_mempool.h diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index 84ff12811..c5f60c5c6 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -30,6 +30,8 @@ #include "dpaa2_hw_mempool.h" #include "dpaa2_hw_mempool_logs.h" +#include + struct dpaa2_bp_info rte_dpaa2_bpid_info[MAX_BPID]; static struct dpaa2_bp_list *h_bp_list; @@ -393,31 +395,8 @@ dpaa2_populate(struct rte_mempool *mp, unsigned int max_objs, void *vaddr, rte_iova_t paddr, size_t len, rte_mempool_populate_obj_cb_t *obj_cb, void *obj_cb_arg) { - struct dpaa2_memseg *ms; - - /* For each memory chunk pinned to the Mempool, a linked list of the - * contained memsegs is created for searching when PA to VA - * conversion is required. - */ - ms = rte_zmalloc(NULL, sizeof(struct dpaa2_memseg), 0); - if (!ms) { - DPAA2_MEMPOOL_ERR("Unable to allocate internal memory."); - DPAA2_MEMPOOL_WARN("Fast Physical to Virtual Addr translation would not be available."); - /* If the element is not added, it would only lead to failure - * in searching for the element and the logic would Fallback - * to traditional DPDK memseg traversal code. So, this is not - * a blocking error - but, error would be printed on screen. - */ - return 0; - } - - ms->vaddr = vaddr; - ms->iova = paddr; - ms->len = len; - /* Head insertions are generally faster than tail insertions as the - * buffers pinned are picked from rear end. - */ - TAILQ_INSERT_HEAD(&rte_dpaa2_memsegs, ms, next); + /* Insert entry into the PA->VA Table */ + dpaax_iova_table_update(paddr, vaddr, len); return rte_mempool_op_populate_default(mp, max_objs, vaddr, paddr, len, obj_cb, obj_cb_arg); diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index 9b0b14331..52649a945 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -40,5 +40,6 @@ LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_mempool_dpaa2 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs +LDLIBS += -lrte_common_dpaax include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/raw/dpaa2_cmdif/Makefile b/drivers/raw/dpaa2_cmdif/Makefile index 9b863dda2..3c56c4b44 100644 --- a/drivers/raw/dpaa2_cmdif/Makefile +++ b/drivers/raw/dpaa2_cmdif/Makefile @@ -21,6 +21,7 @@ LDLIBS += -lrte_eal LDLIBS += -lrte_kvargs LDLIBS += -lrte_mempool_dpaa2 LDLIBS += -lrte_rawdev +LDLIBS += -lrte_common_dpaax EXPORT_MAP := rte_pmd_dpaa2_cmdif_version.map diff --git a/drivers/raw/dpaa2_qdma/Makefile b/drivers/raw/dpaa2_qdma/Makefile index d88809ead..2f79a3f41 100644 --- a/drivers/raw/dpaa2_qdma/Makefile +++ b/drivers/raw/dpaa2_qdma/Makefile @@ -22,6 +22,7 @@ LDLIBS += -lrte_mempool LDLIBS += -lrte_mempool_dpaa2 LDLIBS += -lrte_rawdev LDLIBS += -lrte_ring +LDLIBS += -lrte_common_dpaax EXPORT_MAP := rte_pmd_dpaa2_qdma_version.map diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 85605e38e..f2218df39 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -121,6 +121,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_COMMON_DPAAX) += -lrte_common_dpaax _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA_MEMPOOL) += -lrte_mempool_dpaa endif ifeq ($(CONFIG_RTE_EAL_VFIO)$(CONFIG_RTE_LIBRTE_FSLMC_BUS),yy) +_LDLIBS-$(CONFIG_RTE_LIBRTE_COMMON_DPAAX) += -lrte_common_dpaax _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL) += -lrte_mempool_dpaa2 endif -- 2.17.1