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 B2D09A0547; Sun, 17 Oct 2021 18:21:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E92B4410F7; Sun, 17 Oct 2021 18:21:34 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60055.outbound.protection.outlook.com [40.107.6.55]) by mails.dpdk.org (Postfix) with ESMTP id AED5040DF7; Sun, 17 Oct 2021 18:21:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hpnib2sDDQYRdJHAmMT8rJN7S15xMZ1b1467KCzYSQr6esZrjjKwoxKim9FK5wCXUxva579vMKoDHjethitpyq3KMnaRzC8nKBg25bdO6d31oLDOpn7T/dW7BFB05Lr0LcLQ1we3aTcNeb9z2vV+3rKge95qj6aVOWvKyhjAHpcYRqJHwnARI4UrmUS7l8OhZ6F4eJEuyn6oWOp72iGd3IL6q++h8mpstbkaRo7FuEViqaKj5BrJ+Hvy8pxvz5+X8Au1gDGvCLEJloAWYX65aaopnSrAsK1l3Z21iKM/HJjjjR5WyzCrfHl2WzlewJS2kGa/zme3iW78QInxWnUY0g== 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=K8WPPMC0+V/Ogv/jJ8cC9Enk3knEpUmrgebcSYwpGi4=; b=G4dktFCbBIMs+jxcEmVm4OwXbXWG9D/ZxtFoj9j30AQCT/+n08sCDPRiQlD07Bm3tQxs07hzL/JpEmjsZipplHL/PDdQ5I0nJ2AqZDd2WneVZDjqKq+VLoayHuzyU7VrFmkMLlt3u8B+3qxXvzmuRuSEkO79fdF5Qfi2tAty06IW+srvq0xU2sz85IY8wWOZ6FnEiUNoZ5rpKtaTyAFRhMk+P2pbQIMAz7/IjBQZP2Cgbfj2ywM0Lm/XTSAD98FND9Sq9zMHoBxp/o0Y4DWNW1PnpgS45ovkAMC1PAAQYMQcM4vb0JkZCalhqTqkQTXIv1Sgjpr8zmysnPpqswT47A== 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=K8WPPMC0+V/Ogv/jJ8cC9Enk3knEpUmrgebcSYwpGi4=; b=mbDoNL3QfCI/3dCoDZP6xk7NdtNEyber7C3u9UVqhdwRjIbyIEIA8gX056plqHr2FqipZoc5+C+EQn+eJU0e3b6Qs1wx+hBuZPPO+/dEpe9Thu7X96M9nIXti5t/xMEEntlASvZKCV8tBOnbjMuYbcsFV18nGxYfdzrLLWxSDys= 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 DU2PR04MB8615.eurprd04.prod.outlook.com (2603:10a6:10:2da::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15; Sun, 17 Oct 2021 16:21:32 +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.4608.018; Sun, 17 Oct 2021 16:21:32 +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: Sun, 17 Oct 2021 21:46:40 +0530 Message-Id: <20211017161651.9220-5-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211017161651.9220-1-hemant.agrawal@nxp.com> References: <20211013190032.2308-1-hemant.agrawal@nxp.com> <20211017161651.9220-1-hemant.agrawal@nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR01CA0053.apcprd01.prod.exchangelabs.com (2603:1096:4:193::7) 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 SI2PR01CA0053.apcprd01.prod.exchangelabs.com (2603:1096:4:193::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Sun, 17 Oct 2021 16:21:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dcef7095-bf78-4e19-55ac-08d9918a2e45 X-MS-TrafficTypeDiagnostic: DU2PR04MB8615: 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: 8D9LEZiXr3c88hTHTkSlVGQntygrJTw8XQyiUQQGeyljY6VCX0PWq/A+TGcRtUr8A9xA6ysqvV0An5KGPB/ov4axs/6ONh1OWdBYGfdyaWFq8KRkZ74ohj8yk04w7wOzbyImJnrixYVarkACzoVFLltnMGHlzcPEKHmt05V5mU9BGUpsWDLauJPW1+J9tQjSFH51QuAQglahSQaCXkqvonNp6iSOTMN6Eu+/Bp3/JI3cYcsdxRcaPBE+LExMqYnB+WsXKQPCGBwyBTH+2+72T+KIw2SArDM0r1MnBmPY6dwrMO3lad/ec52r8i5GA/DCqhnUTadUdPfk5wwemdHvE8F78GES28ZXPtSEUPHnHyzGL5VcIsFgGZhOrJmQXxAjwxpaghd+ERh4PglFDvEYAW1HwH3BesGeP6iYDi06RzbaJ8uDo884e+OM66gakOE57j2OnKmuDsNosE5NAqfmo06LGoP9jfP/NE9I9WCLJ7xj8qBO/VpypnyrOzftXEYtvw1IK92zd4sE6N14Qs+RGWv5SUB4Q9qqHQssvRVwumpWtBZPUFUKEMrPKBGBTHTrPtvlsTnO94MBA3qJkn4gEhTpVILDRaDSbDWko1hFtzhzWnBIM20k4nW1X8aYIrMRXxGp1ogENLc0I3spoQ1E4JTNM7ypaozx5CNDiC8kKdH72UjzD5jiwbCXAvZ56Q9WoRkxI70Wq6rf+q0lzaFGKA== 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)(6486002)(66476007)(8936002)(66556008)(66946007)(86362001)(52116002)(36756003)(5660300002)(38350700002)(8676002)(38100700002)(508600001)(6506007)(26005)(44832011)(4326008)(6512007)(2616005)(83380400001)(6666004)(1076003)(2906002)(316002)(186003)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M25INTN5dmk3elBId21Nd0ZyTWlIb2VhUTN5RExSdUZuOVJUSlQ4RWpCbHNB?= =?utf-8?B?dlZxdE9DbHVCeXYwdXZubThHV0tCV0dtTko3MS9TUWxvd0NxZXljc3FBcDhP?= =?utf-8?B?QTVDSFFMbUU0S1c5Ykd0NUZiTlpvdllydzlqUXA5VS9hNVFDanhwQlNPZ2ZZ?= =?utf-8?B?eG5iRUJIZkloTFNYVHo0cW91M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U3EvQkVCZEcxOXBuUEZWdXJpdU42UW5JSi9BR3Vkb1NIV1U3YnVXaHczMFdv?= =?utf-8?B?R1lLbWQwMGkvQ0RnRnNYMm5saERIYkUxQjBRRTJua1NpWGNsRWsyTkRJNkV1?= =?utf-8?B?b00xK3R6UVdBbEw1U1lWNFVoSWMwWlN1M0lKd3pTS3NxZmJYZkxZb1Z4M1lv?= =?utf-8?B?VGg0QmFueWtydXh1d2hDVEVaU3B5bzlkd1JDM1JnUklPc0xpVm9oZGpyaW5k?= =?utf-8?B?TnU1YlFBUit5U0xWRGpWUW1hMFRlcmIxMEVLU0pVSjJ3Ky9YQ0crci9MV2JJ?= =?utf-8?B?STdXcXB5VUVDWXZobHRMb1NHVEJjM2tYS3VvT05GUzZlNDZuVTRrQitHRmdE?= =?utf-8?B?TGhEYjFRNXc0R0NPdHNFd1J4ODhPMWtLazdzRjh4MHNiaWcwaGkzUHpQQTF3?= =?utf-8?B?T3dzWlFaT24vWkRaUS8yR2E0R2Q5bjNCOWxRc3RuWWFsTkhsYzJUYjBWa09w?= =?utf-8?B?SGRIWjFoRUtSZlNYZ3FGZ0dkWG5uSjU3R1FqQkpZaTVrSmx0S2N1UFd1SzFN?= =?utf-8?B?ZTVIY1JaRHJCWGNBc1NWbWovRG9CQWFndXgvbkdPWGgvTGFTQzJjS3kwdW1u?= =?utf-8?B?ZE9RRnIzaHI0eE11aGNzeDlWSmFxdzZMMXI3dm8vSFB1Q1RPbktjTjJ2b2lP?= =?utf-8?Q?nqAuntVdBqE+5Fc1zok9N8VHWST67lxLE1DiV/Q?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcef7095-bf78-4e19-55ac-08d9918a2e45 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2021 16:21:32.0811 (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: J2HCGI2juLIRZ+3+WvDcrw78AqjzJ2bKlCJ3WS9n9FslBemN6aAAOXjYEiBPAiWG7Yq2zWC0scyMhx6evhRQig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8615 Subject: [dpdk-dev] [PATCH v5 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 Acked-by: Konstantin Ananyev --- 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 c907b1646d..daa090b978 100644 --- a/lib/cryptodev/rte_crypto_sym.h +++ b/lib/cryptodev/rte_crypto_sym.h @@ -990,6 +990,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, /* whole requested data is completed */ vec[i].len = left; left = 0; + i++; break; } @@ -999,7 +1000,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