From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F102A0547; Sun, 17 Oct 2021 18:22:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45CFC41152; Sun, 17 Oct 2021 18:21:49 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60079.outbound.protection.outlook.com [40.107.6.79]) by mails.dpdk.org (Postfix) with ESMTP id 6E6ED4113D for ; Sun, 17 Oct 2021 18:21:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cbDKwVtLDvdmJqJq/dfQI+GBnTC2JYq/CWj8l7FjbpSMkmkspk8KZRT39aSvzb1JlgkDGzlOgb43cfmeTxGb7QK9aNXDrlMm7/Dr+gxuj+gqBrRflMz2s3X4Fz7maguzTD6CihI5qX1FIZn7QD3OtZy3a1byFRh8uqDAVtc/8H/fWexYsfnq3HrxmmwOgjWgXgZjjQMwoDwLuiUOkxf9LAwVbfa/oblDCELA1q1iKlkohZoDrVLNgvkC5rKArnyfHg5fumRz82bfRi4dN/cNns3n9JfBa4eRU7Eo6+DRzV6d29eMyDtl5eqiYtXv0TcvjIrlJ0VK2Uh4iaS9YYn6Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hM1YExVC9ypiO1YsXFiAyDaTqzgZZszZZhcVa+m2EoY=; b=a52DKCtzG1GBrgneZ7WPjdEqMk0gxWfnkn4jhh88MC6vcho+moFSy9KssFQZSE3WzG+X2rq39DcFO3z5pkXr++itITj7NeoiHR9ajIlU+SUSFqfG31aFEY+BjzEFEH7DOAwqqdsUt8wymV6akvBPO3OS64umQQparGsK6FDFqY8ChC2GVrePSIPB2dGPTSBbLd7QC0WQ3pl9Al27PcIxyLn3ZixrV2imHy8PKn3ZQmqNaSPBEKRbhniJcw+PhnMHOZpQfthIS638twT0K4JtPRLslCEynssFo9P9DUw5k/P83jcTgMNUnpGMhx5BZhaQdCxLEeMFG4XjMgyiolFSmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hM1YExVC9ypiO1YsXFiAyDaTqzgZZszZZhcVa+m2EoY=; b=E4+Wr9CE6Nx7Mxb5q9cBcukfLrdgH/f0MQ9yzKF4U9bDakyKlyGQ5hjkYANLnbzrfBPWj++7xpEMS9fR0bcZnsVi25VEQS2ilVzIW0SSgaZhN5MIH3MNRR3A980lV4SygBgqNziDovnRq2BgnSfjdZLPLZ84My9KE32xu8yPn/g= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8615.eurprd04.prod.outlook.com (2603:10a6:10:2da::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15; Sun, 17 Oct 2021 16:21:45 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%3]) with mapi id 15.20.4608.018; Sun, 17 Oct 2021 16:21:45 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Sun, 17 Oct 2021 21:46:46 +0530 Message-Id: <20211017161651.9220-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211017161651.9220-1-hemant.agrawal@nxp.com> References: <20211013190032.2308-1-hemant.agrawal@nxp.com> <20211017161651.9220-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0053.apcprd01.prod.exchangelabs.com (2603:1096:4:193::7) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SI2PR01CA0053.apcprd01.prod.exchangelabs.com (2603:1096:4:193::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Sun, 17 Oct 2021 16:21:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc4d30a1-ebba-4cfa-1ede-08d9918a3689 X-MS-TrafficTypeDiagnostic: DU2PR04MB8615: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1051; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: An1Itq9wHhytK3l+SWRQCfS/BGtksLrqRc6Qykj0gqa5A2q2bdZdZFsQAP4o1IZsw5q4B8lIuwPobOU5Ec9Z5ujv3VYIOIca6yYmn1XX9Zri9RsH62b6Ap5KF4cBHtY6vP6amKLRWBIYgqQoeItgCI7dM4PoSULyHRWg0LrZ6ZrDc3btE2Yw58g8Tbnj7zW/jMltM8QiIkeH6g+Ezi4XPxNlj4J9hwqy0+CG6nmF+/b40IVFNQUNYssmUD2D5gAQHNiss+V1YuWNj2yTjdorMnvAPbR3jQ970QuL6CgwVb1Zvss9ngd43/4uHq+MwPx/IfUhrNSCGZMUHkusG5fUuqjtGQDmpRPEBqOQN3DBLAMVygCtDwCeGSy2pr05XJoFhN8qbEtu4xdQtmvtLK5oFkBKjRP8vWzSWBSw/KW7hD7opHPSmTBCJNdf+1en+YVsUFCizEdJiK6J+WiG8Ek8QeS2LRTQjUUtMvVU8mWMeSmoihMUKrO0BaChN6PSlUPOq/n1VzC9Y0fLUxGApEQpTIofECzxwTQdM+h7QfHuCe0YOZi06qS8GIzMZoVs/i87tgD8ZCpapv+/gz6xwGIYrmfAp7O65cBLDcbwR51vV5VXWmV6W/vrCOc81Z1FpATiIx40ra0A9FIcwZ/60wv67m9KbWgC0hauk/ALarV286yRH8j+jAbGPUgXiDgXCj8dwMJNGYCBgGwoPTAdX1j8eg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(6486002)(66476007)(8936002)(66556008)(66946007)(86362001)(52116002)(36756003)(5660300002)(38350700002)(8676002)(38100700002)(508600001)(6506007)(26005)(44832011)(4326008)(6512007)(2616005)(83380400001)(1076003)(2906002)(316002)(186003)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zcC5naNTRW2/Jl9Ta9RjXDZHL7mfahAR7D7tXlh+XQuCZ8EOpRQCgK35I2b5?= =?us-ascii?Q?X1GQToRJgCgHMpoPFH9E9dts5Wey2CUHMf4wS03eaxC0ZTnNmLtE5/5FIFYJ?= =?us-ascii?Q?5YUyQTX2l5QovUZYs0Ka9ds8/AHtapSKKoJc+rUSFg0Gn0k1H5ke4gvkiLCS?= =?us-ascii?Q?fo8dnag/69ZbIsKr7t6MifU2PnyHavzmIeYrpqVlVzr205bV22z9l/Vo6K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xbL67tpv4V2L3sWyXZN8IiKoZZ4HZAQ3jx2NXsWzYReuOG09TwP?= =?us-ascii?Q?sSBQALej9uDBWr1KejFqrNDcwemReelBS6mqWtL4gXXxHsOyFCt0HQJIbXpL?= =?us-ascii?Q?POLhIDA14O8vh7+YyL9uDijr/4Zsz/s4hGc2zG/auN3EKmuL79o/XQQBjzVC?= =?us-ascii?Q?bTNUi0NOPAJD1XYNNk4PO493+qTDSxOdmPnagVrGMIbF1aCVL1lBA+NaNWkP?= =?us-ascii?Q?7JKJD78DggaJzcxCUVkR9Gd5?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc4d30a1-ebba-4cfa-1ede-08d9918a3689 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2021 16:21:45.7987 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: T1/GfT3xdsbWod/3uYq2Ih4dH3DqkVSlElaclNSAK48XmDgQN7yRibbWs3hsGzMybA7xa/rBS1GjbmysvXlm1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8615 Subject: [dpdk-dev] [PATCH v5 10/15] crypto/dpaa2_sec: enhance error checks with raw buffer APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Gagandeep Singh This patch improves error conditions and support of Wireless algos with raw buffers. Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c | 31 ++++----------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c index 4f78cef9c0..a2ffc6c02f 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c @@ -355,16 +355,7 @@ build_raw_dp_auth_fd(uint8_t *drv_ctx, data_len = total_len - ofs.ofs.auth.head - ofs.ofs.auth.tail; data_offset = ofs.ofs.auth.head; - if (sess->auth_alg == RTE_CRYPTO_AUTH_SNOW3G_UIA2 || - sess->auth_alg == RTE_CRYPTO_AUTH_ZUC_EIA3) { - if ((data_len & 7) || (data_offset & 7)) { - DPAA2_SEC_ERR("AUTH: len/offset must be full bytes"); - return -ENOTSUP; - } - - data_len = data_len >> 3; - data_offset = data_offset >> 3; - } + /* For SNOW3G and ZUC, lengths in bits only supported */ fle = (struct qbman_fle *)rte_malloc(NULL, FLE_SG_MEM_SIZE(2 * sgl->num), RTE_CACHE_LINE_SIZE); @@ -609,17 +600,7 @@ build_raw_dp_cipher_fd(uint8_t *drv_ctx, data_len = total_len - ofs.ofs.cipher.head - ofs.ofs.cipher.tail; data_offset = ofs.ofs.cipher.head; - if (sess->cipher_alg == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 || - sess->cipher_alg == RTE_CRYPTO_CIPHER_ZUC_EEA3) { - if ((data_len & 7) || (data_offset & 7)) { - DPAA2_SEC_ERR("CIPHER: len/offset must be full bytes"); - return -ENOTSUP; - } - - data_len = data_len >> 3; - data_offset = data_offset >> 3; - } - + /* For SNOW3G and ZUC, lengths in bits only supported */ /* first FLE entry used to store mbuf and session ctxt */ fle = (struct qbman_fle *)rte_malloc(NULL, FLE_SG_MEM_SIZE(2*sgl->num), @@ -878,7 +859,7 @@ dpaa2_sec_raw_dequeue_burst(void *qp_data, uint8_t *drv_ctx, struct qbman_result *dq_storage; uint32_t fqid = dpaa2_qp->rx_vq.fqid; int ret, num_rx = 0; - uint8_t is_last = 0, status; + uint8_t is_last = 0, status, is_success = 0; struct qbman_swp *swp; const struct qbman_fd *fd; struct qbman_pull_desc pulldesc; @@ -957,11 +938,11 @@ dpaa2_sec_raw_dequeue_burst(void *qp_data, uint8_t *drv_ctx, /* TODO Parse SEC errors */ DPAA2_SEC_ERR("SEC returned Error - %x", fd->simple.frc); - status = RTE_CRYPTO_OP_STATUS_ERROR; + is_success = false; } else { - status = RTE_CRYPTO_OP_STATUS_SUCCESS; + is_success = true; } - post_dequeue(user_data, num_rx, status); + post_dequeue(user_data, num_rx, is_success); num_rx++; dq_storage++; -- 2.17.1