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 9CB1DA0C55; Wed, 13 Oct 2021 21:06:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8728C41288; Wed, 13 Oct 2021 21:05:24 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2073.outbound.protection.outlook.com [40.107.22.73]) by mails.dpdk.org (Postfix) with ESMTP id 597AA4128C for ; Wed, 13 Oct 2021 21:05:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UHKx9cOvMGyvpWjwA78pv0NNJVRiJVL44Adrr5iPWo12ggaj/PP3zVcUrQ/8uV8n455qUbXRokD3VljxLRjAvnGJstUio2ZB+Jk6EWM+s3BEJwXpsgekoWHWe6/pYO1sKhoria7RjPncHa+5GEodkQYeckQ625Q83axeQFDqrlJQunTEyQ7PNC9iz/WLc14KeFtgTS3rsLqb80hS02rHGElUrqMOqU0GK3dWKIPrYf3TJnW0rMZ5sn9xoNfreaCiDBZRpXmCTpUiZpAwMBz7nZQpBwCdI8v7A/BHZpeo0vyzp5pOpdYMKBd3EmFs2itIHsZlfNbdTcd0nINZ6c1QxA== 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=K5zIGzYO6vtgmNrs7oL2p9wYPUcZOnqO3lNMsRXcVVHW1o/kuJ5gc9P9MjJAlMtXYGQjpivjQfZK8+/XoM4KKkgpnm0zsoGbXDZZMFicIK2fTxrBv9+/FlWnE6ZheARLW02FGzNjOHWimQL/49ucaYbomQ0lX6E0Me21Q078hKyhqCywgJcu+C9WDOhJCzHt54qDPQNLoIxxSS5qdBhk/mXO3kYJp4HUClQpS/SeXtr6PvtFpg7Zi9JsUHDFGIzcOVxxOHs2B6DV7CjmJ7a3Lhl/sHS63i1JFLZjMiPDhGQka0BPlYmVGHKDnE3UsL2YWxw8IXexB8byLj+YvBtrfA== 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=hLRKm3m3gy4eqGsg61VfFJ+9iCAzHyVMpdFxMXf24nyJ/cZF4/yaqCC2L+JijuKq0PcwAHfvbwjxS+21sfsdA6r9Lgu47R8qjoEQx2rDouU1hJod19PvuFCU/CDkPVJezLoIqRy1WnTd8gRTLW4EfPcNv9OJRmK3S/JcEaHhmNU= 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 DU2PR04MB8870.eurprd04.prod.outlook.com (2603:10a6:10:2e1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Wed, 13 Oct 2021 19:05:22 +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.4587.026; Wed, 13 Oct 2021 19:05:22 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Thu, 14 Oct 2021 00:30:27 +0530 Message-Id: <20211013190032.2308-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211013190032.2308-1-hemant.agrawal@nxp.com> References: <20210907075957.28848-1-hemant.agrawal@nxp.com> <20211013190032.2308-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR0302CA0011.apcprd03.prod.outlook.com (2603:1096:3:2::21) 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 SG2PR0302CA0011.apcprd03.prod.outlook.com (2603:1096:3:2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.4 via Frontend Transport; Wed, 13 Oct 2021 19:05:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5443ad0e-efba-49eb-83dc-08d98e7c6824 X-MS-TrafficTypeDiagnostic: DU2PR04MB8870: 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: Tsls0kmuXSKxgKf6MTVbAEjwt9cF92IPSHWFJiF8rhID5OBgxDrMFbCZP/w69awh2BvPGAiXIITcHxxzI5J+QqGLFh1GvbizGX3ebZyIfD5DGBXLw/Qh+rRCJMf1jpZJI2EUvQgF//qLitzix+9cbJoaHpDPeIYkHilTl8Mw/C1jqJBDV0XmZzZ+H+c2qURMtoCMjVki3BRQjjbkbCQolo0Mg2KpGiAiFXEkkZZJjRDPsPZ9rSfeliMyd0+vFQoejxlsxjfyTjYhjM+atxLn3JuZFC+8ManllRyZw7M3rGXsak4Si3gqIRox23mfHaQMQHJpVCZHppwqcj+I63Oy75HwV6RWR10Zw5yIy300lu+G0AcT0oCEnlVn84+CG8I4rb7Np/1M9WycZPzMnWy3rkSQgMgwuZynGrPK1dAOQ7qm56PlkUKYppIGqIMUVIADmXM7fO62RaeMCZNlITi7HtpWjtFohkiIdFqcVDsUKsiZjGe41g3z8pYoi8xw8mqbWniS/8UQy5jC/qztqPDHOExdoSVUg9ktHAu/F5qq7ncucYXjdLx8DIbvj/umqB2KlvLUbuPcmp43RGOZwEmmy000FoFnKt6e+QD44p9RdAsklGa3kCqp901o0qIiwJtN1RipgTU5vCK7iOEiseuXw8NbQzthE+QSQGSwW/GP1NYmdPKVyPw7b3vGXDaBMoOZnLbhFL16wnyq7MP/t0gA9w== 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)(66946007)(66556008)(316002)(6506007)(36756003)(6512007)(2906002)(8936002)(1076003)(52116002)(186003)(4326008)(956004)(66476007)(2616005)(5660300002)(83380400001)(38100700002)(44832011)(38350700002)(8676002)(26005)(6486002)(508600001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MdZ9cJnaZqjA/nORzCCgGYhLtiwUqjFd0dLsa1GRHVTWjI+ITKRrdbNtuJjH?= =?us-ascii?Q?iPEicco1Z5KBG/vRyKNchCxqnyvJAkKBJcFWh5hCCpqmXFXyBjr3vcuDk+wO?= =?us-ascii?Q?TMl41toUVSHAk89yK6zgoC1aMKlfPdNsBqwzs7Y/cr+pT0XycaVLSiwKKmzr?= =?us-ascii?Q?Enf9FVdXbAgcIdMjtC1FlBDwdBNGEMH6wpiBD9kpvsk1RsI84tkxcGf5b8vM?= =?us-asc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4Zm7eGhJgvKgbeoEnYbJlsD82UkUZ8zV?= =?us-ascii?Q?hm8woK3kfQDnhmOXxwSXjt4L07VlR30dIQeulR52htolnut+5MHRR7n41Ax5?= =?us-ascii?Q?nXkA0fgE+5gNg0WWbj25M3Wf1cPaBdh5J0oL0/Zgj9Ln5OjephI+6JfsTL0O?= =?us-ascii?Q?LQSfpaqH99Ag92H+3VPjaCUm8SG2ZGEn26zO9H/6LOvZ2O/UtBz0WeCmj42J?= =?us-ascii?Q?p+CDW0POuJUTl2nybsQZSMNU?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5443ad0e-efba-49eb-83dc-08d98e7c6824 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 19:05:22.5302 (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: Ydu7ZOg86+mvGb93JopVVY/QbQmaqKCSCjSrszCNnhGsL0o61ETjo2uUTI/H2Gkbbisp0LNM8XRjqvr2qPRT1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8870 Subject: [dpdk-dev] [PATCH v4 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