From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70079.outbound.protection.outlook.com [40.107.7.79]) by dpdk.org (Postfix) with ESMTP id 94BB75F16 for ; Fri, 14 Sep 2018 13:52:09 +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=gaJQiPIIKpVMXs5hSjoJF7CEnPCMmAvNcL3Z/8tdigg=; b=h8FRcps3/ldu8sBuu5FwI03CTDwN0RjTRnq7rLsVQPlAV9b1VFYAIa134qIOkfCVHlTl8/KhmcDDmNiMM/PYfcusJU6mcID3b1bNzzWNG7ZCBdpUcOz6/y1y/H3XBfusFqYlRZ62d0hrpgFZhdqHjZv3qZsb+zUGxFZFviQLZGY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from GDB1.ap.freescale.net (14.143.30.134) by VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:56::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Fri, 14 Sep 2018 11:52:05 +0000 From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, pablo.de.lara.guarch@intel.com, Ashish Jain Date: Fri, 14 Sep 2018 17:18:09 +0530 Message-Id: <20180914114810.14960-3-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180914114810.14960-1-akhil.goyal@nxp.com> References: <20180914114810.14960-1-akhil.goyal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: TY2PR06CA0045.apcprd06.prod.outlook.com (2603:1096:404:2e::33) To VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:56::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4aac3d8-0d99-4996-dbd4-08d61a387fa5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4893; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4893; 3:vhnWpuPDw+dH+cQ29tTh+uUrAiZ2mnl5FPdINGMszbMFggLqffJaL3apQc2nr/V4A1k7Z7e1wbA1LLdJ9OFZfsvmCQUVbnWDThpdwiAbpAGeStPiTqmQ5qEO55luHVNdV2UM6FbPNER/jmdbjgrL51P+xcb67MCuIGPtTOSG+TA84X4RuDhM8HapFUw6Cy8Re15ydoAtm2e9vOzB6oSd4E+Sdk/H6Jb4N3OdkP523ohIESlMCuGq/96vWCCmS661; 25:+xWWWuPsRUgcZuqzmem6KEaMfYESN8s422n2Dtu2KFCtR8R8B4lMUN07fO4Ng6NtOXZ0CF3w28LCyuW23pk/BafdYqviWj+ctnqpOFLS/CSjEMWOV6j+NLtdxnICBf6v6SazIxNZR5RwmBnYAqH9ZXN0Fe2LW0gYiQbCFhJn4yOtz9WK8UQCA+vFYBNG63MvBTt7Jwh5JEOYVHykxhG4Y92MzCW74YWEL7U++5oGDZHJCYku7fFzBmVA61990W3ULyLLyr61samCROyhSaWSfNi7NRH4sW1D7nMQYjEnJo0qWP/jkc5zPJYfdZzR/xQsYTtrHaZL55XIcBZJFq0lQA==; 31:x4Fot+CqwgrGd+pYhkuKFxhR4V1p7XDDAvGUSbzCJBuwgwHJoF+aVjJXVnbb2aHpTrw9hiRTN8ASaHi4/AF012keuXI6kWkpB+yiIwZ+qKuGLOYjWn/2D0db1niVrYjP9qVgFbTmJ+yU44a3d+kbsqE4F4G7aHcFzzDwFbidxQxGNvIf24KzjjfQCwTU9tNvyHT+WE0slaj05KpNLtZ2OkwE5i9yJO8bBlfTWi0WjbY= X-MS-TrafficTypeDiagnostic: VI1PR04MB4893: X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4893; 20:d8aJrXL1/wcSz8A+lV1pXAqt44tuD8XdyIZKsstDhcgHts9zoorMNiMkYWYGj1h10ybHZ9ospbi8yVq9e0i/dgKQckQX8DI43BnqsYc5OUt2V6WWlYgV3VWYvP62RMUYM2CtxePQEZEWXQDr/F6lx1DK42jRCkY/5WldaLqj4hfuOGN98e4wepmflt6uUFsQNm5n73w+6UZOgGxa0kwm7//2K9Re87B+mM4k4yvd9wswHtzPbB+eUIhs9+GlNOm4VewH1HxHTKEyymVR6TwCGqDxQx0eVNkhvNYDxBJZD5TJgXjLW39FoWBgqR/IqPnefKzRhHHvUIqSm3EsvNE2a/a45BfniXrevA/wVdiHziX9blo4xQZ9tj+VmvgeFXHKUMcke3EaavOdipoLuy2qo3AOM0KUt5u/r+504ty2gEKK9P6N5c9nvoqGHnFEQtcgv0oa2lWOnGyPXajMc1Y4ReVrhpKiWQtmgz+JpOsV45OumXojTNWb262TELeMOdZq; 4:ESylMMEiMfO+a9vHFcBAQ2RfovUpZcQNKs82AerprFgQUHFObPDGzr13i/LlioXxKfpz9szrSUtDAQM5AYM7Y4MCJHDJMauCYvYnmcPPSe/C/fjHSnAa+PIc23XeQmZj+f/k2eA5oZ2DR8F7ceFlsGU09bql9CycEwttoF8c7aqwZxi6av1Qcm2sJa9rsRn+32QjF3vkGiJ411+sf8D+znydyiL59U2w6XjHI9gMfKTFUNg9JlhjMmloD1wAJ3FNLgETbeWzzxF7KBFfs4OrDcTlc8LXAkrZNu7uIsGI1zVUqoMP6nHGTB3XW5Zw58Cm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:VI1PR04MB4893; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4893; X-Forefront-PRVS: 07954CC105 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(136003)(346002)(366004)(39860400002)(199004)(189003)(86362001)(7736002)(105586002)(25786009)(6486002)(1076002)(5660300001)(6116002)(3846002)(47776003)(5024004)(53936002)(66066001)(2351001)(2361001)(106356001)(305945005)(14444005)(50466002)(36756003)(6916009)(2906002)(6512007)(9686003)(4326008)(85782001)(48376002)(316002)(16586007)(186003)(16526019)(8936002)(486006)(81166006)(8676002)(50226002)(81156014)(5009440100003)(478600001)(68736007)(476003)(2616005)(51416003)(52116002)(11346002)(446003)(76176011)(26005)(956004)(386003)(33896004)(97736004)(6506007)(110426005)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4893; H:GDB1.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; VI1PR04MB4893; 23:CNevC9e1t7NhupT1rwzPdEZM+tbTIwc/pH9s/3uDw?= =?us-ascii?Q?NMauuY5xyIcbNzWIkqCm/PNYTbyQtUyyyGDbYFYJn769sVXRuNOrQJEc8SyA?= =?us-ascii?Q?D9Vih/13XdiWE9Ul0y4giilVEmG2oP6PjeINk8EwhWzsdUNU0LeWcDvZojhX?= =?us-ascii?Q?7ip/LFBLOBkhSFBj8AeIikUOkXDBg+ZYLAw4oM3p4hIYR/gO55hnhNLX0vPO?= =?us-ascii?Q?vSLJ6aA5aXkd1SJKv6ljV8v2rV28zJU5vN6E1q0ImqxOPznH04buX002IfA8?= =?us-ascii?Q?Lpzh3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u3zZw8MmpIaP/Pp/7/b5m/Cu9hg2dJdUyeCUY?= =?us-ascii?Q?texQTwbrhTsUTJFFzsXd/SDFRbp+aRsaIX4n428ZlCN43Hh8xkM8+8VOWBJz?= =?us-ascii?Q?01tTsr2DNMfaP9OL0/u8YOIwWSXBE9a2IMUGXqw7D8lKxx2bYlTwxt2KOBi1?= =?us-ascii?Q?7Km2/QvWMsSMcORbuhKenqkRhtyTJ+WABlEH0JAnncWsz30pdln6k0NyseBv?= =?us-ascii?Q?g3vb1PGOxsSJEZdQeDzzIO8LT0=3D?= X-Microsoft-Antispam-Message-Info: jw2vk7kEmJJ8MYFPNyYs9Y08csCsOxQoVhhuDKTzwzuv+doMwwpqeYre2V+2hIELOL6T116sWtefEtnpg7NLLwot+98r6aZ/Y6d4OZAXQMD5FhwjKJz0Ef13rc1ClTO9yORWFrb1LHa14At1bpWzSPItJd5o1M59nvBk7OAZu2N3cIChgZdkOWYALsWZLfRyO6Tu0Q1xtfnIjrEwoa7owFKaBpCoxDoif690ZgEJL4Og/9+5UdJAloQiGagk7dUGzGQZOgv+THzqxhRGta4CoZWPilD15KZSIbZSz8wjxSOlXHUczXYZqHvjdR03qVRag2oWkWEkqJ6mM+LvJO2Y61d0kIrlKnpBtxm9mAEnK0w= X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4893; 6:nvCNnFiA/7MOaahymWVc63Bv3xjR2j5YCK8VAUzHLLj6z6lf3i9PPGNYi9iODmroBB7eQEl3FyzrjwX6n56UrB/6yrII6whzxUH42SPVJKdHgiWEa1S3YqKxUXM3Ozfr/HyUfUBy9IassC2peO9Duv+C9xK2iaBcG3lRCro0YGpanm0toptYNxvEV4BwMKgdqtlC/z13JXif03zNA1TiqEopK+WErnkwG2klKqAt2op2VnAYfM6aFZwt98Zs3e7or6qEVa+Gj7P7deedotL1wVXQ7HZAKTQuG+1vVYD8hFb0Z+fa7/rRfUM1/TnX14/7netDzfvK1GpbT1LW+gtknNSTXk6Q9ipcm27mpjF2FiKmC+/ObXDbN+fBkwRkEdJ2JiKGATt3K8DqNCEdb0NkUviL3oEOcbRk216VY/SF1HmtAzQ9yJDB/8Z5Vc6cGIyDh0Qu4ZmJIi38aIPx6A/GxA==; 5:gP+c0OQSHXKKiHw8l0tZ9h6E24sEbJTEAPdWLChoO1mjnPkmi3N7eR6kzaDiJ5Uhq0Xh+GKrNHyzwzCINJYEcPjo6pbDtrSARFEC4F+8yNoewe1qkZW4rlViJs3B0YThJFAs6saotCF3Ft2T6meCana0ezxwMnYFOQuomfhEujU=; 7:vPEUuW3bx0hRjuteXXHhbcJ9oCZMu+lZPQBV0ypBAftjj/yIQI80MlmQi0VeKYnYhIKbHKqNXRYNlT9jBtjg5juQMFMU3PJnMKOmIKPgfCy1aNYAyCUfGN7sqOobN1dg9hnQO0+GqEMJKNdD6urYv4UUfkIRRyqxXzkZjd5ivx8kYr+etVCjiTrciwN8XfV+yWUHkgxRhRbhQcJkkmgDdNhLOBnOEv1YVJ6bXi02VQImCTSjx0Z+J7+DKSW58L1Z SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2018 11:52:05.7976 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4aac3d8-0d99-4996-dbd4-08d61a387fa5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4893 Subject: [dpdk-dev] [PATCH 2/3] crypto/dpaa2_sec: support for atomic queues 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, 14 Sep 2018 11:52:09 -0000 From: Ashish Jain Signed-off-by: Ashish Jain --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 57 +++++++++++++++++++-- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index ae38f507b..781595b38 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1209,6 +1209,7 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, struct dpaa2_sec_qp *dpaa2_qp = (struct dpaa2_sec_qp *)qp; struct qbman_swp *swp; uint16_t num_tx = 0; + uint32_t flags[MAX_TX_RING_SLOTS] = {0}; /*todo - need to support multiple buffer pools */ uint16_t bpid; struct rte_mempool *mb_pool; @@ -1240,6 +1241,15 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, dpaa2_eqcr_size : nb_ops; for (loop = 0; loop < frames_to_send; loop++) { + if ((*ops)->sym->m_src->seqn) { + uint8_t dqrr_index = (*ops)->sym->m_src->seqn - 1; + + flags[loop] = QBMAN_ENQUEUE_FLAG_DCA | dqrr_index; + DPAA2_PER_LCORE_DQRR_SIZE--; + DPAA2_PER_LCORE_DQRR_HELD &= ~(1 << dqrr_index); + (*ops)->sym->m_src->seqn = DPAA2_INVALID_MBUF_SEQN; + } + /*Clear the unused FD fields before sending*/ memset(&fd_arr[loop], 0, sizeof(struct qbman_fd)); mb_pool = (*ops)->sym->m_src->pool; @@ -1256,7 +1266,7 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, while (loop < frames_to_send) { loop += qbman_swp_enqueue_multiple(swp, &eqdesc, &fd_arr[loop], - NULL, + &flags[loop], frames_to_send - loop); } @@ -1281,6 +1291,9 @@ sec_simple_fd_to_mbuf(const struct qbman_fd *fd, __rte_unused uint8_t id) DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)), rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size); + diff = len - mbuf->pkt_len; + mbuf->pkt_len += diff; + mbuf->data_len += diff; op = (struct rte_crypto_op *)(size_t)mbuf->buf_iova; mbuf->buf_iova = op->sym->aead.digest.phys_addr; op->sym->aead.digest.phys_addr = 0L; @@ -1291,9 +1304,6 @@ sec_simple_fd_to_mbuf(const struct qbman_fd *fd, __rte_unused uint8_t id) mbuf->data_off += SEC_FLC_DHR_OUTBOUND; else mbuf->data_off += SEC_FLC_DHR_INBOUND; - diff = len - mbuf->pkt_len; - mbuf->pkt_len += diff; - mbuf->data_len += diff; return op; } @@ -2879,6 +2889,38 @@ dpaa2_sec_process_parallel_event(struct qbman_swp *swp, qbman_swp_dqrr_consume(swp, dq); } +static void +dpaa2_sec_process_atomic_event(struct qbman_swp *swp __attribute__((unused)), + const struct qbman_fd *fd, + const struct qbman_result *dq, + struct dpaa2_queue *rxq, + struct rte_event *ev) +{ + uint8_t dqrr_index; + struct rte_crypto_op *crypto_op = (struct rte_crypto_op *)ev->event_ptr; + /* Prefetching mbuf */ + rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR(fd)- + rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size)); + + /* Prefetching ipsec crypto_op stored in priv data of mbuf */ + rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR(fd)-64)); + + ev->flow_id = rxq->ev.flow_id; + ev->sub_event_type = rxq->ev.sub_event_type; + ev->event_type = RTE_EVENT_TYPE_CRYPTODEV; + ev->op = RTE_EVENT_OP_NEW; + ev->sched_type = rxq->ev.sched_type; + ev->queue_id = rxq->ev.queue_id; + ev->priority = rxq->ev.priority; + + ev->event_ptr = sec_fd_to_mbuf(fd, ((struct rte_cryptodev *) + (rxq->dev))->driver_id); + dqrr_index = qbman_get_dqrr_idx(dq); + crypto_op->sym->m_src->seqn = dqrr_index + 1; + DPAA2_PER_LCORE_DQRR_SIZE++; + DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index; + DPAA2_PER_LCORE_DQRR_MBUF(dqrr_index) = crypto_op->sym->m_src; +} int dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, @@ -2894,6 +2936,8 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, if (event->sched_type == RTE_SCHED_TYPE_PARALLEL) qp->rx_vq.cb = dpaa2_sec_process_parallel_event; + else if (event->sched_type == RTE_SCHED_TYPE_ATOMIC) + qp->rx_vq.cb = dpaa2_sec_process_atomic_event; else return -EINVAL; @@ -2905,7 +2949,10 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, cfg.options |= DPSECI_QUEUE_OPT_USER_CTX; cfg.user_ctx = (size_t)(qp); - + if (event->sched_type == RTE_SCHED_TYPE_ATOMIC) { + cfg.options |= DPSECI_QUEUE_OPT_ORDER_PRESERVATION; + cfg.order_preservation_en = 1; + } ret = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token, qp_id, &cfg); if (ret) { -- 2.17.1