From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0045.outbound.protection.outlook.com [104.47.0.45]) by dpdk.org (Postfix) with ESMTP id CBC377CC4 for ; Thu, 26 Apr 2018 12:15:39 +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=0e1jeTr56xMAnITOeUhF9D7IKB6oBodP7a01uugzlxw=; b=h71wY25i0//bFZrZsjruGq/t4jYiOCP5SFfzgBzgB3mvoSijCGvdqVDAJvRrb1ZKA7AeYc0v0LkIsv89DQICvDi3ovOpzFB5Cs2tWnysxIM9T882aJAKWOEtKDxP9lKNanvxTHGlovGdSIuCFYFicJF0jU6mrLqHuFH/qFiTbEs= 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 VI1PR0401MB2432.eurprd04.prod.outlook.com (2603:10a6:800:2a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Thu, 26 Apr 2018 10:15:37 +0000 From: Nipun Gupta To: shreyansh.jain@nxp.com, thomas@monjalon.net, hemant.agrawal@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Thu, 26 Apr 2018 15:44:55 +0530 Message-Id: <1524737696-3145-7-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1524737696-3145-1-git-send-email-nipun.gupta@nxp.com> References: <1523111645-8076-1-git-send-email-nipun.gupta@nxp.com> <1524737696-3145-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: PN1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::29) To VI1PR0401MB2432.eurprd04.prod.outlook.com (2603:10a6:800:2a::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2432; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 3:tMf7UhkOpqMmzHXLetCcpFvAcyYQb9Qr0Oy5dHl8MNAxFz2gM/fpsCt7qnYH1Bvx9036dHtsVsHZssAnpd54E/We5kXXvd4qdptUIqlOK+vcemAFkKtvJ5gQVII1SyPN/vn+OerJG3XJdCfo+KILszqOBYN/lzNgHX0l3yWzJb2QVCAnP5FIaICA0m4kg3lCNiN+gomCdT67AU0QFCZVjcgkRU0bkpdAA1yvZELXsrmSTdYd0GC6eX0aU/GK41Ex; 25:v24vIl5/iF3In2TAVn/PdRGU1hOQMZ3Gz9Xcz5btRCXl8wCLEbHvKzjzOyiQBXFI4zBDgha41toOZHztun8/ChcdOWYy2C7SmsIGQ9W4Ran7U9bi/iHNDYQGHERiHfWCaJNtbtOvmd+Oa7T1LAzvVRgo08TjzktqQnoINBG+RBA8N0Z5+ABpzNIQhSSV2hWz5+4jEdjLSV7psZ3+OPg3or1/yKdt5OE3wLRGRESnkTK1Oz7xenZf40q6blugPHtY9KkBM83EaiXxyheL+GipIsS//yb0j4a71yIahJIAmR4NLPOQwu9FbpKkVaV1nJdegx5NqfIqIFaI1vz7zfUDiA==; 31:XLHfr6RlPQJ0kVnoJtXKlUX3gUQr6HL8mivQWtJwWnpBIGGyncAI6qCzEUtCezYOIOU+oA5FWJW9nqOZFaR/7mT3C/KrSutCm5ixfQuAEBIXPQ0k+wjKashembHemGUgnGqaV+JEBcqvI1XnO3uSUU3BD1SPVHnFtYZGsjw1qV45+1rCAS4LUvZ1JgX9WkgHfgcTECfOYOyAseWJGFKOZzWfft2zXDtz53yaAwDbM9E= X-MS-TrafficTypeDiagnostic: VI1PR0401MB2432: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 20:fEpqpOhauZu60jez48q0rc5YR0HDUPAQDPJ0PBP+MCQx9lzcWvpvEZ9NDla49ajDFjuRhAvSclHTw07z9lCq5RqebRP6/Iw6qStgclu4DgykTGMbqviIiBeVIAtqb+dRDqEPbExJqAThnPRFU8gs5kcd8O9y345dHVBxrKXjUJpClYiYTtaub19wV8PHR04mcMYdE3utHv5ZwTiUBNF6RqDqGHd94QYlXHj9eYVqkq6mJhkQmSmaMxT3RsDFYsOpVJgAkIQDaAqpU3dLALH9e310rYpzaIAJs2DvwOy/KXmJTF+SLiBgBFW1gqaZec+RGsSaHMTO7AicdpQSRQr8OM60pKlFtUFH0TzMbFNiknsZs/IXeMafWBouchcQCZM+S0Xo+XK06fXjP3PrxROH3QubMCvj4tEQbv//0Bh6z4JZqE1jAcQgjmIlzjWRrQR3pUXi0Tu43l3q36rB4fhMRhVLZwHtchOyXo6UociNIHaeOQRi8qut69XZOjvW5UiN; 4:j9eIDY1zxypJQMft4AMVw34bCcrnehTYNhHeWcoroZ+/VpoWf6KDjrGKj6tb8SLhhAqKGZl0vdDUIKD096U6jAGA+P2Iz2F5LmKhe2erkQP59bCAhFQ9N7m/9almzerEPOqgF5Juare85Q9yeZVOWR+rIrT7luxBuPQkLzB9dRKTFCK6P1wAqHW3bxNAG+YHnmqFbUm8LNBQS5ZbEBkua9J9H6DmMpGUhOrfHhxJ/bOIUwUWE6H7xtezUxeyAqH/9o+mj9UYHQYLXveyiFDAQ9vzT0s2nLFs0pOhxo9TjDO9WW8Z6sfUvlHRqol7eQUbyHoYSQvA5LO3ZImlyWEA4oJ9QBBkOx9JUq7WvgtvsqA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231232)(944501410)(52105095)(3002001)(6055026)(6041310)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR0401MB2432; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2432; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(376002)(366004)(39860400002)(346002)(396003)(199004)(189003)(106356001)(2906002)(3846002)(5009440100003)(6512007)(86362001)(575784001)(478600001)(44832011)(36756003)(7736002)(5660300001)(6116002)(486006)(97736004)(4326008)(11346002)(956004)(476003)(6486002)(2616005)(446003)(386003)(6506007)(16586007)(53936002)(25786009)(81156014)(59450400001)(47776003)(52116002)(16526019)(66066001)(51416003)(6636002)(105586002)(316002)(50226002)(6666003)(8936002)(50466002)(8676002)(26005)(68736007)(305945005)(48376002)(81166006)(76176011)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2432; 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; VI1PR0401MB2432; 23:5lZyzrNDBjjuRywN+t2dMewhONPtxRcOtKWUram?= =?us-ascii?Q?gESBpjuhxD1ULByr+tmLxPZ0cCz4+qfSGryN1y6XKltVz9quhgY4JB4LDvcY?= =?us-ascii?Q?fAuswvjOL6lsX7riECK6EYbGyyeqIPoHVM7DEFhwbTD5aLQY/UiYnwN90Awv?= =?us-ascii?Q?Yhk/lwqmnlHlRcqi4ba2AVY8+EogW7r6yPk/6Q+Rq0c1uON2P/TuwVqI4Eo6?= =?us-ascii?Q?+HfdjJxw1q6keSHfS2fRPAsHlaTL4tWFUNhBIcYS8uwXBIFoJIKZq3v2xmh+?= =?us-ascii?Q?0hoqgh444uLLCct4Jc00+618q4VMK1eA+rx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Z+449HKQvrUaj98Q57xJIf0KWN5HLWNp/2evGsXK728msT33obs/ei/r79Q8C+xnhuh8Cw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 7:ZnIJOYe+F9YFHZiA3L5GZ9kbyJ8EaD6sYJ89i1D6XnJX3WUJZ1ytDQIxo9+NN7q6TH2TiuKeuaMxiXSg/1v/lNkQTfTY1UuLsJs6PUeWnpLxQsGcnbnQryVScjXXcONwVmGTn0CGMEjSFvhWlrlRr5WNJ5rad+em8nWRIGgXdiVg35Rw8vFudQCW/K+ji5BU40DCAahOKU4VldLggvQePvcES0HjMf4BELb3WV8yk2L+YHpzmnzUq4YpwV/QOJe8 X-MS-Office365-Filtering-Correlation-Id: bd46af95-6f74-4a56-9a54-08d5ab5ea87d X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 10:15:37.4091 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd46af95-6f74-4a56-9a54-08d5ab5ea87d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2432 Subject: [dpdk-dev] [PATCH 6/7 v3] raw/dpaa2_cmdif: support enqueue dequeue operations 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: Thu, 26 Apr 2018 10:15:40 -0000 Signed-off-by: Nipun Gupta --- doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf | 1 + drivers/raw/dpaa2_cmdif/Makefile | 2 + drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 136 ++++++++++++++++++++++++++ drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 23 +++-- drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h | 35 +++++++ 6 files changed, 192 insertions(+), 6 deletions(-) create mode 100644 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index 12d3e5c..a2f9fde 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -39,6 +39,7 @@ The public API headers are grouped by topics: [bnxt] (@ref rte_pmd_bnxt.h), [dpaa] (@ref rte_pmd_dpaa.h), [dpaa2] (@ref rte_dpaa2_mempool.h), + [dpaa2_cmdif] (@ref rte_pmd_dpaa2_cmdif.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 0ab164f..f2f5237 100644 --- a/doc/api/doxy-api.conf +++ b/doc/api/doxy-api.conf @@ -38,6 +38,7 @@ INPUT = doc/api/doxy-api-index.md \ drivers/net/i40e \ drivers/net/ixgbe \ drivers/net/softnic \ + drivers/raw/dpaa2_cmdif \ drivers/raw/dpaa2_qdma \ lib/librte_eal/common/include \ lib/librte_eal/common/include/generic \ diff --git a/drivers/raw/dpaa2_cmdif/Makefile b/drivers/raw/dpaa2_cmdif/Makefile index 66f9c0e..fdb0ec8 100644 --- a/drivers/raw/dpaa2_cmdif/Makefile +++ b/drivers/raw/dpaa2_cmdif/Makefile @@ -30,4 +30,6 @@ LIBABIVER := 1 # 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_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c index 9044489..521883c 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c @@ -53,8 +53,144 @@ return 0; } +static int +dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev, + struct rte_rawdev_buf **buffers, + unsigned int count, + rte_rawdev_obj_t context) +{ + struct dpaa2_dpci_dev *cidev = dev->dev_private; + struct rte_dpaa2_cmdif_context *cmdif_send_cnxt; + struct dpaa2_queue *txq; + struct qbman_fd fd; + struct qbman_eq_desc eqdesc; + struct qbman_swp *swp; + int ret; + + DPAA2_CMDIF_FUNC_TRACE(); + + RTE_SET_USED(count); + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + DPAA2_CMDIF_ERR("Failure in affining portal\n"); + return 0; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + cmdif_send_cnxt = (struct rte_dpaa2_cmdif_context *)(context); + txq = &(cidev->tx_queue[cmdif_send_cnxt->priority]); + + /* Prepare enqueue descriptor */ + qbman_eq_desc_clear(&eqdesc); + qbman_eq_desc_set_fq(&eqdesc, txq->fqid); + qbman_eq_desc_set_no_orp(&eqdesc, 0); + qbman_eq_desc_set_response(&eqdesc, 0, 0); + + /* Set some of the FD parameters to i. + * For performance reasons do not memset + */ + fd.simple.bpid_offset = 0; + fd.simple.ctrl = 0; + + DPAA2_SET_FD_ADDR(&fd, DPAA2_VADDR_TO_IOVA(buffers[0]->buf_addr)); + DPAA2_SET_FD_LEN(&fd, cmdif_send_cnxt->size); + DPAA2_SET_FD_FRC(&fd, cmdif_send_cnxt->frc); + DPAA2_SET_FD_FLC(&fd, cmdif_send_cnxt->flc); + + /* Enqueue a packet to the QBMAN */ + do { + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1); + if (ret < 0 && ret != -EBUSY) + DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret); + } while (ret == -EBUSY); + + DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n"); + + return 0; +} + +static int +dpaa2_cmdif_dequeue_bufs(struct rte_rawdev *dev, + struct rte_rawdev_buf **buffers, + unsigned int count, + rte_rawdev_obj_t context) +{ + struct dpaa2_dpci_dev *cidev = dev->dev_private; + struct rte_dpaa2_cmdif_context *cmdif_rcv_cnxt; + struct dpaa2_queue *rxq; + struct qbman_swp *swp; + struct qbman_result *dq_storage; + const struct qbman_fd *fd; + struct qbman_pull_desc pulldesc; + uint8_t status; + int ret; + + DPAA2_CMDIF_FUNC_TRACE(); + + RTE_SET_USED(count); + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + DPAA2_CMDIF_ERR("Failure in affining portal\n"); + return 0; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + cmdif_rcv_cnxt = (struct rte_dpaa2_cmdif_context *)(context); + rxq = &(cidev->rx_queue[cmdif_rcv_cnxt->priority]); + dq_storage = rxq->q_storage->dq_storage[0]; + + qbman_pull_desc_clear(&pulldesc); + qbman_pull_desc_set_fq(&pulldesc, rxq->fqid); + qbman_pull_desc_set_numframes(&pulldesc, 1); + qbman_pull_desc_set_storage(&pulldesc, dq_storage, + (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1); + + while (1) { + if (qbman_swp_pull(swp, &pulldesc)) { + DPAA2_CMDIF_DP_WARN("VDQ cmd not issued. QBMAN is busy\n"); + /* Portal was busy, try again */ + continue; + } + break; + } + + /* Check if previous issued command is completed. */ + while (!qbman_check_command_complete(dq_storage)) + ; + /* Loop until the dq_storage is updated with new token by QBMAN */ + while (!qbman_result_has_new_result(swp, dq_storage)) + ; + + /* Check for valid frame. */ + status = (uint8_t)qbman_result_DQ_flags(dq_storage); + if (unlikely((status & QBMAN_DQ_STAT_VALIDFRAME) == 0)) { + DPAA2_CMDIF_DP_DEBUG("No frame is delivered\n"); + return 0; + } + + fd = qbman_result_DQ_fd(dq_storage); + + buffers[0]->buf_addr = (void *)DPAA2_IOVA_TO_VADDR( + DPAA2_GET_FD_ADDR(fd) + DPAA2_GET_FD_OFFSET(fd)); + cmdif_rcv_cnxt->size = DPAA2_GET_FD_LEN(fd); + cmdif_rcv_cnxt->flc = DPAA2_GET_FD_FLC(fd); + cmdif_rcv_cnxt->frc = DPAA2_GET_FD_FRC(fd); + + DPAA2_CMDIF_DP_DEBUG("packet received\n"); + + return 1; +} + static const struct rte_rawdev_ops dpaa2_cmdif_ops = { .attr_get = dpaa2_cmdif_get_attr, + .enqueue_bufs = dpaa2_cmdif_enqueue_bufs, + .dequeue_bufs = dpaa2_cmdif_dequeue_bufs, }; static int diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h index 5eb0885..598a621 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h @@ -9,18 +9,18 @@ extern "C" { #endif -#include - extern int dpaa2_cmdif_logtype; #define DPAA2_CMDIF_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "%s(): " fmt "\n", \ - __func__, ##args) + rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "dpaa2_cmdif: " \ + fmt "\n", ## args) + +#define DPAA2_CMDIF_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, dpaa2_cmdif_logtype, "dpaa2_cmdif: %s(): " \ + fmt "\n", __func__, ## args) #define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_LOG(DEBUG, ">>") -#define DPAA2_CMDIF_DEBUG(fmt, args...) \ - DPAA2_CMDIF_LOG(DEBUG, fmt, ## args) #define DPAA2_CMDIF_INFO(fmt, args...) \ DPAA2_CMDIF_LOG(INFO, fmt, ## args) #define DPAA2_CMDIF_ERR(fmt, args...) \ @@ -28,6 +28,17 @@ #define DPAA2_CMDIF_WARN(fmt, args...) \ DPAA2_CMDIF_LOG(WARNING, fmt, ## args) +/* DP Logs, toggled out at compile time if level lower than current level */ +#define DPAA2_CMDIF_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, "dpaa2_cmdif: " fmt "\n", ## args) + +#define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \ + DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args) +#define DPAA2_CMDIF_DP_INFO(fmt, args...) \ + DPAA2_CMDIF_DP_LOG(INFO, fmt, ## args) +#define DPAA2_CMDIF_DP_WARN(fmt, args...) \ + DPAA2_CMDIF_DP_LOG(WARNING, fmt, ## args) + #ifdef __cplusplus } #endif diff --git a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h new file mode 100644 index 0000000..483b66e --- /dev/null +++ b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#ifndef __RTE_PMD_DPAA2_CMDIF_H__ +#define __RTE_PMD_DPAA2_CMDIF_H__ + +/** + * @file + * + * NXP dpaa2 AIOP CMDIF PMD specific structures. + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** The context required in the I/O path for DPAA2 AIOP Command Interface */ +struct rte_dpaa2_cmdif_context { + /** Size to populate in QBMAN FD */ + uint32_t size; + /** FRC to populate in QBMAN FD */ + uint32_t frc; + /** FLC to populate in QBMAN FD */ + uint64_t flc; + /** Priority of the command. This priority determines DPCI Queue*/ + uint8_t priority; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __RTE_PMD_DPAA2_CMDIF_H__ */ -- 1.9.1