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 6CF6AA0C41; Tue, 7 Sep 2021 10:05:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCA8A41178; Tue, 7 Sep 2021 10:04:13 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2077.outbound.protection.outlook.com [40.107.21.77]) by mails.dpdk.org (Postfix) with ESMTP id 0ED7241173 for ; Tue, 7 Sep 2021 10:04:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GXNtdEsCdG/DWAQrniQSwRfKfml7nHfBlMiTR4OkNXHAcHXlzbGc0+8yMjLo8kxyAXl8chb9kq6VcjNgzEDA0eRyEuG7NvWlFkblVEMlOkTZvzPm8BHuuKAQQghoHvCWOrI4fAU24pE2g/pkk4D1px26HYl+lg6OIuS7B3eY4lKkkrJeTB3Jd1sgqOEIw2jPnuScn3wW9vQNQDpl31oGlzg9gs6fuXbsqkypvDLOGhBTQ0ZsGgd7Zxp8wJAatd0LrsTFUJWgGJcRvGEXl9UvfGe0VXB3wqyVX3xApKqODAut7i9Z0Yqx53JWBzAAZ0TLRrWFnEJKDi5DbrqwIce/Fg== 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; bh=rr4BsOl+t6rzEldC/C0CdUGRGXMsFNIn885YREjSPAA=; b=cHpk1AGOcS5hNrzSK9t7DWbWDZQg7xzcQIUV3hZ7m2obBKjoXf0UCwKNIzfv4mFm3qAk94woANzSyVTnFHlyLuQhiT4MCnjIS/rfKLZXIBBaYgM351j0Y4xs7Mq4nlNUHX1x/MQBoaEHOhdNt4Fxwo24jzN4KyXVryzLYs/gQV+sWj9hgy3H+s4UXkoqToyQT7cV7dQrdXftxlaC3ojhIYveQyIFYZMxwj5hXjIQBQTqJiI7hLJmDH5BUrm7YGGo2mK3e8y5lP+yH2LOwCiz4yqF/wO0U3Ncz+uQT83kDRa8HRVFxzQPEakvckcmkptQfeBX6z1qoEHddiOA5mBLNA== 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=H+TPxtcmb78SOoesMELgpdyHEyyB3dMwyAkmg8Iqi/w0LPmDAZEAVDIrx7xxaS/IcfCcF/nfsfNKddFw1blkVHTDq+JMDCXYK3mojmY423vjG4JEYMxRp2GEDch8NdEDbRgrcmgAMvbFxXkYGvC2BLL2kQfeTHgqk9Dz6j/lryk= 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 DU2PR04MB8709.eurprd04.prod.outlook.com (2603:10a6:10:2dc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:04:11 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:04:11 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Tue, 7 Sep 2021 13:29:52 +0530 Message-Id: <20210907075957.28848-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907075957.28848-1-hemant.agrawal@nxp.com> References: <20210825071510.7913-1-hemant.agrawal@nxp.com> <20210907075957.28848-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) 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 SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Tue, 7 Sep 2021 08:04:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 560106c3-a082-41f5-8351-08d971d6135e X-MS-TrafficTypeDiagnostic: DU2PR04MB8709: 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: 2ke1USUFB6lFOOIbk2Gkmi2hVcO7w9RlzdoHbRX/ZLbLv+AbBSOEZk4WG9Uo9+JjrwfXzzAiWxDwm8ml0fCUilLeI1XgKF87RBv9s2h26dGTzg305YenAlRGfaC1m0RR+YPGDEiE+afk6Tpm+ITR6ArrAkxhuezFRmH/3RGrV9w7hsKrdwpghrc+ec64NsVzDdN3tcNxGsTpzKPal/xkVhoSGuj0utCHxK7FN3ayNRUkTpxI4vIx0KNjOG78Rcgfa0Tng1GFwgIUKo4XpPL2zahUD9Ol6UElHiOSmwC16ldESs7Fe6nugvZMeCO1aMxjcUlzLxFGuarALFe/8SJibyMdk64+9iua3SH0eF3+Fy3ZXVfdjrTLDSsFqTdet1LBCUm2Kl0KtXHnd3yPtvZUoDuK2b9NQDbN/eezI09a85IWI1jhFLUSQCRieDgIrFnR7kk3IyrDlbWFfwlZb6ratjonX7rszyfwB2uoJbU2ru05BgzRI6auSAC9ZZqwmSpuJsZIaXEo92UnYsUpR6pm+YpogVxlrJk6Ooe8FGRIkYWYEqvavglU3Yp4/5JNs2Q2Y6vypg5ArOb0T7s4MKwOjjYIb68sfahlwUheg7oow9nhOI7ib1Jo7/3AKfMm9QqSqYJw9nWVmV8d2wXCjFs125tOsINIZ+mlDRx09VM4LfscBtbFzmQ4z50PI1dAnAr44IVerqaxtjtH8C6+qTfYUA== 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)(136003)(39860400002)(366004)(396003)(346002)(376002)(2906002)(956004)(2616005)(86362001)(83380400001)(478600001)(316002)(6512007)(4326008)(52116002)(1076003)(5660300002)(38100700002)(6666004)(38350700002)(36756003)(186003)(26005)(44832011)(66946007)(6486002)(6506007)(66476007)(66556008)(8936002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BAbOwjve60EqhNqfOuSMTOQSq8AyvGnLAlGEFOSt9an33W1o51qozkHOPK6u?= =?us-ascii?Q?a4U69Wn/h12La8BJ3rC+IvIgO0F/Ah/yaUI4Vas56cy+2BT8zqF0TKuUE6bl?= =?us-ascii?Q?/g1Wrsg55fA6VSxwXzOXecMjtY0gE0XLd5AaRJj48N6Bo6ZKU/o98Lc2LKpc?= =?us-ascii?Q?NyBQPz+v5mUCL3ui+LStr1DtwmVMnoI2S+QlL8qLdVLCHxW40sD2NtynqPjf?= =?us-ascii?Q?tB6K0XHrGhN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?= =?us-ascii?Q?fU2CGFmCL/6Bb65PhV5wt8sWlEwayn/Y036gDVhss1ER05pwGpSbIC9oLyjc?= =?us-ascii?Q?/zcUgUFQI8VQTeSSDnd42QpMLfS4MjNBWL2lzFVqhnPfZzPIOW8GxRKKtGgn?= =?us-ascii?Q?eHCi7wcVDnfIWNVjPDFsG/sDFEeX6STv7JtsSXg7LUJ0YwNuzVbarlyt6gd4?= =?us-ascii?Q?R0oi8LOCxTkJU70RajjdyfX7?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 560106c3-a082-41f5-8351-08d971d6135e X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:04:11.3826 (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: 8wY1gIGEqmT8XQP+txNC6ngprWUUeUeplNZCR1pVC58pJkvX9QwQ/E5wcIK2ZZhYmTKsXHVIZDvo/seLYRhqkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8709 Subject: [dpdk-dev] [PATCH v2 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 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