From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50047.outbound.protection.outlook.com [40.107.5.47]) by dpdk.org (Postfix) with ESMTP id 8C4101B4F2 for ; Tue, 9 Oct 2018 13:26:58 +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=QsYHy3XfmrN/Xlnp2Fpo+FZi277H7DjyzHt+9JIz1Qk=; b=JZO/369kwfmxGNRPKQwdWaO4ggTnc2Xx2CchdJucvWQEoEDiiB5fv8srIJjaX2tpPHbi0uPcOCbKCpLEArBEhgHAJ+blP2VAxqlutnXDlvWT0fcgPWInr4JySUgJaNtU+kURl0bnsESAmWXmJZgXnVfTFqbenMoEh5Wqql5WrdE= 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; Tue, 9 Oct 2018 11:26:54 +0000 From: Shreyansh Jain To: ferruh.yigit@intel.com Cc: anatoly.burakov@intel.com, dev@dpdk.org, Shreyansh Jain Date: Tue, 9 Oct 2018 16:55:48 +0530 Message-Id: <20181009112548.7025-6-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181009112548.7025-1-shreyansh.jain@nxp.com> References: <20180925125423.7505-1-shreyansh.jain@nxp.com> <20181009112548.7025-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0097.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::13) To VI1PR04MB4686.eurprd04.prod.outlook.com (2603:10a6:803:71::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f91e3cc2-e381-4787-f946-08d62dda1e3f 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:rtue0GOrHXDCMkTd5bgH7Tn0ze3zOIrf07FtHmtl/Z0n5Q+vILOxvfWqCQoOQfXyB2q3KYf8aS+Ih9XttluZVzc0PL+5JjiPWTiAlX7mPpavUsKrRd43fD8KmVtLsxaGfZY+NGpDVbwmBVnRZadfpG/3pEFeIWZHvqkZmVOx7YaVM/nMhG/jPCAd56hqrSeMauAuDO/jG6wi8PIobigAnO9gA17WSqOe91GhKcxx/1m0cvBsMXqLsiReBpVSkCwV; 25:QVeQv/V3V8jk6LqrORCZQOtbOoLR9upWI9qQ3GySRL+wKLkMi78xwIZN5EAxZCewF0ns0SleGosHqbX4BbChr3vFPwPhPYv1Hl4xj4Dbml3/fLmbVE+KB7sGK/yRpgTqBZph84Q13E69Fgf20v/+MidizGEs2GNzKCqQosscOtZNmmuNHNhKtlZkMP5sFkMWUZX5B0ovlYs/dWecQ+Nmb/GADRZERWP9SGEVZLkWrssB+nOj5mAyTu9pE583juchRoxi3OO2T2lLODgAiLjpEgTFv+G/YEb6rwxlTaQgGvKOJ68a/YXREbbUBVfMjdN7bcC0g6GrrfR65BeU7a2QYg==; 31:DNiRwN07VT/O+Jk1y+UiS+OhnVCHWekvn43IoFY1o2WQOndlg970WVz/Lkiq6Aqr/GpWs6KULfvlpPCHa7ISu8RRLja0oHGDNgBC3GLTmb7buEEkJ2GwhdM+seGttJkJzWyR1oZLJ/rJVDt6BAL+LiZx7BNIj7sCSoX9S5RPQqwIaHWrb9M+isTkgfnH2VBMpEMqfD3r5uu6+3jP+dXfjwwmrVeKdbPsjbJLSR5fhds= X-MS-TrafficTypeDiagnostic: VI1PR04MB4686: X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4686; 20:ileQNyTic4vITEDeomx8+sOtVzI6uLeidD3OREAe6pqfB1szI7/LseCIQx3WnG01IT7SB92we3r6+c9Hrev29QFZGodDlf+Z+S1OnhRD5x8exWnKP2axZHjTwCjGdxKkSLyBJIbVelXMK8kHZpTfskaUMHhmM0/CDn9KVwZiT6PaijtWvLlzQch573Uz7ND8ONXEe7tyDBAD+h5xB+H6rJEF8BJR84nzGRQUrT+KgKujKDqtyOYWmLu36ylEnhbcVbSJj8QEDN9dE9vHEku5f9Ukdt1HCgzY5CHOaTfd8jsYdo17/EOpZkJGB+9Tb4nqVriF8EYAdgmpDK+kdjOt6nLb4+JHBjqIBbp8zLjV3NsUvysdGaTvQV3Mz/09KlT3CbRcHjPjkBvgBDn+OM6+htpFNOT4REYFWiCpSpQQOKQJR7vm8sV5IOeb+yJ0DrkT1l7MYhJ7xOJ4HmKDGlvjXBCAYfXiAWwzRqsjgDYgEZHCA4H+Ggm7g7V7LL0idiDN; 4:Bs2wYOAyNBqg0F2d4MylgNJ9lZ269WGeF1afSfLq409PV6LZb1SCYy+h3S02rfm4mieBsZDISY4SowxTqFN3YHuc6AMuc8qlx8Xy3NiJdY31ciQevi1n2ryqUHdYzD560d7WQeVEQbh2/cg6vMkGM8EMs8YVE3UdDd4voiuMk/zTZOnvMWL+tTROp/lc4z58h+2tKlmgmuIlu9zthACZ+UiW876p8dix2ia6CUJclVxKKcddSfdTosiO79E2l7nwbrDPihiyUhz0YbhnDb0kL39AVE9X1kxqMhe41yrRDPoeRnrzOMa5rNIqv4+sKjLEFvaCgudFD29pigAXMW++ORGDTmi11xDGJuLKC/d2Xso= 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)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:VI1PR04MB4686; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4686; X-Forefront-PRVS: 08200063E9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(346002)(366004)(396003)(136003)(199004)(189003)(2616005)(476003)(6486002)(446003)(1076002)(8676002)(25786009)(50226002)(81156014)(4326008)(81166006)(6512007)(956004)(97736004)(11346002)(386003)(55236004)(6506007)(86362001)(575784001)(68736007)(76176011)(50466002)(486006)(51416003)(14444005)(16526019)(8936002)(26005)(48376002)(44832011)(52116002)(53936002)(186003)(305945005)(5660300001)(478600001)(105586002)(7736002)(2906002)(6116002)(3846002)(106356001)(36756003)(47776003)(5009440100003)(2351001)(316002)(6666003)(66066001)(6916009)(2361001)(16586007)(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:tWhgJuOiWrnV2CdX8oAy+OfwCLfJVIY47S/6jfOy2?= =?us-ascii?Q?za75F5WyCg3l4cjil9IUbbEC/JjP2mULuIL4TVw0BdIRXnEmqUIPqZFSTGpV?= =?us-ascii?Q?g4RQUzocMVVC7xYVouilb7Vc7g/raBSkP7Mjayriru+D3xvlAjKYI/wyc9Z7?= =?us-ascii?Q?FixUI25ODvdVwr20YCKiSyhQw3jTSeACszGFGehrrqD3Vfp5f5kdulBVFJYY?= =?us-ascii?Q?9J43UM7T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Grer1DVYeEMcirETfLkOuyy8EO254tqbgKNS4KlH7wfq5bugJlXCRqMBHH8s6lA9AhxE7G9XQQi9GqAfiPadBRNY4Dbp5Hb37MJjt/8vUaG7O9Wed5br50KXc7lnHizThhg==; 5:GD7tqv3ybYQrZ4U2Tslt44CxCczWdnw8xNX1nqexj1BK8rFlleAFNpqNzNHF/F73bQuQIU7A+x5IykhbhlbPdhtXt6lGbt6++gez/0m99xwkfiGVduQwbmFsiQei5UBRQkVQNF5uNYv3PpbtjOahU5vAtDVpnaCm62jb+qR54xA=; 7:eFHCowakFkvvFUwy0uiPl413Id9i6oE1ukYb/aM031s9VIFQ7cLeIPAnc9d+HK/inRGW28ckrD0yWIp6XziLO7MsvFvk9+IoeIx+5Zt7qH45cMfkrjSK+IG+EDZ4GqdS3pimPy8CRBKYJ/IShjxp2BsDCST5MNEzlxdV/50Phwh+O1Jzc7wMF+ccebXgFqmV8cFTJycoLJLSVA2eqhjuMZ/m/UJVDUKvX7UOqE098A+BZW2vaOOTWKSAMDxm3q+d SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2018 11:26:54.3476 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f91e3cc2-e381-4787-f946-08d62dda1e3f 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 v2 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: Tue, 09 Oct 2018 11:26:58 -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 515d0f534..c5b580a4a 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 a4f9a9eee..b6e20144d 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" @@ -375,6 +377,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); @@ -454,6 +469,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 22a56a6fc..49d71d2ba 100644 --- a/drivers/bus/fslmc/meson.build +++ b/drivers/bus/fslmc/meson.build @@ -5,7 +5,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 15097995e..9ef18b78f 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -119,6 +119,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