From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0047.outbound.protection.outlook.com [104.47.2.47]) by dpdk.org (Postfix) with ESMTP id 0EBAC1BB22 for ; Sat, 7 Apr 2018 16:35:03 +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=SzC70OCHhojvbyB740NzRSi9LGAeO0kPdGx5xTlf3Hc=; b=Yx5Qh5zgVH0bjN7c3H8FYNvzbtXjeS/lyME/BSr+KM2h4KUYhIe29wuJfZXLNq9JP8U6nqsmj6AybuIgFTZw8bh2RBSkCnH19PqyVk0qEETDg+TpNiqIX4EFXBigARJhuTe6nQWRZvapRl2pIEgDUbF/YayMwdei6KuI+3+R1GA= 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 DB6PR0401MB2424.eurprd04.prod.outlook.com (2603:10a6:4:4a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Sat, 7 Apr 2018 14:35:01 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Sat, 7 Apr 2018 20:04:03 +0530 Message-Id: <1523111645-8076-8-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523111645-8076-1-git-send-email-nipun.gupta@nxp.com> References: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> <1523111645-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: PN1PR0101CA0017.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::27) To DB6PR0401MB2424.eurprd04.prod.outlook.com (2603:10a6:4:4a::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9202d243-63f9-4e3a-8ef8-08d59c94bf4e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0401MB2424; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 3:Ke9fWHJQK0d9dn+HwqCvDINtsZNLBBW0/w+P6eEGeeIKKtQIsn1SH08gGU0pz7PQkl+s/FJDLtKr37V1GjQkAsH3GDlo1SR96hGpw63yh7Z9QqzPTl8sFkLb+O/J7ZnuDkUSA3k5QFdA7BfY0rAag8Ih9310uP9qdTRnyExeiok6qJhpST8kHoRlT9MP2V8rf3Sqr/ndpaa4Bcnph1ETz0A60q2o+zXUXHsI5V9u8ZmZHRXcW5XDrjkuL8qYr6Il; 25:f6AMNsCUW4nwAW+idO/tbmEKZNJzHeuTW9sXBbG5rtjjtTHCNqmWEOscMMR3Rjz28CzzfJM8eWiBvUwgO5gYTj4Wxi40jIgQtVNIrbd+bcVSBeq7RXDb+qDS9RjLjmwngo+EQRUsBjLA5fic+g5jQssbDZF3l+fdMtKVkeR+w2b8H1HCN4yQIxAYHQMJBpK7tl0tGf1/s3e3zsSCL2EunP0lGbtH31apUPflP1v54fzHiuGkToSTDTcrbJqD9xCZueRhaJsWEESUpbMQD6NKQXA6JKNq+B/Si1rDF6TbTCqSv3nrhWX96yxp3fVLgkjYfOe19HmIzsCY5rJZ+8Anww==; 31:4IJF9RbzXPnmOVpuhENSYNpK0zyy2NKXhOWLOIHqMvVgTp4J/Yom+FtFlMvp9fOs8dryWseKyKe11NlCFrQ2uF64kNYnw5lZ5S2cOkFphi9UCkZjtIzrnqF7fzkWhXgomNS4MAJvwZxRMuhR1jvWNanXY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test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231221)(944501327)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0401MB2424; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0401MB2424; X-Forefront-PRVS: 0635D5275E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(366004)(376002)(346002)(39860400002)(189003)(199004)(105586002)(26005)(446003)(5009440100003)(48376002)(50226002)(186003)(16526019)(53936002)(47776003)(50466002)(52116002)(476003)(6486002)(36756003)(76176011)(305945005)(575784001)(86362001)(66066001)(6512007)(6116002)(2616005)(51416003)(956004)(2906002)(16586007)(3846002)(4326008)(7736002)(8936002)(478600001)(81156014)(81166006)(486006)(11346002)(5660300001)(97736004)(316002)(6636002)(55236004)(59450400001)(8676002)(25786009)(386003)(106356001)(6506007)(68736007)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0401MB2424; H:b27504-OptiPlex-790.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; DB6PR0401MB2424; 23:57UcVTUJE2SSOAuTij9EVjJNrIJoWGRIKFia7yM?= =?us-ascii?Q?CeLZG7vwSaIAIydQ08XFfqODpxpcl12sN5Dj2QlenCcl30yKzbZE7Uh/V67l?= =?us-ascii?Q?ZmFOhBGqZn+zTA5KJ59eUBSx00l6yYtZmMhcSx1VXcW97DVQAr0UrdkP1fpD?= =?us-ascii?Q?PZRwAU9s2s8YZ5vRlfdCB4pJthIib+KWLfYY975rnm+6ItLRtsTMSbjJaRDR?= =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jBke7Oa2RwexgwS?= =?us-ascii?Q?zK67C/G5fxpw1EIE4T8CdK930Z949AiBw0TA96O5TkSCCRJynZs8YhX6D2yC?= =?us-ascii?Q?dDa/hYIjM3ffOZK3TSk4g4FP/ZLGdr/vYUouWPd80+IKcF+Qn1eYlQRrWrKR?= =?us-ascii?Q?aNONR3FIfTz2eeKwh8DzQ3ob/px/ULLJ80/9TR943H7hTgSBQfiCnNtZpX7K?= =?us-ascii?Q?GKw=3D=3D?= X-Microsoft-Antispam-Message-Info: 9O3hSuL0atJ/xCYVlOOtwZjC+W6QpSwGh2aU0UqMlRKoLLTG+tPW1mKCUsDqinG8kMZDh7LrUlgoePvfRy1JT73eDkUDzXFqZT4D6u6TnjqWNKQhESldc69JmotQGSvk+WhUdF2ZU22r7xJ83UJuDO+VYjrl5RP9ElWEoS4GU1fnUTVu8Q2pfVbG+NS11yiw X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 6:y6MBcC5DYWovfEQ2lXsVMxNSXzgHPr5GpCRnwYDzHjDBtrcOKE8o9pTUAAI6oG19jTBXapqmYUUaoNqx+UMrscROFJ3sYS6rji+ZY+dDZ7Pct21msTMxqmVfk/b6+Due7WT2pfitmHP3UPjMsnsenLixCTCxO0+BOii46ywsrd4pcaZxQXrKvYVfnybh//GC4luSzr7+ySEsadVWkx2IQQnajqzFuSs58qNz+rZkVxPwwD7RYRnJi/BZYfTJm3uKN/6B5vACumZHtk1GEjRLTjrj00fuaoJq87PU7QsFH0g2i0JGx8CZeyS0VcUjArkOT6V9BkNQG/ft446pnHu/HFkR7gVgJO+vtsh2QT+kFqLifF65Tr3GndDWjc23EwhwWOFk6ydFYMM3jt55whtu6sUPrN6C185F4dGIo3bikSy67ZawfL3oTFqw/coxvLXILOrq1N8yA6xyu/myvjc6bg==; 5:hl+u8cxrPX0Zg6rRsCHtN6djc5IV8QqqTJGakYonPIt5S8EMFXMatBfhS4jv20WbR10DCApNae+FB2Ys+EEvPuzxa6U/vHAurEHlyvrQMHr/SxGFpLmboIDxP5s8OfzbDiykU7vcBl8DOp9sQAjKxNI2pm5ysOediR1wzm9bmgQ=; 24:VOuXiobyMLXedXTFMX6QHCwfXuZ9or9wgP8sXpycOoS3y78zSAWwtQoIwcdkHP0GgGMDsbRS2xjmj+QSsBnFCpdfSIxW1VFixI6ynMihwII= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 7:3TW+wJt6246QDEfGURmoy8WuYTROcZTQCbQ84BC1o7pqrvxVlneH+uaD7r5JHOwOhsFxeMHP3PNAsM1uLHSNBkgn04mYAETJfM+NsM77rp52Pqtyl7DZh/aifV3EFZb9UDECeCehef43rvzJJDsd9gwVngzEFzSPJ0QrzvDi3SPiOO0fl9E38s5pvO4jG9uXde19mVFCd7jULdW/OTtLIdGIW642GkoalqYZYdMQq1hzKqLFI6Ki+yi7e2fvr5yk X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2018 14:35:01.0545 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9202d243-63f9-4e3a-8ef8-08d59c94bf4e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2424 Subject: [dpdk-dev] [PATCH v2 7/9] 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: Sat, 07 Apr 2018 14:35:03 -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/rte_pmd_dpaa2_cmdif.h | 35 +++++++ 5 files changed, 175 insertions(+) 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 49fcec4..b9f28be 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -64,6 +64,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), [crypto_scheduler] (@ref rte_cryptodev_scheduler.h) - **memory**: diff --git a/doc/api/doxy-api.conf b/doc/api/doxy-api.conf index 59cb580..88088d6 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 \ lib/librte_eal/common/include \ lib/librte_eal/common/include/generic \ lib/librte_acl \ diff --git a/drivers/raw/dpaa2_cmdif/Makefile b/drivers/raw/dpaa2_cmdif/Makefile index 1d91d0c..c570827 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) += dpaa2_cmdif.c +SYMLINK-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF)-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..c26fc30 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_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, + (dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1); + + while (1) { + if (qbman_swp_pull(swp, &pulldesc)) { + DPAA2_CMDIF_ERR("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_DEBUG("No frame is delivered\n"); + return 0; + } + + fd = qbman_result_DQ_fd(dq_storage); + + buffers[0]->buf_addr = 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_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/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