From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70071.outbound.protection.outlook.com [40.107.7.71]) by dpdk.org (Postfix) with ESMTP id 5C7E71B17A for ; Tue, 25 Sep 2018 14:55:31 +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=T0unqp9AS5YGSq9jjLcz1Fl7sLVTvLaqfAJOy+s9oe4=; b=hRpO5FWm+614QB1E1Fi+z9sVHe0I6+KMIMVkVO6wyFORns5kJWZTfVefqMGrvU1j3NHh8Kzw9wNgQ0prVK8yUTAXILvRB4122pbJCv1alHVPqXn4Fss2IB+bQ5QfLThKOmeTYEVkLaC+aVjn+d5YED/bwk/ALu1J2IswhOI14Ho= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Tue, 25 Sep 2018 12:55:27 +0000 From: Shreyansh Jain To: ferruh.yigit@intel.com Cc: dev@dpdk.org, anatoly.burakov@intel.com, Shreyansh Jain Date: Tue, 25 Sep 2018 18:24:23 +0530 Message-Id: <20180925125423.7505-6-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925125423.7505-1-shreyansh.jain@nxp.com> References: <20180925125423.7505-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: TYAPR01CA0123.jpnprd01.prod.outlook.com (2603:1096:404:2d::15) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eaac4bfe-cecb-46b5-8f93-08d622e62c1d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:6rGVPPmEVWmZ/+o+u+4mxQWyaqPRcQ38lAyDeYyV78LDKMbtLOC8hheH5l6LUkfOKcPNZQ+eUY3TLow9w8sXmeXx7xXL0xWVmRmbxN8LagkE1fu6DVZ+/dEjozcS9u+NR/lGLAix0iwCFDyfK+XH+IZNtDNjFqAzu3oGhbReKH6ZW9RvLZvD9tmDsOiUhdy5BmJB1rKzzIWPTeH7Mz+LAKbDvVu1BJVpBeO79JB5LO1IfAqiXvC94yZ0fWqybzmP; 25:Qcpn0pP/TZ2FQAtutgK4aEG82IcCJeX6cCeWZu8Kwgv2bxwkPyR8Enm1efYXhOR8gj0bYmG98dqFanTOxpMk8UWfdCxGNLRELm91X32x1A3bMo2jy0qttRifiD7qwh3CDBeBMyIbPIObRJ1qOFoSbZoW0HqLvAiOfEG1AP3XPy8ctK3bDDYBipfvvSFCHyrtkSGugjzbsqT51xpcAHPWYlYibCvEESFxzSRVZ9wqFIpbKyoYvkpXZziImsGNOiEsfS5B0Oigw/iEnepQzTPoFmpv2W//hciRrp2OlrBoqWvOMxF7EYMyZ2GWP61+6IucVFZTJzHEyJdxWOkBIRe9pA==; 31:t1PlgseKVdZSHePQHMEvhcFtdbQvKN1pxQmHGaPLSOx1wqe70yKyYRGEOPbZglSVUOsSJXDYa01Npj5toRnIjY9cJxDsrCRxnVYIl3toPB0hm5DnTASd8qjpdMsJpNHfTehmiqeGTKmQX+ChDXdEjgOW88sSMliJ7soaGIOCnpiyaOWRWlKNUI74H9jxDiHy1qNtsCdhLEjRMon6UjsEc/wf9zSWmDjeldf1VSjShEk= X-MS-TrafficTypeDiagnostic: AM0PR04MB4676: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 20:N/YRnOWIut9BIthYL4jp3WL4KT6T7hz7aerwoa1k77ooXNgaIwyNUmJjsFiJUT/JrqIPS5ktot2xGvWT//3Xj/io1fYXzNjAA/YAd3OqTlRXX91BkY8mmTr7OPWGNSAPG1zbl8OE2jSvhIxp0X+MyDucpIaeWBrE+kTLKIPHz+VGUIOMoM+rPjirF7wjCS3SeFR16kM9h/cjzs0qJODbzV2bZq5Hs1DwDjK+VZNBaqHlCA4eE4vc9RFPhg8I3cUr+f1KpJXfUMvrNU18ef6kOUrp07R9k+kOftVCK/o6rh3RVXqNY4kOXVZedBh0g16VUqPnDHrrNQYhFdfV4vAh5B7WzPtOse6qDGzIQF4BoQquy/IuX9mjORvpcgwyPDvSpHP5PgI1bPyrGWMGpgxwAaFGosvR4TtQkcfAsK06zxXxn2GP4boYgi/i/MS2U1FZem9ytxnJX5VY887msS1wT0nycaMluTeaOjP5ZMe2W1V/7tfU+wJu37FvpoPIlo1F; 4:eRSdrV+qOm+kxMpE+Uj518KRl4yfJ9rep6Ck3tYoAXjeD/FhMvBG+Lb/Fx1IHqD0cPN+whBdbel2YqGiijl+L6iFFhB4uMEWFNKAWMyKitUZRjujAFHlh23Ybp68GK5IuW7VPiDzLETfSDns16sw4jycF73N45ak60N8VLBwRre3uy6+jvF1Y8AdLO9DyPJQvIHBwwP6Fda33kKU7mDxiHjMw9CKwzNOIFKTd0uDgzqMRuHz8n1H50BMO4k3gE+XJD8XZovQjiBm91JIkCTYhZ+9Y8Y7IrbV3A09h307XQJGtOSpki4xKXPe+bi/jL3f9oRKcaBzbI8cqwJcwloZnXd/QNn/nk66nodJGESrWCM= 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)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 08062C429B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(136003)(346002)(39860400002)(396003)(189003)(199004)(2616005)(5660300001)(48376002)(478600001)(8676002)(11346002)(575784001)(186003)(86362001)(66066001)(25786009)(16526019)(36756003)(2361001)(7736002)(97736004)(6916009)(26005)(34290500001)(305945005)(106356001)(486006)(105586002)(53936002)(476003)(956004)(6512007)(5009440100003)(386003)(8936002)(68736007)(51416003)(50226002)(76176011)(3846002)(6666003)(1076002)(6506007)(316002)(6116002)(47776003)(16586007)(14444005)(2906002)(6486002)(2351001)(81156014)(44832011)(81166006)(446003)(52116002)(50466002)(4326008)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:/tINcOz3hZX6Bj9MSNAopIe33itNvtut3OO+UZIxJ?= =?us-ascii?Q?CQaBKkPoAxAexI9VhdMmC+QYVKYKXx/xbkbmWyqQDj15KyEb/4B6M2edsmux?= =?us-ascii?Q?NPiBTlVxKhju0lF7vjXNdpWLsMuKVh+gZnpFlgi+h5BKLPmqOCWlvvj9iZAv?= =?us-ascii?Q?AmdwISi+18LTVsUqjzoKiu2CQ0HiDGQkJUQissXnbzD8yUeh8i/cAd8A6/ry?= =?us-ascii?Q?Tx0tVw/O4GPV5ASwPjuqBnmr9eO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M9JJQ7UUlSUGc34Ldvt6jYxt+m9+dOuKTnOP1qtuCTiWdMXg2311ok2cUX9iR15LxmSZqdw/WdDXcDQLgPbu1rB1lpYRD2mapDX426cngh72w2HLdguf6RaBAy9MmJp3Y2bD2t4ZtyO8GD5IT4gYlw7teuSJ5Sud8w==; 5:N7dYkAv/YC+XADq/qxghDZBOj9fFwFx1RvFV6qFSQhQxOkWT8FgOuX3b5cnyupfk8zTgL5f4wzCme/Kkb9hqkLlg9QstuXq46QDsyXYIRrfWF7TeAQR4XmzzsxPBvjzy83xO0Z/G7XTtHHPTC/MFlXQddifaQRPwNjJD8lUFAuo=; 7:vEyQ4Za4vzdJ3IVJycxFsew/gFrsB+1FN6Nf4nHfm3cTuPyW4afNAahTEBsLZPq0/fahUrurjpKlcvJq3V8AJsbnc3+qfNxBxKg8x8zzSd/Et6DJ/KHJ+j1t/fA7RrEJh0XbNRr30tCTMdlDlx9BVBNtvZAxhBfYJFtz51JRgUGY/KyT0tqVPkH8w6TP7oe3DcLeCPZVE68520GTTV8s0RZrzksm9iXPjR8rA0+8UpIsUoOu3CcFl8LciG0XlKh6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2018 12:55:27.5085 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eaac4bfe-cecb-46b5-8f93-08d622e62c1d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH 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, 25 Sep 2018 12:55:31 -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_dpbp.c | 7 ------ drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 32 ++++++++---------------- drivers/crypto/dpaa2_sec/Makefile | 1 + drivers/event/dpaa2/Makefile | 2 ++ drivers/mempool/dpaa2/Makefile | 1 + drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 29 +++------------------ drivers/net/dpaa2/Makefile | 1 + drivers/raw/dpaa2_cmdif/Makefile | 2 ++ drivers/raw/dpaa2_qdma/Makefile | 1 + mk/rte.app.mk | 1 + 13 files changed, 45 insertions(+), 55 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 f5135e538..7dbe01e08 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); @@ -450,6 +465,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_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c index db49d637f..39c5adf90 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c @@ -28,13 +28,6 @@ #include "portal/dpaa2_hw_pvt.h" #include "portal/dpaa2_hw_dpio.h" -/* List of all the memseg information locally maintained in dpaa2 driver. This - * is to optimize the PA_to_VA searches until a better mechanism (algo) is - * available. - */ -struct dpaa2_memseg_list rte_dpaa2_memsegs - = TAILQ_HEAD_INITIALIZER(rte_dpaa2_memsegs); - TAILQ_HEAD(dpbp_dev_list, dpaa2_dpbp_dev); static struct dpbp_dev_list dpbp_dev_list = TAILQ_HEAD_INITIALIZER(dpbp_dev_list); /*!< DPBP device list */ diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index ec8f42806..7306d2598 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 @@ -277,42 +278,29 @@ enum qbman_fd_format { */ #define DPAA2_EQ_RESP_ALWAYS 1 -/* Various structures representing contiguous memory maps */ -struct dpaa2_memseg { - TAILQ_ENTRY(dpaa2_memseg) next; - char *vaddr; - rte_iova_t iova; - size_t len; -}; - -TAILQ_HEAD(dpaa2_memseg_list, dpaa2_memseg); -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 46f7d061e..de6771551 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 -lrte_pmd_dpaa2_sec +LDLIBS += -lrte_common_dpaax CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec @@ -39,4 +40,5 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV) += dpaa2_hw_dpcon.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV) += dpaa2_eventdev.c + include $(RTE_SDK)/mk/rte.lib.mk 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..e74825598 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_add(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 42d45c1a8..59f7bf4a7 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -41,5 +41,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..83b5ecb56 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 @@ -33,4 +34,5 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV) += dpaa2_cmdif.c SYMLINK-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV)-include += rte_pmd_dpaa2_cmdif.h + include $(RTE_SDK)/mk/rte.lib.mk 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 89a008fe3..abfbe387c 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