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 79C33A0C55; Wed, 13 Oct 2021 21:05:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2987F41263; Wed, 13 Oct 2021 21:05:10 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2080.outbound.protection.outlook.com [40.107.22.80]) by mails.dpdk.org (Postfix) with ESMTP id 5B1504125C; Wed, 13 Oct 2021 21:05:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dEau+mQR44mlWyLtaJsONGRoB2J9hj2NHxwiMeTOO00yyKeEFPGNNbmt5J4oqlTA9K+Brl21O4K8wcSqk4zwvukDZqUmbU534XQ+7hv/X2Nq6ORfUa9JRAqB1VVLszGvCfB6U1TVr2ymmt9iH2mJeKWfwCvHstrJnM15f9VuRHsUriBvr8cBuf3p88uYYGf1L3gH7Ofl8FU9RUgBdHiQcsrMA6wpGQR47WP7FY1zLd9Dr3Y6JBzD0NQwy72ns7mV/bFy4TSTEWUeQjftK/SqoGnfJKLe9Bz/myCcLU3Yj4DocbOzB0tjPUU5GiocOpl7scag+3Q5PPqs71jSOuqnaQ== 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=vncqNM02Nl2gWPH/HpbiSKi/QN0Z6/fk/13kKOQU/xo=; b=jNsUeOW+s89i5De92l3lYqyqKCjKYvFkGCD9bbaxWDzE8oI/maRs+vc5p5Ld6+LGpFwnW5oYwXS/WZ/FyUSvWDwb0u7DfRgfsGC++7ygdn3TyD42dAskrOktdXRGdXGdLCKq1rlJ2OqmNRtYOM6eFgwjTBaqeyElF5nGDz0masBQ++8512RH7Uxlrs5yWLC2LhZ/v145Dx4CouNu3otADDVdkaO8tti7iGTFn8EGvRtXvEsX9U3YctzpvTzPAgQ8ofzD1beglnnuSHsnI6pe+27eAXD9cy9Q/mPeFILcNx7epfwjip1myNiJKAncy5qa3dA1ZWqJgumbzlf1I32n7A== 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=vncqNM02Nl2gWPH/HpbiSKi/QN0Z6/fk/13kKOQU/xo=; b=TzRzGQ8KHe+JxrAyPzXeR+Q+DhKBMe63cwGOLXJngTzVLgv3fUtB7D8Wmii0lucxu+N8wRzPxu6/WJWhR6r4p2JfNPSXDhVpLt1BAgjCiqC9UwD3PzpgchrG+Z7E+949C4EFyvyK9MP7Gd9l9XFQTj0PUjHg7MfMvv055WP2HpM= 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:08 +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:08 +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: Thu, 14 Oct 2021 00:30:21 +0530 Message-Id: <20211013190032.2308-5-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; charset=UTF-8 Content-Transfer-Encoding: 8bit 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:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5809e65-c990-46f7-b875-08d98e7c5fb7 X-MS-TrafficTypeDiagnostic: DU2PR04MB8870: 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: 6zttAF5n8xNg0djCpAEFnuApkHnFF9n8C/a4FK6R3UzSPtTiIJsGmBiDCoMHTiLXgzsUVBED6CJxNG6OcZ1voLiyVF6OQPmlBDQP0O0dM3H+XzkN8q1Cpe/wai4HFZ12DDvE8iq/BolYLhQtQ9E732QfuZswN/dS/By/UmXdMXoTnKsge7CtdEpOLs5XAS9qFZfuMpjQHROQyb/BHdnXVr/nGW6qOvRifPJDvFGZUVsRjt970aJQ3bwmLsqzbgN4QKvd5z6+q1q7UG+u1rGWQRBJDqbcBxxVN377JEpWc60WwIQ6iFX9EEfnG4Qbk7SsiZcnaXfwgBW2GabCMUrNMWO3r6MDg9O/E5X6mxgAII/x6M5S54o2VRNbDGHTuvmcQIPzB9m9Cc+AdFgZGZJRgBeAiBmVhmHBnVjarwH27G4OS/EVV6Yr+D9vtuSCt2y12jRmhyZX+7xrXIFnWJRxlZIZ4iUMliPWzX3ViQQg7MGepgd6jviVcGrsIXk6O3reDBYN7V6+pF6sMG1yuGo1DnXId7sNtxZB5roR4b96XUIupaETlEcYdQTW4lHcRtB8RgERBfaUMRAfuVFdObiT4zaPoi2sEOZ7lbKaUQDQMf0jcuE1L2xGTisQOKeUUS2vkySN3nqB/ykDYlt+QHAGm45Jsec+8ykFcjsQiL3RgXWmrUTSC5nj7t4og48gnQlFOCs9JIecMie67l8TSVOZog== 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)(6666004)(6506007)(36756003)(6512007)(2906002)(8936002)(1076003)(52116002)(186003)(4326008)(956004)(66476007)(2616005)(4744005)(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: =?utf-8?B?Z0dhRlorems1YUo3ZHpuT3VPUWs3U29nR2M4ZXVNMjhNek5FUjdCTHNXWDdi?= =?utf-8?B?VkluY3hDVXZJQThseFQzcnFvQXBsQkowSUF4OFgwNGFFS0FHVkFtU2tSNXh6?= =?utf-8?B?dnVJak9FNzVnYW9wbHU2Z3NzSmc2R04rWnl1Nm42UHp4NS9IQVNFLzVMc0dP?= =?utf-8?B?TjJEWEUw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?= =?utf-8?B?dE5QcEVmSHZHK0xJNVEzdVVkQkEzYlpiVnp5c2s1WEFwTEU5ZzZzN3BKNlkv?= =?utf-8?B?ZVBUWHh5eGcxWVQzd1p3WmV6TWxDQUIyNGxGSFJjSkU4TjlTSHVldnZYbHlJ?= =?utf-8?B?TnVEYWwzK0wxTFk1YWdSOU1yd0tuQXhpblE3anVjVE5odHBYZ05NNWt6UHdq?= =?utf-8?B?angwU0k4VUI3ejk3RENCeUlmS0pCcWhOS2xnb1YwMk00VVJYczR2RmFBSW9r?= =?utf-8?B?dDdKUTV2Y1llbktIN250VzYzYlVMUjZnUlNraUtRVWdLTlZKdnQ2NFBjc1pK?= =?utf-8?B?SmtKRk8vSXhsK042L0MvWWgreE9zMVg2VHpKV05mMkp6WU4vM2xBSHVqRGJq?= =?utf-8?B?dlB4cDQrbStHUFZDdjJrV1ZFckFiN0hOd296em55OFc5OUNBK0hKSVdhTm9T?= =?utf-8?B?OTd3YlF1eVp1Z0hDdlJlQXFtT2QrTUhyM01TYlhLeTlDa3A3U29ldy9jQnk3?= =?utf-8?B?K3VPWmlKL1hPVDJVd0tRSGJDUlRsSzdVaGR6cUJJSk9MbEtRKy9vY0NCMmRx?= =?utf-8?B?V1F1WllESVBEc3hmUGR2ckJDeEVBRUkzZHBFZGVIZEZuYXJMcytyOGI1aVI3?= =?utf-8?B?N1IvVjJmNG0ybmNRcnBHdmVvTEgyNjRyME55cDNKOFIrSzFNcDhrdHJ4VFZu?= =?utf-8?Q?iFiAPIi56osuob1OicSmPZSsGc/s4ClI5xrHRpi?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5809e65-c990-46f7-b875-08d98e7c5fb7 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:08.5995 (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: OKYRE5wvfiQ7tZ9x56+nwVzgNeFcXBhVGbxNKPpTkmUp6KL4nVEFExfh1On+iGJ+zeEkCcAPt5igaWi5DmyOMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8870 Subject: [dpdk-dev] [PATCH v4 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 b6a229e263..dc88ad6dcc 100644 --- a/lib/cryptodev/rte_crypto_sym.h +++ b/lib/cryptodev/rte_crypto_sym.h @@ -1004,6 +1004,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, vec[i].tot_len = mb->buf_len - rte_pktmbuf_headroom(mb) - ofs; left = 0; + i++; break; } @@ -1014,7 +1015,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