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 6B973A0C53; Wed, 25 Aug 2021 09:19:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EEB9411D9; Wed, 25 Aug 2021 09:18:56 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20075.outbound.protection.outlook.com [40.107.2.75]) by mails.dpdk.org (Postfix) with ESMTP id 985D140140; Wed, 25 Aug 2021 09:18:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aVuv/WIGqHQ0btMmukUpjz4sug6O2J8IQy0JYFVhYruUb9QbS6S62LOtETi/FUMyMi+3WnIrRk71nenX4FRKKcW6IK8bc6yGHuVQg3lq6fBLOekq32I0zNP7pPFFFaaGBq/yrWBJqDMeQ7OD+t96+ZYWw2Nm1tJWJTG6ZcA2HK46Gm+B8D08vLXKJn+bqWzgaYjVcBi/jAj8KW2JBjbTzb92hjIS4mhTwryptftt+gmCrdCt5UjoBbyAMG/5Hx1pagL6GCRMiu7LhE8oIG9ka7VZs5lhuFpcBENcbmGEO4UXjAwhTm7GVuTyaoMhl1GDdD6D+UuZA4mDFMdNdjYRtQ== 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=3fV331TZzSriimeXyPguybwCyUI5AMS3g+uO0tgL16Q=; b=Li3KlurdkbcNsLLwhmwbi2KLI0Twk83B/JtxbcsUaXEG+EbZ4JE20GHlPuJ1J6On5TOr1LsHaak8EMbz5L2rXyxUDA/7cXIvjOztT7fgP2/BRhkEzybtBfOiXyN5eGxKhvORrZ0G8RTTxRDDopcA7iwNeHUNuUUijIaf40y5sRmMtSEO5QEDoS2D8N8uceA3M8pOg/hX8J+xUVwyIjAw2gmITrfl18d2Dr23UxBhWcXYn0hI2bHuOhUSUH3TyIiZkQBIwHeMZIe1iphJvb4ujzQIVknTPSzwsW3T/CZy0SQdxPaO9v+UAQxVhc0pwQqp5jo5KSah5U5AiflsehZrEA== 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=3fV331TZzSriimeXyPguybwCyUI5AMS3g+uO0tgL16Q=; b=KSuuN2zTX166LWrQ5YKep1rVwa/Ut2lnCDi/MUZ+HzH9RSsqa1GZSjZZPQe2a8UUwH0eAuQBRuVzoOxlEvh27TItUrdFjmkvl3urgvqn17CpPHjKgB73S3S3+pUkk3l0SBrn7yfC975WEN38GSmWwjJnPpu3v+/gYbHyu+6knoQ= 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:18:53 +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:18:53 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh , marcinx.smoczynski@intel.com, stable@dpdk.org Date: Wed, 25 Aug 2021 12:44:59 +0530 Message-Id: <20210825071510.7913-5-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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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:18:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: efaa5c06-c4e1-4ad4-4628-08d96798980d X-MS-TrafficTypeDiagnostic: DU2PR04MB8614: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xKpnwBgDFvheSK5gHTorOb/F79rirCEK1FiAe3EnIABc1z/ZlYU5VbOUnM9Egy3FlcdYFbaC+yjmEgXfRwMI/owxN5dd5hh04JtfDq4t8rZ7v9Q26DkPF347dXqXil1V2Ds9Hn572bANnXE9UYWK5fyaEF6ztEBdBsiZqbONe9JGBhsRZ6UhGk0U9M8SR3yMc6+rBr8doYRxTlkr65zwlqnYvXhrNtEyQqG1a2I8Y1cz3gq+vWXXGgYiazJ0qbhisU1EQ0LCwedD2nvIyfcmt9aOrUr9K/jrlkNSFp7vb5GALODhyj1TFwrwRuS0mis+1MuDbOXFdViPPxzoo9Rs8nmGlsCrHiHnpb6AfMYGjjLLMNnWOOVeOkcc62HmuTS6otdrZS1LXmBkfBwRggaMq92XPMNqvSYVdKQFepcVUL1xAVaGWGvC9ed5YStT1bLZe89/f4VVZAir1qQyLYdNKobyGC2FUqqy84cQYTSp2Vq9Q3EG3aa95z9V+1rNUG2AUbiHNylMn8BH9k0QZzP9RVXhphFsJj+KZe94Sc7l4jRzEmB/VPpCpWk4bw1cHG9jEppPpkraKQsFtJiGzsJAJzt2RY9VG8kXsmbTg5Ve70xpdKLdJnsFLjOqn1j5RxgZ1Gr0x06Ywi0AnE6ebR4DmagBaQsEMX5LjkwgpsIglrRaHuMZIc8jSN4XMYMJZ2o+HIea0U9KGLh/wASghikNmA== 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)(4744005)(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: =?utf-8?B?OWtJUkRGQ29hbC9WMzE0V3pwOEErQzFkZ1VwS1d0Yml1dlJuNlJxazl0SURM?= =?utf-8?B?cDFTVXY4Rml3OXdHbDRleWtIZkx1S0NBYkdwYTFBdFJuRnJuNUtWY2hvRVNY?= =?utf-8?B?Nit3eGVmSngxdnhMaUN5MDR5Rm9JVTdrbzNtT0ZSQStYcFpuQjRKR1FaZFpN?= =?utf-8?B?NC9QWmVqdE0ybXBTQ0xY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?B?VUpFWlFSNklJd2VQQnlPSWFTK29KU3drS1RwY0RaUUlYem5oUFJkUThiZWhB?= =?utf-8?B?Unl1TDhmdXM4SEZNMG1QbXdJMUpqYTY5YVJNazMzeUFCVmhDSDBvRENsejNR?= =?utf-8?B?aGdHYTJCRXhtSG91MStyVGlMVkxxS25ZNHFXSnNxS2c5Z2ljaHVGMlM2UWsz?= =?utf-8?B?blFFR253b2NzQXZzWFdSbFVzK3NSVXZUZmNHTUl2VWc5aE96TjZDM0U1ZGZE?= =?utf-8?B?TnBPS1NvMy9rSjRZRFdsUVJXUzdOdjVBcUJkOEpVZHRLL0F0VktSMS9jNHVn?= =?utf-8?B?MFB1ZTkrbmVDUW5jekNNRjNSQVIrZjlXbW1YV1grQXBFeFY3YU9XeXN4QWh6?= =?utf-8?B?VUVTZ1Y4Q3NxMmJROUpjWnExK3BWMWQ0TGZ2cTFKdDVmVDhsTFRubkM1bkN6?= =?utf-8?B?cmRDdjBaVkNTLy9EOEdpMXA3TzBHRDZkZ3dZcDcvK29iYzN6ZmlLS3dyV1BD?= =?utf-8?B?QmtxRkhpaXJWUUgvTVF4dkg3K0Q2QWwxV1R0eGoyRzV4VTBnSHB3Slo2ZnJm?= =?utf-8?B?TjFwQTFVbG9UTXZLWGk1TUpHWVJRc1JyNThpT3ZQeGxpODFYNE1xa3p6QzQr?= =?utf-8?B?SEowZzJKWWFHSXBocCs2cldGUFNKTmN3NXp4SzlDTXpvZWJ2QXI0bE1vdVpj?= =?utf-8?Q?Lch6INAAlPyZWpSsJ0r9SMU43XiKVIMqOqF6NCu?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: efaa5c06-c4e1-4ad4-4628-08d96798980d 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:18:53.7379 (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: ZvJSDyn05gGTq7r4BqGcO2hfcIoCEn9r8yprYX1GHM/8ITkhDj178LHuHCbH+AmdZey+XOILFsDMI/hw6gwhCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8614 Subject: [dpdk-dev] [PATCH 04/15] crypto: fix raw process for multi-seg case 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 If no next segment available the “for” loop will fail and it still returns i+1 i.e. 2, which is wrong as it has filled only 1 buffer. Fixes: 7adf992fb9bf ("cryptodev: introduce CPU crypto API") Cc: marcinx.smoczynski@intel.com Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- lib/cryptodev/rte_crypto_sym.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h index 978708845f..a48228a646 100644 --- a/lib/cryptodev/rte_crypto_sym.h +++ b/lib/cryptodev/rte_crypto_sym.h @@ -1003,6 +1003,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, vec[i].len = left; vec[i].tot_len = mb->buf_len; left = 0; + i++; break; } @@ -1013,7 +1014,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, } RTE_ASSERT(left == 0); - return i + 1; + return i; } -- 2.17.1