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 A8C9043804; Wed, 3 Jan 2024 04:56:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 933B0402BC; Wed, 3 Jan 2024 04:56:42 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2058.outbound.protection.outlook.com [40.107.94.58]) by mails.dpdk.org (Postfix) with ESMTP id 104D4402A3 for ; Wed, 3 Jan 2024 04:56:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L4DtOlRP+CI8Penc9XClQTa5vYemfpUnhfZ/uwc09GUzo3gGsjQJm/9DrH5EHQjamQb0rXkRNdpkMkb889blvrekinjGYFSZZ+85PzhIADnFrq565bhngPjUjXCQHRPsx5hp2FszbQ5jnH4pEVocE3u5BwUbqa7StgbXdkY0xpxbp4UQtVlrRKP4j5ImS83g+u3yZcmhAJNJuPTeMrCCfFZQR+q9mKOBzAqtgbucm2fZ3Cy5FT0TVPd0kVa8Bkf+F3DKGalW0Ew5dD9EdcIt+rdot2T4AP7iz/asNMOT/jvxbMAtkVa316TNdCvEoWsiPWx/H/sEXa605VAlOC/WSQ== 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=WOJaWQMIt4YqpP2RxRB0tw2kguMZarYUypphVAB7vUo=; b=QvNvk0oPH7sCLPuGWl3xXuucfVfhKvpbTAMjIGpQ52IpfdTuGDC3dwOQ41tZ2aHdZ99IxJN0aEVfWgZdwAcLOrFp0qCXcBFAQ9tAios+cPnnoT42bWJsBu6hAHu90HLlwwPa50nE2WpvLm8Rf6GnF/SaAwWH/3G32ZnyX7Ihmt//k6p/+sATzF07svv9U6wD7pRG5xTAQV+k07qn0hTBJtMtmhcipc1mdbURZqrLqUFlY2u7ZKCpFrfL3oEjolXxjcL9mURCAmB7+3yTrjDfWdrfTO8GDqS01pekP3ZExjxKQ4JU0b9knMyWqdCUVoGjLoB3VVyzMr82HWB2Os4wEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WOJaWQMIt4YqpP2RxRB0tw2kguMZarYUypphVAB7vUo=; b=DqjnxqDX0Wnc9jvjxlXPw2BO1ZAo2/W6zbusiYLKM39UTAqh7nqdhORy84kUp9GKD/d/ij+YtYXdKvrA4OpXne7sED8V1/KItxnDP1m+4VJpgPzLKAtHVtPM42mtDDSVird9Ras81uQT89sCl8gHxC8SD3HDzDBMKOdp08zfBmg6ESshgFYorXTAPkhohx9rDCvNiEw4xr3TPY05awSNWHXGEvpM6db0aUO2FWXb3yFmayg2DIaanSo4vmmLwk2sY6mcOy4eUDeMtoMPL8RberuxtCSjpEG4+CJciGFgy/vhuROjvMhZKf+sByi2R1tmBuOJSA6vVMnkwD6QDc+uew== Received: from BLAPR03CA0039.namprd03.prod.outlook.com (2603:10b6:208:32d::14) by MW4PR12MB7237.namprd12.prod.outlook.com (2603:10b6:303:22a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Wed, 3 Jan 2024 03:56:38 +0000 Received: from MN1PEPF0000ECD9.namprd02.prod.outlook.com (2603:10b6:208:32d:cafe::24) by BLAPR03CA0039.outlook.office365.com (2603:10b6:208:32d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.22 via Frontend Transport; Wed, 3 Jan 2024 03:56:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by MN1PEPF0000ECD9.mail.protection.outlook.com (10.167.242.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.9 via Frontend Transport; Wed, 3 Jan 2024 03:56:37 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 2 Jan 2024 19:56:22 -0800 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 2 Jan 2024 19:56:20 -0800 From: Suanming Mou To: Ciara Power CC: Subject: [PATCH 1/2] app/test-crypto-perf: fix invalid memcmp results Date: Wed, 3 Jan 2024 11:56:04 +0800 Message-ID: <20240103035605.720256-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD9:EE_|MW4PR12MB7237:EE_ X-MS-Office365-Filtering-Correlation-Id: c9b3c592-84b5-4457-937d-08dc0c0ffc83 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D6jFPh74mJ8LrIJHSr7OhAgnmJVspYES+qRYp5G/f8tm1K1ZH4OCFAvX9hBlEzK9yjBdsm53AJSlhmTe2hcrLwqUHQEclKPPFXlARMp9csHmVhQh2rXDyLNaNIP7KrmiR+NOSe5wUgRWTbpest/xKP409rhTxOFMqkXaarJ17PMFql79bl6I+YTMAeW0wsDqaB8RW/dL9/K2vxxx5f/gKCr2nJRdJwP597j0MhYfH6JOYdBxwnDLKSp3ys/3cuM3p55umZuBPYejihUzb29uQnIBng1imoqio6NSzDxzS7oDdv7aOo667jSDgbTb1Fp3uhwZrCwqD2knnb9lRJmyOoMhvBJTNp52GNVK2Vs0Ds2TYufXHmTVUbb7OeUs0uoPLned4pza0q5jIuZmH9bYDCCXbwvpVaDcyF3ft4iNH6W2l393hwCwctIxXrr04FsGDxSmRc0fKZM3oRUx/rFo2fIF9HsvjuxX41YnWkroeD3PgQTKViLPKO2cAxakn3BSQgpjREP/WHXMi+G/SkBxxZKSKDiQ1iN2kd5xvL4pEdmU/75hjxAK/yboJcElsQtxgjPCJI3swFg56gNLqGDP3Id2ihWP0BWVEemQ6njjZQsvz8/Vrc8XXIOS+7MKZNimzZzepN++aasbvpbFr0R7Xs8vpsJvXyJyuTFRwrGOksb5xAZfbeIQ7P/iJgDAVAM899bf4O0GHmFtB7J8XWets1goCxX34CEW9iyLlg6ES1DpKAS77X6/eSXh9KDzHEC1uvzqOD03clJkw4Rz8htDfQ== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(346002)(39860400002)(136003)(376002)(396003)(230922051799003)(1800799012)(64100799003)(451199024)(186009)(82310400011)(46966006)(40470700004)(36840700001)(426003)(1076003)(6286002)(26005)(336012)(2616005)(16526019)(36860700001)(356005)(7636003)(82740400003)(83380400001)(70586007)(70206006)(47076005)(36756003)(316002)(6916009)(478600001)(86362001)(55016003)(5660300002)(2906002)(8676002)(8936002)(4326008)(40460700003)(40480700001)(6666004)(7696005)(41300700001)(309714004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 03:56:37.8416 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9b3c592-84b5-4457-937d-08dc0c0ffc83 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECD9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7237 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 The function memcmp() returns an integer less than, equal to, or greater than zero. In current code, if the first memcmp() returns less than zero and the second memcmp() returns greater than zero, the sum of results may still be 0 and indicates verify succussed. This commit converts the return value to be zero or greater than zero. That will make sure the sum of results be correct. Fixes: df52cb3b6e13 ("app/crypto-perf: move verify as single test type") Signed-off-by: Suanming Mou --- app/test-crypto-perf/cperf_test_verify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index a6c0ffe813..8aa714b969 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -186,18 +186,18 @@ cperf_verify_op(struct rte_crypto_op *op, if (cipher == 1) { if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) - res += memcmp(data + cipher_offset, + res += !!memcmp(data + cipher_offset, vector->ciphertext.data, options->test_buffer_size); else - res += memcmp(data + cipher_offset, + res += !!memcmp(data + cipher_offset, vector->plaintext.data, options->test_buffer_size); } if (auth == 1) { if (options->auth_op == RTE_CRYPTO_AUTH_OP_GENERATE) - res += memcmp(data + auth_offset, + res += !!memcmp(data + auth_offset, vector->digest.data, options->digest_sz); } -- 2.34.1