From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0046.outbound.protection.outlook.com [104.47.2.46]) by dpdk.org (Postfix) with ESMTP id F36EA1B346 for ; Mon, 29 Jan 2018 09:12:36 +0100 (CET) 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; bh=/v7x3+fz9M6mdjguGmw/r1FH772eTMTe1WcAxYcY8Vw=; b=uvE2Wi318AbyDjBAXc7v8TfcpX6FWrjvgS31n80rch7WgH3dlDjKhw6zwChnsZsbq+b8X6wrKhtD4HKoTS58pCBifsgWV9uGg8NExPE0WSTOiMkbo/TJ4KSOvzBkfLJi5yB/BxJrqmfHDoQQSD/GXJmj3G0N7WYp3j4WzttsvPk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (192.88.169.1) by AM2PR04MB0756.eurprd04.prod.outlook.com (2a01:111:e400:8411::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Mon, 29 Jan 2018 08:12:33 +0000 From: Hemant Agrawal To: thomas@monjalon.net, dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, olivier.matz@6wind.com, santosh.shukla@caviumnetworks.com Date: Mon, 29 Jan 2018 13:40:49 +0530 Message-Id: <1517213449-678-8-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517213449-678-1-git-send-email-hemant.agrawal@nxp.com> References: <1516629083-13967-1-git-send-email-hemant.agrawal@nxp.com> <1517213449-678-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: BM1PR01CA0094.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::34) To AM2PR04MB0756.eurprd04.prod.outlook.com (2a01:111:e400:8411::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ab44ca93-a955-437f-1f39-08d566f00dfe X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM2PR04MB0756; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0756; 3:+Rkv+UakJjaRTWUmL2d2Bo3vt6um9Mvq/Va9vFYeLMTym2bYPFVqNifBXo7z96N++Q4H6zWsYJy/cHYLVZMET3phj8BgoOPFSu4u7sYo3H4uLl5Nijym6klalOWvPA0kpyjhIHVn2tJ3nm/+V3qLAt5lrSNl88D+Es3pamDbOo2H8FQgaIa8095XhG/MD3X5MZh3CpRdvK6SWq5IlKW3A3q3FfqLcJ6CrVtCudpq3Dbkf8uP4CNWTxhvGxEDoQ91; 25:kpYHjHD/FdvIBnv2uOaNqgSJ1mB5nGyvwRyE4Bgi2uDrzhaLWRctQ5yt3Q7dElRXukR8FVSE0AK2OCDElME2iu8YLiZwBoX7FalNPhQOjiq4nCw5mZjspnH8T225c1f/V9cdMp8MDNQi5SvNzdEljICSUkNiDEmBOwUxMy++FgZtuuGjGCwUAQYOY80rkaj8h1S9vvTD0BK0iRJSkUjQw3zDp1c2RDV+kEoEtHGRrXTg/+Y5a5utAiv4TpSopVsJ0XGX92G3GPtTat/t/rYVyi/y/eY18HtoJ/kE0nBqis2CSJrDvz8+0WHpJtPBKBsMHA23zvBgH012Ftr3Y4Vm9g==; 31:qwBfVrId7CBOvvxkaniLuGqT5HXsT+qNdGUp29sPx8x/OZLiX/k9hDRUwfl1aGMFw7+T8u8939ZJYHvv4bAquplJJeFKGCPxAA4KTzdM1nu/ORP7kepZvBJtutnMQPAco9z9Ukh9aj2iNDZwetPWB/+YKGg99h10+wSL7gJudZ0FCY7joJU2K0l/u+IW4eOcjXIq4UwQBMHDZ2I+qTpnv3g5FwNVhkCQBWrODIURkoY= X-MS-TrafficTypeDiagnostic: AM2PR04MB0756: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0756; 20:c/kEKt1dPj2slMqE388EkLAon/r7Hp/jldyzdfaUuAHvUk54O/lMdwu4tEjCVlTFoKDdKVv+nmDDNhJouUj8wBSFqFM25GT98EL7HHu7757Itf9sZC8Mcu0kkTmlXdiBvDl9OdAYIAsCoIa7BMHgbn+3lzz40EI4qF36gkKPRJ3LwG/jw8uYQtz6f7ymQkiHcM8scHKB/D1EvNWuxbxlynQhtKN47EKjpA6GAuuHglbT++E/g9U1ELXwy0J2pjMV7uH84CwnRF2tcphASNzfxaLZbeqKipmvowoR1kVKkFI86wJng+drdFyxHFTlRLuRSnBRFt5RAT/cubTy6XFYE8Pql4dFGnAeNQwVLTXAbYTE6+UxYom0IjpC8dVWhj7htsx06Yiqj+XtL77a146s+Q5m1Cz0+hF9ghTkEGBbpRM9pYwDzuNVLFXYWnS259jJNk0wrfd6dwPAKVlvcEujWC09k5A7leZhEhDAOqa1yjQ/dQSwAC/ClT2+WXK/5REb; 4:WgQZr2O7+qjEG+DP9osbbmzqTIA2+wUSyQdYM20yKAslgZjdOQ0GTTCXgU2Ve9yin6CCX9z+4ZeGvmAsPF+nIEBY3PUGQ1ywblfpV/iMUEeMR+0SRFbxHPOrdK1hS2zXDA6aaFF+cLVTliBtovRuu4BNdN+1TYnOudqf//CAZCigONkTGweEcze3cu5DCJg5NrTFqUqoVIf1DnuKCUjln1OUjHen+Ms07aXZbulI7XrgVhoWZmiA6jes3F25QMU+RS/W2hr+C9gnjFDiXrvYOWpFgwwWn58Eofwt69B3PoHA7Ijow4rKZf4XYG/LUnQ7mu6FBIl75Mjq8417spTaOJR8x3lOBzJx1LnSd0rxbSE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231101)(944501161)(3002001)(10201501046)(6055026)(6041288)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:AM2PR04MB0756; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0756; X-Forefront-PRVS: 0567A15835 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(366004)(376002)(39380400002)(346002)(189003)(199004)(5660300001)(6486002)(4326008)(86362001)(16526019)(3846002)(105586002)(68736007)(36756003)(6116002)(76176011)(25786009)(59450400001)(6506007)(106356001)(386003)(305945005)(7736002)(51416003)(52116002)(97736004)(81156014)(81166006)(2906002)(50226002)(8676002)(47776003)(478600001)(8936002)(26005)(66066001)(316002)(16586007)(48376002)(6512007)(2950100002)(53936002)(186003)(50466002)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0756; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0756; 23:yS2vR8XovTZqFUXOoPYa8NN5Kow1L79zNxWvt7yux?= =?us-ascii?Q?dpUR6iAyQubYCkMxeXkqsd6v2Fwcpi44IYCpdGlBKMCNEoAwt0Mp9pzgWh0Z?= =?us-ascii?Q?5uTZyvFwfqeU7oZfcvAdTxRMf1iuR682l1ZXqAX1v90SzjUuOgqM2/2WvlNh?= =?us-ascii?Q?olgs2DkLh/sRjvC7F5gk4F70iiqDn3mxxIBnHAhm+D02cQ7wp8EVTe3kw2DQ?= =?us-ascii?Q?ceVd87thR57bPdTccK80aU7TFPvE+3yH7TzqGnNpGSg5m7WlGkXpnWEuFygg?= =?us-ascii?Q?blye8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qx1P+fZG9aQR1rxfgHAIM3SnumTNG3rM9CjeGAi6l3qyvhu40tH9Cu5KHsVMo31cyg9IdVpX/RvSKHBhJwrP7CTDRsurPINMAMmvKG0QP2Xw/qxSJYCKuzCdK0e/iYdbxlKkSVMNWpbt8MXPbN5pS7v3hDCcrapSSq55XNZCy04v256f7FZZkA16kKEFC9gZeFSnA3ALoanwL8FU3KrmEHvESg8CmtqkfD0KJfuzsbshe3cgMcX7nndiSbbHw+bwBAQjs1GUk4mKvhMDPREIVNzojjNxTVrfgkS4sHZYQlezuYuUaNgWUBChvCodkDRvnz4JrRw7/qBa/F5Ig=; 5:fuFvOtlohzElZa5HgrioUbdsjfnMsd16r8ogRnDWfBx87gfTyQoDFbBJrsHti3g0iBxgIcBsvDF1raMomOOodDGnHyTk8j78SMSltR2RJdjpym4WeE0w1MC+cTnclNajz4Px0Tq3pICndSNQL2iMTgEeeHL/k1/vpsfil56jdJU=; 24:JYY4gKNLpgy2hGhYz+MdGvPU2H0ghqqN4CiVJPeZRDDNEWK1ouPTC5zcdmlAAu44fCMGw2dZaMfh0oRy4oJkXXRIoVoawhuyETjn87EcMFI=; 7:H/WB5ZCDF0XrCYsym0MbPDbpZ11mGO12h0XwsfbdsiiEgbfduFCfGv1tLRGdBVo60TqHuJvw4e0pwVBLIIPxRQJDrMFD5ZLPdbEuEQS6FOaURfIjzaxEu0XkakrjXW0c3IQr3FmjTX7fOZxcIKoJGqVnQZ9a2JgOdjKnw68G0p3/awwQ/aqkGQi9m2zmkeRmMrUrzErYcndrsW6EWZ0VLcTyRAYtxEcgdgo6xZ6/E8QfqLy8P5xrJ+cHD3aLkTuM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2018 08:12:33.8549 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab44ca93-a955-437f-1f39-08d566f00dfe X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0756 Subject: [dpdk-dev] [PATCH v7 7/7] dpaa2: register dpaa2 as platform HW mempool on runtime 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, 29 Jan 2018 08:12:37 -0000 Detect if the DPAA2 mempool objects are present and register it as platform default hw mempool Signed-off-by: Hemant Agrawal --- config/defconfig_arm64-dpaa2-linuxapp-gcc | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 7 +++++++ drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 ++ drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc index d38d696..5d4437c 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -26,7 +26,6 @@ CONFIG_RTE_LIBRTE_VHOST_NUMA=n # Compile Support Libraries for DPAA2 # CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=y -CONFIG_RTE_MBUF_DEFAULT_MEMPOOL_OPS="dpaa2" CONFIG_RTE_LIBRTE_DPAA2_USE_PHYS_IOVA=n # diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c index 139249c..1539739 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -38,6 +39,7 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused, { struct dpaa2_dpbp_dev *dpbp_node; int ret; + static int register_once; /* Allocate DPAA2 dpbp handle */ dpbp_node = rte_malloc(NULL, sizeof(struct dpaa2_dpbp_dev), 0); @@ -74,6 +76,11 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused, RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpbp.%d]\n", dpbp_id); + if (!register_once) { + if (rte_mbuf_set_platform_mempool_ops(DPAA2_MEMPOOL_OPS_NAME)) + register_once = 1; + } + return 0; } diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 9436d37..d421dbf 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -44,6 +44,8 @@ /* Maximum release/acquire from QBMAN */ #define DPAA2_MBUF_MAX_ACQ_REL 7 +#define DPAA2_MEMPOOL_OPS_NAME "dpaa2" + #define MAX_BPID 256 #define DPAA2_MBUF_HW_ANNOTATION 64 #define DPAA2_FD_PTA_SIZE 0 diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index afda2c2..2bd62e8 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -354,7 +354,7 @@ rte_hw_mbuf_get_count(const struct rte_mempool *mp) } struct rte_mempool_ops dpaa2_mpool_ops = { - .name = "dpaa2", + .name = DPAA2_MEMPOOL_OPS_NAME, .alloc = rte_hw_mbuf_create_pool, .free = rte_hw_mbuf_free_pool, .enqueue = rte_hw_mbuf_free_bulk, -- 2.7.4