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 8D7A543804; Wed, 3 Jan 2024 04:54:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1601D402BC; Wed, 3 Jan 2024 04:54:31 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2059.outbound.protection.outlook.com [40.107.223.59]) by mails.dpdk.org (Postfix) with ESMTP id EF101402A3 for ; Wed, 3 Jan 2024 04:54:28 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NFuPgr12g0xZwUXVE7yyRK6VHcvmPAMgOgEmKPlRyeL9q97t73e+vJiESO2lwxazBJlw9OMUirA9N1t7fJUWiOTJn4V0jIyjEQnLqPcoGOlYU/TFgC0P+GAJfE4V+WuV4zMRdF5XhniFHYPWQuKtUrZZWsvNaOW4lIHC7vomhgZP8fZmTY/1wE41eCWGvPcfWmL+GATy3TrhFEKVybHqSaLLniGprzFz+IaPsvhRb+aBdJiY9WBVOs9HNTDxkqPGit7R99OrYYeEUcfACf7lC0Y4RsecXSURKo6NLz46cmpKqMljyn/+OL42o08V7QAWQcOSuLYON+BIUBll9ITKEg== 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=x8FSyffK76mr666P405PEg76Z9R0PObb9X69MvGEzE0=; b=AS+Ee7HHbV1xWcnQ81zr1NiZJPhxSYrXb0nlZd32AytJNk8g7tH2pbixQNsJUxn3CIHNl+W8G0HmmNL0r0X+kRz48qGzLRbmW4YSf59SrTvcT+wz6T5QskrYetHcSi/9d1r05DCtyhLuy05RZ8eOSX0C77kggdilL+X16L5E13fJX42e3XGBkiRTKrPYHS1mD+fmlYlt+JVX8Tis3G9wwCdnXLskSZq9qkc/SOX5Xe6HG7P5rWzwpBlgTVBu2IKdArHk+VN6oDy+RiwqZOhmaYXIn4b0GSnu4KUZBowlhEyB24G0pXCGVWRe68A5roDHHLvwoZiHKP+BtMe62ODYPg== 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=x8FSyffK76mr666P405PEg76Z9R0PObb9X69MvGEzE0=; b=Taf3GiEeiozj756sfA5VgbeYH3deI8RKv1I9io0xE9klmeK0bQoZjOe1sOl9huMO6VxVGl96Hx8qpuG5CI8GphtGdwIS0nINLAInJKmi0wgEV54qqo4W01CTVT/8a+uw7/AC1Wb3swqZ2TWCwF11AYpzeKEAXFfd571AOZJE3l9dLW/ao6Nq6gA4xnwk8/9QVFj3lGKhftEGypzMmOyY3GdDlpnPkWL1+op7VrVkwIVoZ+7yUtPfRu6VDHbnG/Ag412M70iR4SHdqzDMkIapmo8VBeBY4BWRqu0eV3NtzDeC64xMXeADK8tURR+3kJIxr3wXcx5pSSjQvWtimWJhfw== Received: from PA7P264CA0339.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:39a::19) by LV2PR12MB5992.namprd12.prod.outlook.com (2603:10b6:408:14e::17) 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:54:26 +0000 Received: from SN1PEPF00026369.namprd02.prod.outlook.com (2603:10a6:102:39a:cafe::e3) by PA7P264CA0339.outlook.office365.com (2603:10a6:102:39a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25 via Frontend Transport; Wed, 3 Jan 2024 03:54:25 +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 SN1PEPF00026369.mail.protection.outlook.com (10.167.241.134) 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:54:25 +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:54:12 -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:54:10 -0800 From: Suanming Mou To: Ciara Power CC: Subject: [PATCH] app/test-crypto-perf: fix invalid mbuf next operation Date: Wed, 3 Jan 2024 11:53:57 +0800 Message-ID: <20240103035357.720016-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: SN1PEPF00026369:EE_|LV2PR12MB5992:EE_ X-MS-Office365-Filtering-Correlation-Id: f632ab86-e379-4227-ad57-08dc0c0fad70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3T3pZDufgLh401uficPIJZg0pH7tMhwb8MI9CIkziYw10k4eL8iUsEzVRNymlA1+0fDq0w16VZQ3MFE+3MO2jLM9dqz1/31x1dgAPVR5awdVTowRvm01gEdYc7M0IhG+vcXfv3XE9cssifJU+nvMyjJh17u/Btl+tHTsDdilla/wKDMm441Z7zHbpk0MoY1kr/Lah5+eOgWi5wMsu5Jl4F5tJkXgSORKrJXA83taswDcypNif5yEirstf+6x9bS1yoAgFKbgX/Ji1hvL7Z0WR5QWbI2JVj9twVUulcdTfCaR22S8DlisPGaJdi9XSss50io194sKZ6ppqMQGNVcFOkyLfG1sNe9BfzkKJIqkXFJFkwdBcy8Cy2mvQAZ21wgXM9b7i6SDtoqAmheMhOwjkWTA6eJ2zNaWznavXq7JM6ybcQSmuNynOUcKn/Wulqu632p67hbc+COLNwIcxu+9y5n8/1rY5bLvBeNitHcq4HoP0PabUpwq8nKug4ErvSuEwtVTGO8Y8k6wM+rJ0rPr5CqgKjqa+5vKnyFTNB+IknxJL3PveFc5UXYWul51RVZA7kATiNbvBQUy8HzQsE11DjS1tHnORh7fxUzhIV6fZ0MRyLn+2WsxpBbjxcTJaXKU4wsBVvsp+O2LxzW8e8xCtxk/LpPyeNY4hMz1aLALpveauMS5kiDoXPv+JMWJkuyogbUkL+bFKMTYaUSvvxH0Rp2/XIPqLWT/ND5VENT8hfOmd0uOPgWg1rJSeRBWZPmB 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)(136003)(39860400002)(376002)(396003)(346002)(230922051799003)(82310400011)(1800799012)(64100799003)(186009)(451199024)(46966006)(40470700004)(36840700001)(40480700001)(55016003)(40460700003)(6666004)(7696005)(478600001)(36860700001)(86362001)(36756003)(356005)(7636003)(2906002)(41300700001)(83380400001)(16526019)(26005)(1076003)(336012)(2616005)(426003)(6286002)(47076005)(70206006)(6916009)(82740400003)(8936002)(316002)(5660300002)(8676002)(4326008)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 03:54:25.2247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f632ab86-e379-4227-ad57-08dc0c0fad70 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: SN1PEPF00026369.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5992 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 In fill_multi_seg_mbuf(), when remaining_segments is 0, rte_mbuf m's next should pointer to NULL instead of a new rte_mbuf, that casues setting m->next as NULL out of the while loop to the invalid mbuf. This commit fixes the invalid mbuf next operation. Fixes: bf9d6702eca9 ("app/crypto-perf: use single mempool") Signed-off-by: Suanming Mou --- app/test-crypto-perf/cperf_test_common.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index 932aab16df..ad2076dd2e 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -72,13 +72,15 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp, rte_mbuf_refcnt_set(m, 1); next_mbuf = (struct rte_mbuf *) ((uint8_t *) m + mbuf_hdr_size + segment_sz); - m->next = next_mbuf; - m = next_mbuf; - remaining_segments--; + remaining_segments--; + if (remaining_segments > 0) { + m->next = next_mbuf; + m = next_mbuf; + } else { + m->next = NULL; + } } while (remaining_segments > 0); - - m->next = NULL; } static void -- 2.34.1