From patchwork Tue Sep 7 07:59:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507506 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4012238jai; Tue, 7 Sep 2021 01:04:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0Yx9K/I+hi5JoTjIsnXicO8kCIRudAMHpvXisSlDY40h7OrwXpcLUZJgaRxrFTZS9BVWA X-Received: by 2002:a17:906:f289:: with SMTP id gu9mr17012117ejb.559.1631001872343; Tue, 07 Sep 2021 01:04:32 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id v10si10020882ejy.710.2021.09.07.01.04.32; Tue, 07 Sep 2021 01:04:32 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=oSaJ2wE+; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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> 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?q?krjolHNZRw8y6hJ28POSG0Uf8?= =?utf-8?q?w2EVneGcAUt9071gfsawtlHaFWPTCoTnnLvnJysFT8eUy4+JxUBRA92J?= =?utf-8?q?qwnyv7r24pkzfvJ5cKsgFTqUIatOpUWNs7Dxbpt9O2N13Kzk1voTx5iB?= =?utf-8?q?w9FqVHcb/Ym1ZthPfE7+hjrIj8Hg19IMMFoGSvmwm1nXai2SZL/GKmip?= =?utf-8?q?ZH0Fhl+mWp7VzS/1eOGBk0bqQdo4qFjZmTH77YTbk3bgLo0ujvOl/WXM?= =?utf-8?q?1zqHZyBIH7f82eWy04mGpl/EYVXtVturk0IopoQbnvnqPca5CfO0bU3P?= =?utf-8?q?T1pxgBIF2lqGfP5Gky13IR6zTcqOyXgatOhl6TllQUkL6x/y6wXcLxMM?= =?utf-8?q?ZyMKX5g/tM+4xIhcG1/8bCk6oTuVU+/tQzXklzugpNQAvYNIaeJcZkAe?= =?utf-8?q?4qKLncrCn4fBCv5hf+zoXbLtxmE6sGv30dUHLjQ6ctJHTtdrtT6IMRUE?= =?utf-8?q?SbNyCjyBjgJKg3RU3Sx4mKmc0qxMlOK8zzOM7ClnZYVDM/0orLD3kjXS?= =?utf-8?q?cVns4IDB1O9CCHb7iHplBJtwHWQxgYdSqp2Q9XjU6iBtR6IsGrXJzmms?= =?utf-8?q?ztdNycmUUoH+g/2gX6oV6kb38rNWev1EL40p7TAqx6KeOJrN4LoqPL+3?= =?utf-8?q?KkmvpiXFldeg2va8N0INyxfSB0O8Y4ZLF8dYMw1/YY9Xe0vwoAqwMh1/?= =?utf-8?q?R483/9N/GndbevgZnW/e1+2yUte3NU2jp9WEml7Zfrfw00nwPbITkFo4?= =?utf-8?q?aSJui+lVQIFJ7Iy1AHsycc3d1NEcEtGOWDbqhLjQefamwEAR6PBH4b3X?= =?utf-8?q?5hMHCfYg4SvLMG/AEGpXTiIp/gv+neHLwhMUcufanr+TPbY0+StjolkC?= =?utf-8?q?Yw8kMgPawevZGxyd0doBns0sPsm30s92YshTztwQFuRouRkRndksbT+o?= =?utf-8?q?gpjmC1GoaWUEQSXB0FKFw9fk4I7m3ndVnbEye9Ocn+uu+J92m4/NeuLA?= =?utf-8?q?3svelf/0mZhs22m9f14YarE21ZlsgBx5oJ/aKwj3HHIazRQ7kHB3Us8m?= =?utf-8?q?JfsW3XlJl4jgYjaQyLqWpuSI/YpSn93NsgWxgjJ0n5u6n2aYEdLDaAnC?= =?utf-8?q?os4a0CQIedv1Z4pBJLcrtM/9GnEH8D+1n1YEY+scgIXtgcRit+KERyCq?= =?utf-8?q?FOykpG5vN6WDNcspLkRXKTG24jNNsIrh3dCv24dpVBzCjEgdi3Mn2OOj?= =?utf-8?q?hOkxQAdUkSfTZyHc2x4uHtygyM1oDaMhjkSaeG7hdgDrhULPqw+s3DGo?= =?utf-8?q?7xiAsqy1CN/tuCcwL7X0fvDdVklzU0lexsHuNKBCJFVZLgL8hEYLtuRB?= =?utf-8?q?b0PAG2GPmXcNlAtPJSvkDlSsDKoTRJk?= 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(-) -- 2.17.1 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; }