From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10056.outbound.protection.outlook.com [40.107.1.56]) by dpdk.org (Postfix) with ESMTP id B4A334CBB for ; Mon, 15 Oct 2018 08:44:30 +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=3lmTKB40KVrXXNhcdZvBGkrA/X7bSbN4Ja0KmgbXLuA=; b=r8ihVibwkCTqw7mRInWbZ5YuRGvWDZwjVWPhSUcR/pfinUDc7flH99ujU6FFtZJgyzaoShSHJh52nqwj9gVzb/Otij/62TPXt2eKp+tNO9pC4tEoL2hkH4iDTCsKpQvSdiI7pioH/3Y5OmuxA36Ul4ONdX2xBZroSikiUAyIiq0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM6PR04MB4677.eurprd04.prod.outlook.com (2603:10a6:20b:1b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.24; Mon, 15 Oct 2018 06:44:26 +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: Mon, 15 Oct 2018 12:12:02 +0530 Message-Id: <20181015064202.20802-6-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181015064202.20802-1-shreyansh.jain@nxp.com> References: <20181013122130.22588-1-shreyansh.jain@nxp.com> <20181015064202.20802-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: OSAPR01CA0083.jpnprd01.prod.outlook.com (2603:1096:604:b::23) To AM6PR04MB4677.eurprd04.prod.outlook.com (2603:10a6:20b:1b::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a5994e3b-c396-4364-7cfa-08d63269a850 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4677; X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4677; 3:LNidt6iccKijj/2pmRJ9sDEAI6U7fXEnSdbf0B7Ml8r6GQLX74nyrnbltIFvGfJyK46+2UyFwEPFdaV+x13jQcH2ZngAOtqx5OGIOOV92MLql3RqvE4sd9T8Al6f9uunk3EC0Jgb4F7kyYwlD6zdA4281O687Z7fLlCz04W7i48zOlykcq/RmKVSJfGsNf8MgspHtJ6ESqDFcjU/tnNW9PK1V8hO6Itjmks0OB0u63grKms7s+MBMCaIdW1kaIWd; 25:HFHQMU3wwfB+DfxuTgwJlZFdcypwUaSGsrkL1KjCMawmS0z1W/9TQJuL9quNU6iCKFyEaRtX1abZl0/WNmrj9U3ukbuvr118J7DTrKzutT5iHd3kJXLzL7/Vy8tdl4MvgAeTaZdEeUl3mJZnhqfFUXqz180dj/AJ858kHF1k/p5g2JpUsrNHqX7hFDlBvI33i3WkmliBgHWYg465kEBpVqWNnuFOvhUDdgPXae5Qt+avnN52SvxEIb05QZdZzLiAZZHQxz10A6vrD0RuHWtJKeiyo9Oz6BCR+gcdG81TCI8Nc3rPq3ESTFsp5siP2PjtsqAzRUONF1AcacqrjNICgg==; 31:K9cBAmy7K87SDuGnl289OgoDkKKnkBtFdm6sWDQYbnAkBiOsszmKAR3p+I544udXJrp6hU2+T1j6R3+KhZzrqLnOQyOTVWNafQ7orFWB1xCkePghsBlzDnIGGMbVF0+4E/EIurgj9JNe9uplOdRQdTPq0Zv/kbjX1WtTAOTOlYSPjFAKOY5BIeUHsTsd6/Nhgw5mhUQ9ELXz2/heZhsOVhyUoFrTOwIfF8rKjOAr+hY= X-MS-TrafficTypeDiagnostic: AM6PR04MB4677: X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4677; 20:df0/Xz9B1qWgTzNBvKPv/sk0q1iduCJCIy4tCK6IwSqmwcbpyV0Zr1Vc7G534IpCggsejh0LqkI45ahG1zirJUNPIIzr7SJI/zGQwl2uFV+Ge/4o6O92zGGhCQRHqrjYs3b6+Aqxhd7fE9Z4IIb3r8QjXJMb9Zig+qE2RldeUly2qaH9++yOulwIF/egUF+v3SXmKxNC+ZItS1AwZOmxZad6yuVE72k6CV21gfqxVlVskuYM/Nwpw1nkW2YRjHla4ejTnSnBx3T3VWhhglAWtRD1N1lppr2LEdcnDdWjZGrgFgwpQJqu7H5UvcM3X40s6Z9Jq/dW2hwqoDMfhXuUuD0H77wtRn+SK+I0Yya0G0itfoGgmcNw6O2iziI/+5qFlgEQN56dubsl8uUbKjTenLDnXwxzYT2gyuxCGBef7lAMVb42Tbx1e2S1NsTBCcuJ2y7dlETV7BS7oxpm8WM7BTF8/rwfKyDbqtlCDDyCB4Aemc7eZiNfeRA1y9ulDUzO; 4:REiWjHMZ8KTbj4vff334lCkSWJ8Y+XIf2teIui1ZJhIbo8SrNhpXob4ev6mIQQZtRPlYTAkmxANZ2wxgVlz7SSJDlGv5LdiW5YCa9cGD5CkQjVt2YKxYxKTAzNaSjYvA5tNLm7dCJoQQsvuFu+0fZ7NjnEtc/yR0PiAvyp0yZb1J11ftg86aMAMFyChpUjZ5BIZxICKhvTHRl4tFd6rfWW3Axdi/pQmUZerK3CP4AQzmgbStHOBwTHh/Vs78Dptitagph52BlqJbDXlCz+4Khjt5WcnsVOi40GNbK0Jw8E8ukg6+ZmEkLOfbTjIIj+LwrY395dO/lVNXvmUE4oIWm+5+W0qx6IQvUStyxROPL1M= 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)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991067); SRVR:AM6PR04MB4677; BCL:0; PCL:0; RULEID:; SRVR:AM6PR04MB4677; X-Forefront-PRVS: 0826B2F01B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(136003)(39860400002)(366004)(199004)(189003)(3846002)(68736007)(50466002)(6116002)(478600001)(4326008)(2616005)(476003)(446003)(1076002)(486006)(6512007)(53936002)(50226002)(186003)(5660300001)(956004)(11346002)(78486010)(16586007)(14444005)(55236004)(6666004)(2906002)(16526019)(1006002)(52116002)(81156014)(6506007)(81166006)(316002)(386003)(44832011)(48376002)(76176011)(8936002)(51416003)(8676002)(86362001)(575784001)(7736002)(305945005)(26005)(6486002)(47776003)(66066001)(105586002)(106356001)(97736004)(25786009)(36756003)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4677; 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; AM6PR04MB4677; 23:Bx2g0SGMc/+v3yFbvAraNhMBNkRH7kkXirUo7U9i4?= =?us-ascii?Q?3u0bEJvx7F3xxyOiIA/agndpO+8e66BdRjFfn3XGhPMMN9AkAdhr9z6oGnne?= =?us-ascii?Q?MgUKxBhsBqP6qPvepKxp08Q3NmFcIiJWuINkUhKZ8Ewhvk2384/YT02BvOfI?= =?us-ascii?Q?v+55Jwh7aEdw0iHF/GSAbOfTfcTYWSrwT9j6FsduvtaxQ6mtiKfdM9+oK0or?= =?us-ascii?Q?HRc2v1zCqT1ljESw3aBNNZ09SX2PmYUVCKanC5dJYd5KGDQi7Rl3mIZsJgqZ?= =?us-ascii?Q?26/8d5XlZtf7u0U//Iyy0mRxoevJxKZanob+qkidYSheW0wzwloJ8CiirglV?= =?us-ascii?Q?78E4sqZBnzAdKZF/cIBcmKHYwM/5p2e2WlEqSfBMIswySDK2zF5vWGL9PZCA?= =?us-ascii?Q?GjhA6ujl5k48MSGxR5bvEMRJ3kXkYJlEkgD8nk47AL/iT737GceWqsogfmyD?= =?us-ascii?Q?vEApGOEIgvWRdgP0Ro6X6XLpi0PJ/0lucQahQHG1oafUoy0VOJz4gFbRsROv?= =?us-ascii?Q?HS8n22ADOopiEUIWaamK2z2Y6CdKIbexKKnabumUdj7RZ1h86EhAkLP5R4Xk?= =?us-ascii?Q?2F1urIJjzgYiBSVNO4IGELwryPll5KKgURFdraNK/II900T7WXBD2mCjAHuS?= =?us-ascii?Q?cerVKuqIw0eyB0ZiY9z/GOglMjIoPIXLMuqG2kVlBynA9w8EvYkxZhOSufg2?= =?us-ascii?Q?npT/OzHj/aWHAjqhkbPSbMIQ9cCu8pVCbACrkjBDMv+0Cz0FPlMbfDr7bscG?= =?us-ascii?Q?WsweSs+GtQ4uVo/ztUOtl7IUZq+996yGJG06vXxOwyqguJrgzChHuJR0/uRP?= =?us-ascii?Q?QidHbUsS6ABZywMKehumXmANwKNMNFVGL9GAkuTdt4y9YGROjF9ZStBORtQr?= =?us-ascii?Q?KIADjnJayVAwlndgu24LmZct6obm6f8YIOO7CxbSCak+6mKdKtbZ7cVjD6qX?= =?us-ascii?Q?ZBV494UlzBA7xc/8g1ba0a72TbrBWdUx4nDq5zVfxybjnlbU2SYpSjOoXz9I?= =?us-ascii?Q?pdFos2ELJalB1G+rh4lyPACZWlTcne+UoTsNoCMejLwx9htj+6NvaZtmVfSn?= =?us-ascii?Q?/AA2cDsOrXkhTSn4Ea4qiw72WbWnENsQadDo5XncYB6RbdCdUiCnVwLuC+9a?= =?us-ascii?Q?44af2MNFAGoBG0uVhALm7g4YLT15VDgqqGIBAJhcFAk0jsuhmiZXvzyLWfGt?= =?us-ascii?Q?4Wz3QtoZA0/a8okg0FcgJEfb0Nwx9wGI9QUa7GR0B8LB+9h0xYH6joDZUgfa?= =?us-ascii?Q?1gWA0MqTRu2wz2V/cshE0YJzb7KQ21LZWrvInfazy2B0CzVqDMyI3YTFck/2?= =?us-ascii?Q?68dpcEWvjjXk+78m2GTm4g=3D?= X-Microsoft-Antispam-Message-Info: VFiXIR2OQLI/hakG8JA/yWTGBMN7bTjy243+P0GzEcVnTl5XvWRT6wCMQ9xSNEs+w2Qr2fvWRerMoeDiPJkH6/NQQO3L2g5A3XcELA5YS5iTQMeclgalFB95Y4ZYq/Ma2fplz71nwQpOukVKgJt0SkzNmtxzsZKkFaY5bsT/dfIgpsGoRyAXR8VqwjpQHP2K5SsPtY1j1hAGqgK5awUf//W+rW/QX9pHUrSlzLYMYB9D9q63kV5HSmpt2gjsDlTjGOpC2swQbT/gwAMXHNrMpVUH6u6Jm+ZbRMZsCtAvzDzJ7hcN/+Yi9Jo5/oB+hoAxkT6dW6lrLyZm0XJ1NGRxWZPEUu1ZAvHgVdxZtcq26BY= X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4677; 6:2Zu51A2VNN8SXV8HD1y82PNdzoNg4mPU0VHOC//SCEYIxmGZ658Gkm7y7HECkSYplI/1HEVAt/dxgQJ657zW81rJB7ZLKlegZ11g9kTKDfpOuTkAGP6Cn8+juD0tA+wuXo0D08fK0+iZ1SU0/pzTgJctjyiFNLsaZEsh7XuQsGrnU/L5N54Vo5oa+/EwLNkdvaZStLKAUesQ2IIlhWOMj/ANaqY5UV6YR+04zAPpEGn5lqKdJ4J4BYkYfehxVQJaFCfzHShgmaNPhTTxxU5Popy1DahIFwXJCxNo4X7EgEv4Ud7Jy+uegxVuM6s2S3rNZsWrYnKHTDW6qqgnTRahWy336r3vlVeVesjYE0cVuwZXU3LMgmbTQpgf83DZVTnua0mCWNEg42rNKf/sRKWigPxE/sOJ8yALXffZoFaVcVpCzqSQ/HOq2+M42FLjUVadzi90qt/pBnsk7YidRvVW+g==; 5:w5hxhS8pgxooA5UGdav0mmrZguESnqDEiBYnK2y3xBnKRBdTgemfoyrkd/DQhHGA71fMywFU3yWvWFP6R9YMi/VFi4wCpbjn5z7L3Z8YzvaD9sE/2IrcHDSJqXZKjJOcPuTuylULobJ0sPc520cmJQRwu8IMb0TSeNgeWDg6K5g=; 7:xMrKUh2oJ6NlYhGWP9Kiud8IXFPTfrZMstsZbuhoAd2pg2kyib2i+VuncRVmMUItf7jGc7+zwJBSXJ/IvUCkDe9v/HRWmVR7X45ZI2uj0Tw+FdjPCD2NW8wbCtbFCwv3C6/EsgHhe8jMq6LqiMbnDkCZOiXjm5VuCt6UZNMlBGWIAjIect7LOtt3pv1qAqbgAy9yX4XJemAKNXxeFUYLfpk7otyzY0kiiX4HGtAe9hDVl9/Wa6TEexOaX/F863wi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2018 06:44:26.5523 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a5994e3b-c396-4364-7cfa-08d63269a850 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4677 Subject: [dpdk-dev] [PATCH v4 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: Mon, 15 Oct 2018 06:44: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_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 2bc9457bc..5ba5ce96b 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