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 B15ACA0C52; Thu, 12 Aug 2021 09:17:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74E2D4124A; Thu, 12 Aug 2021 09:16:26 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20049.outbound.protection.outlook.com [40.107.2.49]) by mails.dpdk.org (Postfix) with ESMTP id C495841247 for ; Thu, 12 Aug 2021 09:16:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AqL9Q4XvBeNv3//O5X24de8XeBwv8XiSVQWaItJkRe/pmY0UcA4BeHd4XeuDBqCaeW4sYRkFbG3Rv9LPHtfdN2Ehp+WJY0lQbjgbGYvXnuLY7xzvPq6XuOD+SyuvRHaU0LMkhOjZKsolBh5QrlT+o7lLUzOiF94yugsyLMVXWYYPAk/LR2Xo7KNX3wG1XqN5CxT2SQgETEABfNl5XDG/yvtaKYNJfcsQNjCD/wXFK+JHLJQ7uSLn6arHoVKs7FbTs9cjOsz4A+vARS5jyah2YThfuvc/Y6rC8yohwWarDmsQ1EIPzMaSRqf3+Q/3WtA5U+8Gf/i6t27RuwQqhODl3g== 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-SenderADCheck; bh=rr4BsOl+t6rzEldC/C0CdUGRGXMsFNIn885YREjSPAA=; b=MDctFDGtpqRQGRYNTxnb9uJE0dD0zDkNcjfVCv5uKfP4PBXUxJnDYU9Z4z4lVS/laDuKxyiSOK1bSHhtG57kxoML1me/SFTkFbrE2tmXCcPpxdP4ghIRKj4Y6XwgSZ+FZuPomazGVznVO3dT+lnulokcJdrKNEFbuslxdPOBgWFtguQTiVgFbaaxDihMwWR1ZJRJ3fppJ4GBjFgvgiMn+cPZHW4aVIgu4gcsqU4X0f1nuJbX0iBTc2l7onY1JIsKcINqNdqCOBhkj2JyumOiA+SSrczSjjvpnwzVFsz11rWhKidWuAHuXABfoowBGKqF2gHYx2T6r9VSLNujDxG0Jw== 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=rr4BsOl+t6rzEldC/C0CdUGRGXMsFNIn885YREjSPAA=; b=oo59GbY2pq1kpwm44vT8e9PHITDfAdzYS1mSoc4EqDf4Qa/7bufGrkLXE7u2Piw7Q9GOz+nDIgmstra7Pn+kMHhNUHooBMQ6Dd42d9Li3Q9Ia9dPu4T4iEVqTAuxpf3aQcWcIqX9/cnl1zjBbVj8v09FsYipwBYguhrCWq7E4Q0= 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 DB9PR04MB8461.eurprd04.prod.outlook.com (2603:10a6:10:2bc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13; Thu, 12 Aug 2021 07:16:24 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%9]) with mapi id 15.20.4415.016; Thu, 12 Aug 2021 07:16:24 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Thu, 12 Aug 2021 12:42:39 +0530 Message-Id: <20210812071244.28799-12-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210812071244.28799-1-hemant.agrawal@nxp.com> References: <20210812071244.28799-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0105.apcprd02.prod.outlook.com (2603:1096:4:92::21) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR02CA0105.apcprd02.prod.outlook.com (2603:1096:4:92::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Thu, 12 Aug 2021 07:16:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f10f797-a87a-4f95-169a-08d95d611790 X-MS-TrafficTypeDiagnostic: DB9PR04MB8461: 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: M3oHFNIljFLnLuZvgCLKQjtbdv+bqCokutkIJFKX1TuhjMd1vrV0EEcmMvge0aT4GZJFtdGl3HWjzhWmkcNsp6wcGu1EC3l3lRKtA6Wh5wv81JqAS/5GO0B+5VL+g4T8FCHV6/ZDqL5UXkRyIhpgtEPeSFZvOW4Uj13SOtBZAYmG0LA529nK8pQnAfDnLR7YuDOtO8UeoZEDjb+ycdgsR6GGJol6YebxIpNktr+2JEgxNq5FRDBlwPDRiyDY6Vux3MJHmX6DipRm29iiXCWyQwR244VxaS1mcetFNs/cSNb8lMkjOM0jUqECrvzfPmK5ya8VNTjm5YL5buXqfYgWzj/kQaZD5phW1C/3MA/EucuwUQThLAlZEpbjLi9zNzfb6Ln8qNR38EdWCs7p2qUz/Fi8lSGCX00QMUgcoWTBhQsx56VsKoSih0RE/45S4gt5jNQUKf3abKlIeLTG9nBRVabIjqiTOwLVW6sM2yZNyMLmZTa6cR36/xX6l6CbP6BFeJHKVUrTo12gA93CoSCFNqDNEcPqvBuOSafNixY+HDiFd64gJ7cJ2ukTHFg3vB/ttmOXFiiwq1Lz3zGwT2t6+RUaf4vT2NMsvqZgoL0eHY70oQwR03+uGoOl1ipT3q0jXCc1tX+fiV1W4Cj++g0b/RI702q4PK9Vku55IFaYhVUQvSlS050GBQxUSk0Pp46TVJZRiQzmVhtDl+aRPx+OgQ== 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)(376002)(346002)(39860400002)(396003)(136003)(366004)(8936002)(956004)(6512007)(2616005)(2906002)(6666004)(36756003)(86362001)(4326008)(83380400001)(38350700002)(44832011)(478600001)(26005)(6506007)(66476007)(186003)(52116002)(5660300002)(1076003)(66556008)(6486002)(38100700002)(8676002)(66946007)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QiEl4AcENZhLz8kxaSzg03rM/kfQwsVyszVnfEkKppo801oFc+0wCbxmLBoY?= =?us-ascii?Q?5FzyA9rETppTjex7I0TjGd7YSSTh+JZk43InLscXl3mIuOV4euoV3PIMmldo?= =?us-ascii?Q?33i3Zht9x50u+Yq1E1Jr7bslUgL0BfBzNAodm6IQnvocX0kMboBkzPZTVGIC?= =?us-ascii?Q?/EPzRztZkERPBWbaNOL2bgHAt7Ftz+8AjKaWwoaG3fudwe8Vwq60IZ5RnZ4R?= =?us-ascii?Q?LiaO+a/QA/LczztSjg6cIKBmqNoxHTXpzZYY5c6Ou8biyDNxWyhObGPQLvOQ?= =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SQlZmRqf4T9PkpLuTirdy?= =?us-ascii?Q?SM2y+jBX/PX9TxfLvND/FLodYAqc+R8ZH6//atXpyIUt3+EdSaand59/0/jM?= =?us-ascii?Q?J8Y9TRP3uqYDUYRIas7OhxMgLtMueviyyvATVsPPV8HWRqXZv/RLvhohG+Wz?= =?us-ascii?Q?evrynzXP44QPga+C2+J7LIkE?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f10f797-a87a-4f95-169a-08d95d611790 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2021 07:16:24.0445 (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: mshGXVYDELiSx9MlX9f+8GPXhu36HLLnSdmK4OIIEElU5i4Y2meXmUFHR6h0AdiEb7M484tQJZHaHUDOEpX3qA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8461 Subject: [dpdk-dev] [RFC 11/16] 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 51e316cc00..25364454c9 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