From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0044.outbound.protection.outlook.com [104.47.2.44]) by dpdk.org (Postfix) with ESMTP id B977C2AA0 for ; Fri, 4 May 2018 12:11:55 +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; bh=qUYCRUeEFshZjg/L0u+z4+WkLH/67q/323dlNrJHVeU=; b=VeB9N9rvMUvjgnczvG5k/N86cwyVOz6vQMkBnWMGsbUC8I4hF0RX7dR/2cfxm6i6XhVJXWEbZWpwtpPjzQK30VOhq00tOFO0wWpudq9/paqVQnauwPljl15WlhLjf1cQ1hjsCHmfRxC1WTQR0v27B/JvziT1dnj8yhxgsvwZZ3M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.142.187.166) by DB6PR0401MB2422.eurprd04.prod.outlook.com (2603:10a6:4:4a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.24; Fri, 4 May 2018 10:11:53 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Fri, 4 May 2018 15:41:23 +0530 Message-Id: <1525428689-8076-2-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525428689-8076-1-git-send-email-nipun.gupta@nxp.com> References: <1525365233-5956-1-git-send-email-nipun.gupta@nxp.com> <1525428689-8076-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) To DB6PR0401MB2422.eurprd04.prod.outlook.com (2603:10a6:4:4a::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0401MB2422; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2422; 3:x1JIepPYKDtwaJUw46REBa3c01U/X99osZ5IVOPpkHvWPc0f4a6VbsiSWSkRW6b9TupWRa/y4jQybyq1a1sWI8p4s5iOQq8Ab81gdXvl2GEiwHbKg8L3z3na4py2mY60mcvSNXX8nFUYJH1v9AJlefCWdKTaQv1BYJatXv5pdLliY1usn0ABUUf1B7STElE4QuPPrrjGdV7M87uAFdNqlThiqtvPxZMyGAKP1BP/D39UL77mLQndCn1dKhyFV3tk; 25:hExHz4HCUHkitIWAq9cN0i0zGHgUECr0FuCxmhjzKETpdesIvWjLnZIG3iwKD2/fDMmo9LYC83/YrAdu5VmwZbCBBabhPTJ46n6ca4azq5E+9qaRCLoGZhPYgpu5iq0x3w1lJ2YsrB5HHDxBuz1so60X438U8CAOaKuvAAw+dDFnQvilUgZUEtDMjgqU+NFKZqL7X9e5EqVSBw5bApSNj9YjH9B8FW8m/uk3olkPD6siFaG2A2pSfFhg6AI8tzqsiTNOdu+05V81j+Xswmg6qq0A8N3hVAMpYxkWBX15jf/p2NsH+jdKgR2R8OwLuIbofcK95oyjOs6SKqEo0yqbpw==; 31:+y9/imiEScfRCdrr1aG6mAI1TctYukw9GllGJBqI0XhQvo5Pdk/AFr9FhreiPd03s0tYR3N2WpaKQi9MLcG+l7KLVHTi3em48RKJRk8ucEBzmSj54/mnBzfmAuidM4joFtQOIU6GWSa4Ltp0hBjEHAfer6X3lVV/K1K6syqjmrt8GG/nZzm0mlHMg8/dhI2SPfkNPO564a0JpHDcCU+FRz7lpDnJKdB0ch6dLvM1g3I= X-MS-TrafficTypeDiagnostic: DB6PR0401MB2422: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2422; 20:h1uxzXxAUOzAu9Lp4MGQy0Yj8LHQlyQihG43O9g4qxkf4UyYqzQf2+wP8YfrNAz9Uk3bP9EoYZy6Qum6GMspAz6+g9x2ZPmOcHJLFFlwwd4xS7GfIHHXKlm67Nx65Ox+L6EG5Bafu9U0dYX4okEDfvLU/KTYVd0J4s4vs0UQ0XhyKlrebizBfU6v0A5atvP2kyI+WvvN/QmMkz2NgR4Lo85MVDurrfM1eNREFeIWsfhpcfVojkt/2NHDwONYpBzsP/lIASKeG2R87cG89CQu+bu4soAogwmPSDKc17Lle2NkJ63COodA8ZkhxwUKHnpz1xetR118plbDqs1HQ9LUb0vkjwRdqLRW45ZKJmbKGGtHo5I+24d9HoxRkiZTbDI5os38dRFOyDWGA+C5c1KIe9zc4kou6pA9sxtIS8T3Nl6iTdaP8MGvioTeJTCnRKNzBKoAA3iSgEAamfhTF8NeyCq5xgkUx+DtNrUq5ieB/DDJN+InbqFQx715DKVFbE7S; 4:dnASA8diqZmzOY6NTDOxn/vVb7td0DW/e8oQIUmh55AhExutOTJ8pIQnubIvCDV5JFwtL0RrrhCjEKELx2FQipAZjXnwcN8MKM5YaN9yZqkJIMSKq8ynllnYjFsWBNjV2Dbeyp1iq4KHmR2iAJ9M8HwhYlV7GGHHo2N8Zn3vS6puT4h/UNmmHST7WPi6jRfJuFhLwHUnu1SFxLOVg64e0aKxSm3fPGdg12um3Q8vJe/JRBPlsYFi6gKFE7778RVb4hxEW9fpR22dspqcejjKTj/1YpIXCPkF4gqxYwxgixo0EZI2KO0+YPw3swqkP8IYg9QqYkTLxG0sTLWUq2o+PQZzzDfx2tlkqx99gmO+0qU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:DB6PR0401MB2422; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0401MB2422; X-Forefront-PRVS: 06628F7CA4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(376002)(39860400002)(346002)(366004)(199004)(189003)(51416003)(53936002)(52116002)(4326008)(8936002)(105586002)(386003)(305945005)(6506007)(26005)(50226002)(55236004)(446003)(186003)(81156014)(5660300001)(76176011)(8676002)(5009440100003)(11346002)(25786009)(68736007)(7736002)(44832011)(106356001)(316002)(575784001)(16526019)(48376002)(478600001)(6666003)(476003)(3846002)(2616005)(6116002)(16586007)(36756003)(6636002)(81166006)(486006)(956004)(47776003)(6486002)(2906002)(50466002)(86362001)(6512007)(66066001)(97736004)(110426005)(31153001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0401MB2422; H:b27504-OptiPlex-790.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; DB6PR0401MB2422; 23:ERuQOihjwToCFzQQGqbZEOdBsOqVqQuMsa+r5n/?= =?us-ascii?Q?6HYR1wr0BUknRvuqHxz3wfjbzqOtMdzpIVFQF0dH4Y5UE7q2UOgDIGC31ctI?= =?us-ascii?Q?odGZ5BRr43nE5bcKNv51mEwUFXIbV4LgTErrxvgTYJozEtbSU7fpofA/KZlJ?= =?us-ascii?Q?8Q5Xt6ysaPPn7sxNfURGT0q+HL7oZ8Bm+h/fxsSuNY7Kn2EM5sSvrI5RwD2e?= =?us-ascii?Q?VgyeQ4sbjnqi8I9QrGPx+PSgJNWXBfR8wcYFepi05Jc7k9h3vp+doiTODhDZ?= =?us-asc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D79AwZulW5tW8PwAsun9ys3tEZ0aTwudvO8soB1Nx77JIc84M=; 24:/YT7agt2wF85HqpJFPhaKpYHc+SyPaHzHeubFM8UTecen8DnsqgMxqdVIVkVPhxb4JCjIBmxOiHp13TH3pKpE7COjM68k5tJqYl0XTht9D4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2422; 7:Rzu4JudRNsUQMDlQPdrakijRPGZXs+3iWCeQGPvfyOoS80Utued0oj7xGaGn4TPUWaSUDMAU9wXa2xhWj7yw9O9HEvg0hM3JzhccTeqqGj0ZAuVJFwiefS385D6DKcODXhgs0m81u3UoS6LZonC3/4wM8JxGjTO45mZ2UfByOLMs7vToauTrn0AKcaFC16F7ZHFrnLa2hc9JDhflvSjnMCGAkZLhigUmIzJpe5bSaYYTkcj5NfH/mLjVZ0nTD0Kf X-MS-Office365-Filtering-Correlation-Id: cafb78db-ad97-49c6-3f69-08d5b1a7765c X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2018 10:11:53.4954 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cafb78db-ad97-49c6-3f69-08d5b1a7765c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2422 Subject: [dpdk-dev] [PATCH v6 1/7] mempool/dpaa2: add functions exposed to DPDK applications 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: Fri, 04 May 2018 10:11:56 -0000 There are two API's which are required by NXP specific Command Interface Application (AIOP CMDIF). This patch exposes these two API's. Signed-off-by: Nipun Gupta --- doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf | 1 + drivers/mempool/dpaa2/Makefile | 2 + drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 30 ++++++++++++ drivers/mempool/dpaa2/rte_dpaa2_mempool.h | 53 ++++++++++++++++++++++ .../mempool/dpaa2/rte_mempool_dpaa2_version.map | 8 ++++ 6 files changed, 95 insertions(+) create mode 100644 drivers/mempool/dpaa2/rte_dpaa2_mempool.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index 437d903..dd57f55 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -38,6 +38,7 @@ The public API headers are grouped by topics: [i40e] (@ref rte_pmd_i40e.h), [bnxt] (@ref rte_pmd_bnxt.h), [dpaa] (@ref rte_pmd_dpaa.h), + [dpaa2_mempool] (@ref rte_dpaa2_mempool.h), [dpaa2_qdma] (@ref rte_pmd_dpaa2_qdma.h), [crypto_scheduler] (@ref rte_cryptodev_scheduler.h) diff --git a/doc/api/doxy-api.conf b/doc/api/doxy-api.conf index 88bee03..71fb6b2 100644 --- a/doc/api/doxy-api.conf +++ b/doc/api/doxy-api.conf @@ -31,6 +31,7 @@ PROJECT_NAME = DPDK INPUT = doc/api/doxy-api-index.md \ drivers/crypto/scheduler \ + drivers/mempool/dpaa2 \ drivers/net/bnxt \ drivers/net/bonding \ drivers/net/dpaa \ diff --git a/drivers/mempool/dpaa2/Makefile b/drivers/mempool/dpaa2/Makefile index 5125ad1..9e4c87d 100644 --- a/drivers/mempool/dpaa2/Makefile +++ b/drivers/mempool/dpaa2/Makefile @@ -31,4 +31,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL) += dpaa2_hw_mempool.c LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_eal -lrte_mempool -lrte_ring +SYMLINK-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL)-include := rte_dpaa2_mempool.h + include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index 5d057fb..e12a0ec 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -21,6 +21,7 @@ #include #include #include +#include "rte_dpaa2_mempool.h" #include #include @@ -244,6 +245,35 @@ struct dpaa2_memseg_list rte_dpaa2_memsegs } } +uint16_t +rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp) +{ + struct dpaa2_bp_info *bp_info; + + bp_info = mempool_to_bpinfo(mp); + if (!(bp_info->bp_list)) { + RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n"); + return -ENOMEM; + } + + return bp_info->bpid; +} + +struct rte_mbuf * +rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr) +{ + struct dpaa2_bp_info *bp_info; + + bp_info = mempool_to_bpinfo(mp); + if (!(bp_info->bp_list)) { + RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n"); + return NULL; + } + + return (struct rte_mbuf *)((uint8_t *)buf_addr - + bp_info->meta_data_size); +} + int rte_dpaa2_mbuf_alloc_bulk(struct rte_mempool *pool, void **obj_table, unsigned int count) diff --git a/drivers/mempool/dpaa2/rte_dpaa2_mempool.h b/drivers/mempool/dpaa2/rte_dpaa2_mempool.h new file mode 100644 index 0000000..4a22b7c --- /dev/null +++ b/drivers/mempool/dpaa2/rte_dpaa2_mempool.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#ifndef __RTE_DPAA2_MEMPOOL_H__ +#define __RTE_DPAA2_MEMPOOL_H__ + +/** + * @file + * + * NXP specific mempool related functions. + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** + * Get BPID corresponding to the packet pool + * + * @param mp + * memory pool + * + * @return + * BPID of the buffer pool + */ +uint16_t +rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp); + +/** + * Get MBUF from the corresponding 'buf_addr' + * + * @param mp + * memory pool + * @param buf_addr + * The 'buf_addr' of the mbuf. This is the start buffer address + * of the packet buffer (mbuf). + * + * @return + * - MBUF pointer for success + * - NULL in case of error + */ +struct rte_mbuf * +rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr); + +#ifdef __cplusplus +} +#endif + +#endif /* __RTE_DPAA2_MEMPOOL_H__ */ diff --git a/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map b/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map index 82a5ec0..b9d996a 100644 --- a/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map +++ b/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map @@ -7,3 +7,11 @@ DPDK_17.05 { local: *; }; + +DPDK_18.05 { + global: + + rte_dpaa2_mbuf_from_buf_addr; + rte_dpaa2_mbuf_pool_bpid; + +} DPDK_17.05; -- 1.9.1