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 12F18A0C41; Tue, 7 Sep 2021 10:04:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01B9041155; Tue, 7 Sep 2021 10:04:00 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2044.outbound.protection.outlook.com [40.107.20.44]) by mails.dpdk.org (Postfix) with ESMTP id 0899D4114F; Tue, 7 Sep 2021 10:03:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VZtggQHX2eeU3JBUWgaAMJP4Z1Y908Zil/haewh5IKFzDDWcY+N/Er4wKzcuS/DuyajtZzvmhoMwvTI+CDIcju/iPrJxAX54xMIvx6K3EMAMCEbIEFaeVZEpPQH9OdyOlCaBvEXe3ck8rwZzZIpQiaj/FMeQsgAW+0honZMLNpml4bwMreTtPN/J0ar89aVL6VMhc/D3hy+e24EnsZ1l756XAPQxf/EdiIXuFMTk9LzRhUK66vyQ33K5bEnDeWxAqLMjUja/rc3QBJe57d7WT/CxM3uVjXSmAQvi5x4pXf6K6+5TUVmjDog9u/3pUwhpga4LiYZNKAdg3vU0ggrAmg== 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; bh=3fV331TZzSriimeXyPguybwCyUI5AMS3g+uO0tgL16Q=; b=N3Ew3gBhjX71H+2mCom4bvFn6lag0Kyh/Vb3PnXmt59oIAM+tMrFmY4ZWnx0OaC6CMQVMHQ4DBK2rAdHBpJIYf22kCf+BGnLL6vegXA5DE12a1VH0MZ8wJSwFilgRSwzfT2o0RWikDCoLV/nQzKRB5FR9eEnH8g22ySlBvg+M6qu602s4yCvUYYxKjv5xokn/+d49bKChH+0Yw9l5JD3u41v8iP5rO/tMproP/JaLCfT70O6hZ2pIqsLI7Umfg+yS/S5aSpHiK9rHTlSxdFPFkkfsV5mekute758fUg39DgFd2UP6dRj5kkgpeWjz75y6Q1t2aHm6MgQA3Jc4it83w== 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=oSaJ2wE+xjxdnq2izQp4uquyykEr9KAJ8V8mn/jgBP+0J3/+5/1C852PbN3gH/DK0tC3GANANs/YujkXX23r9W2MjepE105GAt+rGXUM0y5nNGSEU+bxQ0AP/9YQv16L4StMH7hWz//dSYmJKnLG6b/Dr/K9feVuo9FM1l7i8kE= 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 DU2PR04MB8709.eurprd04.prod.outlook.com (2603:10a6:10:2dc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:03:57 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:03:57 +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: Tue, 7 Sep 2021 13:29:46 +0530 Message-Id: <20210907075957.28848-5-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907075957.28848-1-hemant.agrawal@nxp.com> References: <20210825071510.7913-1-hemant.agrawal@nxp.com> <20210907075957.28848-1-hemant.agrawal@nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) 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 SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Tue, 7 Sep 2021 08:03:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9b79ed9-bbad-4f98-3c90-08d971d60ae0 X-MS-TrafficTypeDiagnostic: DU2PR04MB8709: 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: sqDabl02zk9OBXPpb3GwxkXnShT6HMxu4Ipv7DnzaNShnCYlksNOCaq044hCv4PDzjA7j59dZoQQa9dpwt5kHVN1Tpzi7829L9TeftFEhyVC0X7DKMnRnCDEiDjsp/uRDT1wSjnpo/sqIUH6nV8UQhpkLdCZ+9GQv/CJKgL65uCuof128FM9gluKR/O6fFx5TFcoyJ8PLNucHXk1fLk7PcoiYtXOQ/8Oj2zHCyeZVBNmXFOwmTslXCdGvm0Dp/GWg1gzO3YehBhww/fdVVn0CEtBVEu1FqZS20HPo7pLTxm4l95oRzTDc4Tff7THf88GtVAaTXHOiTb31Jh+fjLaeLExPHzmf3HGXaNgH7+2hDajFfUTVBflOzeRxLb63+ZQOouyPYzy2/FsRwLiYWRXHl5pynMHSjIaAe0VNfArR/agTlMjY7P4rdXZH2PhLlNbtSZhVrZnztKX1SyIfZCaiF87NNfPcLe5FwMFiDuYbmHFx4YHuPj59X2qRKpf50XvsprrTzjDhWlo8q2MmLCplNp5oEiAx+TfaFR3Qo2OcaBiOuCR412vQiA+pHbUdm4DDzFh4ZOnWZALhbIEF9RlGy3vnBtLX4B7LtB6qxsjjGJ+7NqP+1L6WBZOxt+ByS8yysOFks3oVunVvra0L/wjS6uUGYG7nl1OzPPq+r2zEkWbhyAB2dW3qYCIBBbVP/GQRjr+s2WK9VcSKRs6HMcfRw== 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)(39860400002)(366004)(396003)(346002)(376002)(2906002)(956004)(2616005)(86362001)(83380400001)(478600001)(316002)(6512007)(4326008)(52116002)(1076003)(5660300002)(38100700002)(6666004)(38350700002)(36756003)(4744005)(186003)(26005)(44832011)(66946007)(6486002)(6506007)(66476007)(66556008)(8936002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?a3Jqb2xITlpSdzh5NmhKMjhQT1NHMFVmOHcyRVZuZUdjQVV0OTA3MWdmc2F3?= =?utf-8?B?dGxIYUZXUFRDb1Rubkx2bkp5c0ZUOGVVeTQrSnhVQlJBOTJKcXdueXY3cjI0?= =?utf-8?B?cGt6ZnZKNWNLc2dGVHFVSWF0T3BVV05zN0R4YnB0OU8yTjEzS3prMXZvVHg1?= =?utf-8?B?aUJ3OUZxVkhjYi9ZbTFadGhQZkU3K2hqcklqOEhnMTlJTU1Gb0d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vZ3YrbmVITHdoTVVjdWZhbnIrVFBi?= =?utf-8?B?WTArU3Rqb2xrQ1l3OGtNZ1Bhd2V2Wkd4eWQwZG9CbnMwc1BzbTMwczkyWXNo?= =?utf-8?B?VHp0d1FGdVJvdVJrUm5ka3NiVCtvZ3BqbUMxR29hV1VFUVNYQjBGS0Z3OWZr?= =?utf-8?B?NEk3bTNuZFZuYkV5ZTlPY24rdXUrSjkybTQvTmV1TEEzc3ZlbGYvMG1aaHMy?= =?utf-8?B?Mm05ZjE0WWFyRTIxWmxzZ0J4NW9KL2FLd2ozSEhJYXpSUTdrSEIzVXM4bUpm?= =?utf-8?B?c1czWGxKbDRqZ1lqYVF5THFXcHVTSS9ZcFNuOTNOc2dXeGdqSjBuNXU2bjJh?= =?utf-8?B?WUVkTERhQW5Db3M0YTBDUUllZHYxWjRwQkpMY3J0TS85R25FSDhEKzFuMVlF?= =?utf-8?B?WStzY2dJWHRnY1JpdCtLRVJ5Q3FGT3lrcEc1dk42V0ROY3NwTGtSWEtURzI0?= =?utf-8?B?ak5Oc0lyaDNkQ3YyNGRwVkJ6Q2pFZ2RpM01uMk9PamhPa3hRQWRVa1NmVFp5?= =?utf-8?B?SGMyeDR1SHR5Z3lNMW9EYU1oamtTYWVHN2hkZ0RyaFVMUHF3K3MzREdvN3hp?= =?utf-8?B?QXNxeTFDTi90dUNjd0w3WDBmdkRkVmtselUwbGV4c0h1TktCQ0pGVlpMZ0w4?= =?utf-8?Q?hEYLtuRBb0PAG2GPmXcNlAtPJSvkDlSsDKoTRJk?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9b79ed9-bbad-4f98-3c90-08d971d60ae0 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:03:57.2319 (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: FEQCTGJmRjspBUb8fF+0sAA2kv5XGfxSCBFLKDhnsalWV+VfcSXnssCjjB6drU+xnNHfA8592nKk9KCBFS5www== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8709 Subject: [dpdk-dev] [PATCH v2 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