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 B4525A00C2; Thu, 10 Feb 2022 11:59:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7981426DA; Thu, 10 Feb 2022 11:59:23 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150054.outbound.protection.outlook.com [40.107.15.54]) by mails.dpdk.org (Postfix) with ESMTP id BC13C426DA; Thu, 10 Feb 2022 11:59:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HLoaMy0+UNUV53cnIvSHuPwcR6PX7ixtvcxi+fjnFk2OMEXk4CV2NK7LXsJa3TlLNLz8M9p+puA8Hpr0kdKy9l3v/LTvAROkjDW8MWkLXcZgHDJX5pNOJBg+gLyuqRXf9HxNENdHoX1/0H4+R2RwtqjmBGDYHUGot3WnoJKXEVbXlmAZbPz0Z4inHQ+WfdJUficzvlI90ak3EEAemqLwarODvdC5SJm439VA2JERZxSQwhJken/MMiDGHaBNGriLqI4nnIMaoBwVvY9ux6aBWwfFm5m9vxj1yuMSG46TRD65EoD2SXeXrCbPLyrpUvG0YN9Y1Er0geR5QBvlKTzYLw== 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=B1iyb1nC9R2UZ0iUYL8YGcyphXI9djcbIlN7JKLh1rs=; b=hmZ8+8D+yUsRev4e6ZVdJO0EyAcLi9RE8PneTUGjrwe4keVy9pr7ycRwyBqsjA6FHtEycac2jOzw3L+XQWtaEbImZucLXF9Sh934+LoDH+MxVWfro3sWRzvWUKxP6X8wl9yuGVm+4WyOyNMGxH2+BpQdlG/jCKwusTEL6tb7MRfONGJYglIiUjYu5o7aoi13e5eG8UWRCijP18cORvIBpVGiK06k92AN94GSsUKIwWUlL554rHS7mFvE+gz3feUk9HeLlM4cDLxVCT2Du9t7AmVenhj0S+udEfURekRGJrxqgnMgbwOlAmOWhrNxgaH6e+fVDKehhbnjxxJ8b5lV5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=B1iyb1nC9R2UZ0iUYL8YGcyphXI9djcbIlN7JKLh1rs=; b=f+YcsK/87sob9c6B+mSLKtEOsFtDbhy1W5DS7FMU43B7zeHaHDrNnsmYUoDiq2s4PLRKuRolQZIa/ZCaJnJUpwjDQ4G0VkHUBBxhxrH89ef4zdUW4agxvow34CRysbrejAE6pJy82g8gqfFjm0WoEt2CZO5M+9a8vP498WRn8pM= 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 DB7PR04MB4091.eurprd04.prod.outlook.com (2603:10a6:5:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Thu, 10 Feb 2022 10:59:21 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::4146:965b:5645:9269]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::4146:965b:5645:9269%4]) with mapi id 15.20.4975.011; Thu, 10 Feb 2022 10:59:20 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Hemant Agrawal , stable@dpdk.org Subject: [PATCH v4 5/7] crypto/dpaa2: fix to check next type for auth or cipher Date: Thu, 10 Feb 2022 16:28:50 +0530 Message-Id: <20220210105852.1268506-6-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210105852.1268506-1-g.singh@nxp.com> References: <20220210043136.304845-2-g.singh@nxp.com> <20220210105852.1268506-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR03CA0092.apcprd03.prod.outlook.com (2603:1096:4:7c::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: 747e9bb1-0b6b-4ff6-befa-08d9ec8463d7 X-MS-TrafficTypeDiagnostic: DB7PR04MB4091: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: Dmqqr9U7vKzWiAmmSRdOzX2L4cDFNWhF1HSRorBAU3Z3rc+LKzTFE8ZuasUQizHtpgvk58tZv9wrLbLNO4VbYgCvYuedffg4DArIO3O1pDDc09YxQCIWEdGluSBxkYtMbYLXxR1nnAmmkBP7gFwkEv5wzhW9TgzmfCNU4vmI93M0rak4o/ws6tB/1vXsuWZ3kjf6phEO8QJZnOlLXunBm0K+vIt3iGXx+ntDNQB9qxotgDUaJYcUT5vQGmbOK6+HwQsGxPFxRkmxA/EEa64gUD8cPHM/9V1zvLB/o7LLfE4ULN4Lr1gWtpwy/auBnmtjBsA08O4Y2FguKxNfABEAOqboFKKD7an+/5etaNLGF/LVTwZgiJHq6TJJN3MX7l12nNEqeR8aC8VTE5paboSwwaqWteykOYncRctOrW9HP8GmQNM8QSjCM89FDOfYwQD7s4OCzBicPBzTLTAwMptVKAQhDwEmczZYiSaKjzWoR6oa04VBdGvdDnsNjaK86q44oMJqC4w2ORS06qOpnBpfoto+Aa7JO9VjClUrhL2y0s0onWogtzD/L5DkikH1X4JYnlpxRP4uevdSRMamCZGMa9AX2JFg7ogVz97liMfndEabwPu8A7kZ6GyjwxT3NnQxZmJ8zKjV+wTxePu63/p/qTSqlAqLF1JQ51PwZlDVm15E09fcK9JALIEXQhgM1oq8gRXDdMvLjcP84toHnU1PpA== 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:(13230001)(4636009)(366004)(38100700002)(66476007)(66556008)(2906002)(316002)(6666004)(38350700002)(4326008)(8676002)(8936002)(66946007)(86362001)(5660300002)(6486002)(55236004)(2616005)(36756003)(1076003)(186003)(6512007)(6506007)(83380400001)(508600001)(26005)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Lzf04oUE1TrclLoID9mgcri3QAncESzkAMVfCkbWf3OI+2zZmOADBKMYcxUx?= =?us-ascii?Q?1yl0XmISl9B/fvr3wL8mE2FYZZlBEFYiCPeatQz2bWdmowWd9JT643IBRn/U?= =?us-ascii?Q?IJ0xiAkK+Qd+26ufhTJsFyUIr7XNem60kX1S6dc87Dx1btYgqQrDl2dmS6LO?= =?us-ascii?Q?L5M543O63qz7/ywgzOwSd20UrVwN9343RwObXMOC6/rOu43qZUfexsWSvKjh?= =?us-ascii?Q?Y+pI7l+AN3lEp4E7WWv/Iq1gh0jtIlY0z4xkCN2laoQSfdfosteuZxDBAZI6?= =?us-ascii?Q?pSLVfJm38uEfzcpXQuLKxbxqTNnbd6DtAeRrONKVGIeRIJ7I9Xhi6AC2Rij4?= =?us-ascii?Q?bABSUybeKymB6P1smUqd3cHOoQWA+Q69AgwmvTlKWkJt4lcW5nnGa1YOwmeJ?= =?us-ascii?Q?RX5+eTsaaQFz9P21kPPvxkzw7Qqy8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K6Z+FVh53RqET/stu/FZnXuB7gVT0bSw1R9TjdtwNQtRcUID/OEDRivoM?= =?us-ascii?Q?UIAf5nK74S2LFogvhsyeEZNeJnDbc/1VBYZhtabuUjjzQtLUfblzwXuI067j?= =?us-ascii?Q?RnJDsTL+40YEkwGznmdReDoxY3c/qSlUdCNpMFfFQPvQzWaWMP3E4et/KErT?= =?us-ascii?Q?9YXDwaVN00W2G2Vs3DPP162v3pKMDWvMlB925f23mKi/xPEp7w9hzU9sL+8O?= =?us-ascii?Q?zDTOIiuxjHny1GdiYbg=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 747e9bb1-0b6b-4ff6-befa-08d9ec8463d7 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 10:59:20.7369 (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: 67aA2STlhSQF8eK8qpwxRvVgGA3BPJqVskmySDPg0z+GuJeDFQa2a5EY9rCANTu8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4091 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 444e1f0043..cb8aaf6446 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3231,13 +3231,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 1137b142e9..75e437f696 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