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 14CFEA034F; Tue, 28 Dec 2021 10:12:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BA254116A; Tue, 28 Dec 2021 10:11:44 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00044.outbound.protection.outlook.com [40.107.0.44]) by mails.dpdk.org (Postfix) with ESMTP id B8A654113E; Tue, 28 Dec 2021 10:11:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TpoUE2EMS32qPjhIWkcl19thLDEbV+ZZKDtuTdEYZwruB/yt5/5ssIdrqxkbDuZEOwbNhMmQnxKnwJZPDPy6syI4uyADXj4Z0sQF6CbhzOzmj6w12LgJgVgmLc0VDnvpzViQs96Z6bru79VgHLd2yEQv8zbsWPrX8m0axHkW68Buyaia6aU1wzPeeFP7mglUGzlShB80KA6gnL7BFjW4hldZ3/VJ7jKd15VmdI+nWtM1j2Y07c8g4jj0v77mRDcnCGsljpIkSNEUZV+etW30aEDewlR3C8cCPyWbuowaXHyiGqibjPVCvgkP/JBbT9v6b/walxA4M8+CgP+apx70hg== 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=e1CGUsJja9LxreDCQ57KOy38nfWl/OFrgeYQ89nytPY=; b=FG1XTIKEHRiGJfZD6f2ERBg3F0fP4A5i4K7SMPefXHajOn1Bc20ZLaDBXB2hVBwhwlXwyvBZ8bjGFnkToOdvmH2HbbqmaqP5GX02vKU1y5fX7EkQ1lDfFdF/6ISr2AIXA9Hq/YIP9EjYy/jQmueVSRpsm2i2fJgckfUptfovloeKeD9vSl8NrdykCkS+vBhI4h6qSD+qcFCoG8dCkkBR5SnVCdFlT5NJ71eZW4bVNSvEjph19DA8w+ItymBqqht7F2us7v6jWiYOm5jvhuIgJe11Qx5lSq5reZEzoBlzQL/QYIZCOHdHfgDWKKwhZoQA9Aa85oDf7merplo5Ldoadw== 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=e1CGUsJja9LxreDCQ57KOy38nfWl/OFrgeYQ89nytPY=; b=SvWGsdTu31pNCa2YlyHJ6gsVDvSlbwFelTDacYTIt3PeLJVSrWwqmK43hHAIFQZ7yp+BpGAYoJTer+1Hdl2Ge9dPCH2irbBrtdVr2pLiGTDwf7zm2Zp/SHHj8XMOuaxuVE/+3ODsIzBJ6gCWMg3j+lh+xzN7iNdxzPIXwJWI0tc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by AM6PR04MB6135.eurprd04.prod.outlook.com (2603:10a6:20b:bf::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.21; Tue, 28 Dec 2021 09:11:37 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::4c23:c171:682e:9085]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::4c23:c171:682e:9085%4]) with mapi id 15.20.4823.023; Tue, 28 Dec 2021 09:11:37 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Hemant Agrawal , stable@dpdk.org Subject: [PATCH v2 7/8] crypto/dpaa2: fix to check next type for auth or cipher Date: Tue, 28 Dec 2021 14:40:57 +0530 Message-Id: <20211228091058.3620177-8-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211228091058.3620177-1-g.singh@nxp.com> References: <20211220102710.3083370-1-g.singh@nxp.com> <20211228091058.3620177-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0118.apcprd06.prod.outlook.com (2603:1096:1:1d::20) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 50079cc3-48e4-4134-fc19-08d9c9e20d0e X-MS-TrafficTypeDiagnostic: AM6PR04MB6135:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1728; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XUTQOozXynu/MQIWUt9MrBhr+jDQk8lRru3CWgj115rufvqXKw811eUpEtbMx+kEFfLKoxDR8gVKqF/Zg8qPJn4WBIPYmxWDOeY1Xb9/qLngcIcPMfQKf+UhSdYHM60EkKm5qXbk2RQQS6TrbeXeD1oX18rr2GXBS42yi0PLyctIioxzzeOtmD+kLed6qpIKnVOxfwZ8vllP5ZHa+AjLRuDGkY41ebwI5YcefBE6fBQg25qtST/6qHNAPQdMHkKcNWYfGzNRyySPs0AW3h7goclYlZ70DS+Z3P/QqsWh5WtI7O6s9bir5s/arUyqblhchs23Jf9+NUoa7IgGGQe4iZqXs8euBkAd+puGLj5iqfwJTgXYotOZrUOTpdearhKFcl+j0we35+jMarSLfZH8B1+aC7aHVBdPcFPdWpPK3hIb19x4NDm4BSaKGF/IKIUqbSw1htMbIaX/Cs6jEc+VdOXDioWVEtZEKbPS9TcpunMADbSq/7KUcb2mEoEzzMQkQh4fu2WFDE2ne8WPOMqAPNz01jhSCtS0FbfeGVdStGxtY+NUOfZk3vayv+Xf7cdUDwrBLPD3uXFklEHK6FVpkC+tChzEWKMWh8g5Ac5ya+u1fpVYeKXylAxi9f6P51yhuuyrp6aJb0Glrvuzz5f09qNgVwdoMmshEs2ZM9LwAMwcX3+rLz+8kFiUslzMkrf7oPJ3AZx0cdWVVqmsSVm+KA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(8676002)(2616005)(6486002)(4326008)(6506007)(66556008)(66476007)(6512007)(6666004)(55236004)(38100700002)(38350700002)(36756003)(52116002)(83380400001)(2906002)(1076003)(66946007)(86362001)(26005)(5660300002)(8936002)(186003)(508600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nNglgRDyya8YX/ByyXVxAqLAfjZ3ZXIUR481rJ4C2TnFs2543wE5Vb+wo51N?= =?us-ascii?Q?ma3nmzCFY9GZozvUysQDLi7VgyY6od+ggzJIEiJTn+dqmUVVwGd0MYFOaIcm?= =?us-ascii?Q?DZtY+XyFcmoRwF71m7/sOzCdC8xvENZYAH3PKaVEqesjUMsEXOwmdyglYR5S?= =?us-ascii?Q?FjcC4qoJhwsQDd54KS+gzKlV/V44p436hAxVZ5Swps96wr6r9lVNd6thR9KN?= =?us-ascii?Q?vozvFiUPh2W3cWkLHK70/sLFanVfuDXohGNiROgyBFCXIcLOaxjFdJdjTfmU?= =?us-ascii?Q?BPx9xc9n+Yde9Y5a6Ze0R2fXZUKyLXMCf3+WlERuaAGLAS96fCeMUWEBFLxi?= =?us-ascii?Q?O1LIGe9YbC67unECCwe1CHfOVLWZh6gnC8gW64VPM8AqUW7NZxGbc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vYmGfVECr+HBdJrYMk6Nhc8YyxW9Zi9hHKJTdMlPfkfsbALZaYq?= =?us-ascii?Q?4fXnLxKGhgV31jnk7Tf+d1Pvssm49SZFwgmNn251NloaR4dl7UiXinA10o5s?= =?us-ascii?Q?EhvceuhZ732kxgCVVGl8vjrFynuoWrPoFNr914Gx6ivEFxit9QoG9dJN3WAV?= =?us-ascii?Q?24wXY+MZZidivvi4+tnAIRGKp6pTXJdJv+7tZYTpbjfz290xbUA5uQJP66+m?= =?us-ascii?Q?DVsAqqLfcU1+OKhX7nIlw9HDUxgEijdH1QVEzjaUkbE8CT6jUNBqkCxPgxBn?= =?us-ascii?Q?J0v38TpaiaFHPKWMpCA=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50079cc3-48e4-4134-fc19-08d9c9e20d0e X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2021 09:11:37.1169 (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: dKZvU+LDbv3gEtoR59S1Ubq52RtLtiMacMq99wxwGz8HkAkmULxAt1XB7zBbeVoO X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6135 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 From: Hemant Agrawal This patch add more checks on next type for PDCP cases. Fixes: 45e019608f31 ("crypto/dpaa2_sec: support integrity only PDCP") Fixes: a1173d55598c ("crypto/dpaa_sec: support PDCP offload") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 ++++-- drivers/crypto/dpaa_sec/dpaa_sec.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index b65416097c..3f3540eeb6 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3406,13 +3406,15 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, /* find xfrm types */ if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { cipher_xform = &xform->cipher; - if (xform->next != NULL) { + if (xform->next != NULL && + xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) { session->ext_params.aead_ctxt.auth_cipher_text = true; auth_xform = &xform->next->auth; } } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) { auth_xform = &xform->auth; - if (xform->next != NULL) { + if (xform->next != NULL && + xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { session->ext_params.aead_ctxt.auth_cipher_text = false; cipher_xform = &xform->next->cipher; } diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 1dedd9eee5..af166252ca 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2984,11 +2984,13 @@ dpaa_sec_set_pdcp_session(struct rte_cryptodev *dev, /* find xfrm types */ if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { cipher_xform = &xform->cipher; - if (xform->next != NULL) + if (xform->next != NULL && + xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) auth_xform = &xform->next->auth; } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) { auth_xform = &xform->auth; - if (xform->next != NULL) + if (xform->next != NULL && + xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) cipher_xform = &xform->next->cipher; } else { DPAA_SEC_ERR("Invalid crypto type"); -- 2.25.1