From patchwork Wed Aug 25 07:15:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502241 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp345849jab; Wed, 25 Aug 2021 00:19:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVWjsJeyzwN+kwoGoaoCrXh3Qs2UR+T3uyESszAKWTX7dXy8i89f6Ipx7Qawf8riDYserF X-Received: by 2002:a17:906:6445:: with SMTP id l5mr6852445ejn.194.1629875994976; Wed, 25 Aug 2021 00:19:54 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id qf29si2398438ejc.618.2021.08.25.00.19.54; Wed, 25 Aug 2021 00:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=eXcYqnOl; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 886FD41201; Wed, 25 Aug 2021 09:19:09 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20054.outbound.protection.outlook.com [40.107.2.54]) by mails.dpdk.org (Postfix) with ESMTP id B403E411D8 for ; Wed, 25 Aug 2021 09:19:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eJa/GAZDHpsSMYF4i7YhEmGUco1KKsdyPH1YZouctCzndbDgceYBjjlAG7WqM9RgUMRQI9HSakMtAferXs6xHEdm758z7xZqS86dsZUqbwuDBeXpU7ecFLpO1/t3vi9GUOqRtLuacswyFVruuIpAVuxSqsypGDJ0CMBbBl6ygSCZPpb8ps3zlg+IZw/UPZMVBY9bV6MmmyepAPJz/MUraJ0ZQUP4zCiWTsnaM9x9Murklega6wK06l2zb5mwbgUshPuH/bgMDRLL/DQBEh+/x2ubg+yyoA/H2DgbqktYWvcU0ID9aXk1dZ3cVcux6sQto47P21/1S9KHYE2b2/9R6Q== 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=FosOg20NNxMgIzlohyQ8oRm3YZ7qzjnxz/qTD0K+BYJ4U0O6r/qzV6Bn53FAz667j/njZh1hYN2Hd8AJ3ZsnPaCXLaEqnnT+2AZAPBIz3PDLDGF32fZfQ/yQuRuPbqAzIZSX9CTqCsTqm4mueRnaIoSJoi3TGyGCs2JtqeDoy2oJWBTxwaJJs5jZehZPVUPXBMxFLCa0OKJIetZXDbXmPtUoemOih5jKPAbuNgsVvTXfcwNjhVNR6kE+ss/PKvBBS1rxSbddh/CeTtbldxf0LjQKM7wOPTzZWd4iXBw9+yqZJu69oE9zulnmx+9qU3xxsJFoC8u6i5fcWuiR7YL4dg== 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=eXcYqnOl/Kd4P8Ub+mxNVTkufZH3iI5nObKbzZudTE2nH7QTJfvww7+q3cPXlSrszCfUvZrWAXTfADn1Ve+BrRnZUhkV4f9ZM4AeHcb6QAU4xNJAYHs2PDC9r76UKtqgAaG6nyqQgFCyeaFjLCJTbb7eREL/TcKmKz7xz4id3oI= 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 DU2PR04MB8614.eurprd04.prod.outlook.com (2603:10a6:10:2d9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Wed, 25 Aug 2021 07:19:08 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 07:19:07 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Wed, 25 Aug 2021 12:45:05 +0530 Message-Id: <20210825071510.7913-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825071510.7913-1-hemant.agrawal@nxp.com> References: <20210812071244.28799-1-hemant.agrawal@nxp.com> <20210825071510.7913-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0126.apcprd01.prod.exchangelabs.com (2603:1096:4:40::30) 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 SG2PR01CA0126.apcprd01.prod.exchangelabs.com (2603:1096:4:40::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Wed, 25 Aug 2021 07:19:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b5faaac5-ed53-496b-c03f-08d96798a087 X-MS-TrafficTypeDiagnostic: DU2PR04MB8614: 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: Nu0s7h8xOKlVOBIzGvv8hz5NvTmsV3t8vxJFtBlpHSTAP1mn4cPCTkAiy1n3I6fog37h38a5MmtkxlAt3jMkfWK9I2ZjOar2V7ZdQSSIdlSkqTpqxszdl1NgaAYb22++pSQm4iGvbxTnoQqGEZw+eQgUK47VSIbE3r0yb2ibgzeGA2qg595RzGO00CAMpeCWqWKwzVIzeC7LDDZXLy1lmR7OZyEpf5h+gmdr+PL2L+cQI0eunPPZzsC2FC4H/KJOpQSI57SyI14eoLryJsZzd7hbk9UdTau5OQAimaBIqMznVaCUUy6orLFtrpm7ZByd2HrV7A1sodSYfgkdfkKytSbCGmdg4pQQ7R5nE6TV4Dr4X77VXwdjHW+oEl1CNuqtkA9m82ElscQjEmvtH700PeGIVlLnXyKc84CpQS14GfdcrmgcdCMkUjHu4AaOWZXWTP6S80vUZKk12YbnlQIYJn/X+jo6TF3zAsZE1ICFlocy6EEHXMPvxPHhA90y462fxtIeGw7OzxL6E5RVA9b6d4/INNhf+SAtXv4AYI9uMqrRMEdatjAkkob/GOSed0TrOz/cqJodBXKgLiJz1odWkkEjd5nufUYtY6TpwDN6eBiSWGtaKAC7MUuffrbx3C1eKVO/NyHKcsA/abdaN8EoBf4VNldbYjtoe9fK7JPqJmrcw8Jov0rabQnExQ0xstZOXxAh+VxtADIht63jhdXL6w== 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)(376002)(366004)(346002)(396003)(39860400002)(186003)(83380400001)(6512007)(66476007)(66556008)(4326008)(86362001)(38100700002)(38350700002)(36756003)(316002)(6506007)(66946007)(1076003)(8676002)(26005)(2906002)(52116002)(2616005)(956004)(5660300002)(44832011)(478600001)(8936002)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: d5hPZ18/+8vLu1ZkVy0FRNvgcJJywH9hA2G09YWAcpokuui4JwgkHD3qfhkeOg776FD05W+wpw7G+/RMM2L+yhYZR9/8os3Vl1pFPoVbTOwiGeeFWlvPV8dgjhWcreE/XNQmfwYOhmgxjZqrJE6jHc895tUSFkflii2ubSAI5q/tzeatEadGLWYUFNr+8Htvukp6VoPpvYekOGNIde53kPHWv77SPrbITsRJxTaP0D3D1gLdLj4oBjMXyTjNLZqITEZ86dsuDt4T0PaCd/XnEmQe/jBue3Yd0RH22+UqTfSBatlT/cHFYDVLp/QILXi9Gr+iFxYp9MlSjzpwXIYAeH5XRkWSnnhUZPBwlnKlUIgeIN6ESAlitBowjSPhhn+F+3W9Qu+fS0qJaXVqoudX/ZzDIw9ui+1ZxG/qc5dE4tH8V9HTvj6Xx0phQvh5kLIoMD+5sXjSHklhlB7r6VTgrx5kPWURNWmMSMoN390VYtGQK61rMqWfSW0wHp0Ury7dqxz1EfoFrAPc2aN6+AbzRcts0fodARA4EUktl9gD4x08/YOh56tZ8vHO8Eut0xVl1pgSE4EAJsT+Vi4rZQjULJdrfYmdIS6whVrAhQYd+a7erYUtKaqdSsCeyWXS/0FM+IxybBF8/FpHotFCOoB2Nf3PBuzyuXsdL9i8WEbvIeZXLgRfAl5SiKy0flWo7KZBx6o3D5mYmI/fVSueWbMvHOTf7k6m0+5Wz45c9SVPhZ7NBGGYmZ1yTFSuPY4HUklq0mVyC66ZACSmcCdG6qY85MDgm4NfG+TlId0oEoQ7FcEeE45i/7cyUO3UflrighvoEFyYXrtfXKxNCUaYQ0rRVLxRSrG0F63CR4VwCygAWymohHuA5XrPUl8kLvTaZso+ApA+D17Su//s8v4Ls8Ulyuc+LiPMlzdJhs8LRLSh0u3m9EL3hCsR13JT1JaS1LjfUsGI1bmiwJZEdnXucTAyzYOsdi53/XUDe0ReHgeOvkYVIjyrh7wGnwV7QxvKyRy4JxiiKN76Qk3WRMi+AkRu+kXmUJ+OlxlBB0eltwZZVQnnjyjS46XdOXqIgysGBnIPiM3MEYwnLXsHtdRK1TdvtnP6+6PUx0j/H9RTExTyBiHHiyH0v1Kvo3JGfzNyi7ikA6O32NjKocW/8ncAwEqzS+T7eQagwbgLszNLFBR/wabvD3HRUyy5AmXBTj3ESukQW0I739PIQ2wnXgtYVTxW5/qBoolNvgKg/JLkWHJo+D5HNFdofw+V4L3esQBvc4EBcZoFlkJ4GsWhOSP1r7nQYY2PZrcZhowerdYnLJcpzBiCcOB+pXw1RDBPnJAZMSuL X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5faaac5-ed53-496b-c03f-08d96798a087 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 07:19:07.8603 (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: xLhDaHuxNe51Yaa105MI6Hd47Mnv3ryHTodLak4zms0NVvBnIhP8GWkK8/EwBQDtyoKmdbWJrkmOfmURCVDnvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8614 Subject: [dpdk-dev] [PATCH 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(-) -- 2.17.1 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++;