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 E8528437DF; Wed, 3 Jan 2024 13:35:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 768A6402DC; Wed, 3 Jan 2024 13:35:55 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2043.outbound.protection.outlook.com [40.107.100.43]) by mails.dpdk.org (Postfix) with ESMTP id 0752A402BE for ; Wed, 3 Jan 2024 13:35:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VhOoP76Du7ctUKLiZdKYARHsvPjfLg2Jqz+xkGh+reBqUM2bf7dDFny+q+gsp1J5edGacHIMPOwPY0CNagqHZLab8wFw8OtwBD5DJMbKRqrktYC80uTh3fDQA+4YTgs89y8JHsgH6vEk2GC6SnR8/foUJJ8nJS3A9WnqJyBRpPAhapMQUUhRv8JuVH7ifHmnIfW4PTkxjqqfAmyEbBynTp0KHQQCxl4s3s3ORVDbI1kk5Z+26tzujNHgCsHH+Cr8Lotq7ixy1LhCBugOFBpphCS4t37gjuTnNjMledaSnp4pP+qza53fUzIbMfoBUHE6yNts2kJJCoWQt8YFqy+Rtg== 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=pcEB6mVQgmbjHNRNEbK2rKKK7/1GJd9ES7RoaLOyV58=; b=H4E5BGGCQnsaJvu2oeZR5mbgwX5D6H8TKQbrGqp70D799PIMjm1BB17VJhlX6WE3xDzxQeQeuHHTWc0ItghhSpXrsxzPWYfUAvC7XNoNJLePFqVQf5MbKv/opzxON9oqPEAUforcd5ekMUoV5XXhxXMhCFjFRREEmc6M3oH8cvrKIGJpzrHp3ZOupAAZDzhkclPxHVjdSZuynsNGzrpa/5FFVNXElVH10wOMwVXWDC6iN28Zt6UGVePtpDQKZia6ous/hTMw8zqWKHhJxnELme6MUlB3kR9U/+o12EyRjg5bInRdAOraBpbY3QTzi3Vs9IfOlv51C5GqLyumZbqWuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=pcEB6mVQgmbjHNRNEbK2rKKK7/1GJd9ES7RoaLOyV58=; b=BLZd1QLbKNm5WxwVxxA6Q9WoLUEEVr6WltUglU4xZ/bQSMZ3qcGGAxSyIwFHoMlI8U0KrIvh1uMjCdh6pJ2Vh2WY+lbi/cD+xpugMr1TI/cNIV+f9i8MJk0mhFcP1xUpbz2ITMtaorJ6WOyEx8zJY+/EFYJRCpSqxGrU0MV0yE9F2xttidyEdan2gekD2VQW+mttczDhKRmDv2ELE6cGqyDgm0yUAUvofN2cg34OZdwVxfQPm8F3+xsq1IIphRqRM/CrPHklP5SzsMjDjetCrxTWOw9HO9v7IfNKAtsfVpb3l0vINZxzUiFK+s81Nk64Nr1td4vjIzMjZzQHIL8wbg== Received: from CO6PR12MB5396.namprd12.prod.outlook.com (2603:10b6:303:139::8) by BL0PR12MB4850.namprd12.prod.outlook.com (2603:10b6:208:1c5::20) 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 12:35:51 +0000 Received: from CO6PR12MB5396.namprd12.prod.outlook.com ([fe80::18b:c5f5:5d5:d9cc]) by CO6PR12MB5396.namprd12.prod.outlook.com ([fe80::18b:c5f5:5d5:d9cc%6]) with mapi id 15.20.7135.023; Wed, 3 Jan 2024 12:35:51 +0000 From: Suanming Mou To: Anoob Joseph CC: "dev@dpdk.org" , Ciara Power Subject: RE: [EXT] [PATCH] app/test-crypto-perf: fix invalid mbuf next operation Thread-Topic: [EXT] [PATCH] app/test-crypto-perf: fix invalid mbuf next operation Thread-Index: AQHaPfiU/QMl9XpfsU6BaqXERk7bL7DH8iEAgAAUB/A= Date: Wed, 3 Jan 2024 12:35:51 +0000 Message-ID: References: <20240103035357.720016-1-suanmingm@nvidia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR12MB5396:EE_|BL0PR12MB4850:EE_ x-ms-office365-filtering-correlation-id: fdc59968-2703-484b-8376-08dc0c588578 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jZoeB8Nmym8jzGXGnaG+QOF8+7PnoJdY3Zr0BmYjJ09B9x7x1u+90L8Yoe4C8nCCTEtajKtlNbT1zvW3x6pjlL5sO68/2QIHg3hlyDCCu2MImXCeM5eSPUo+Bfx+ZscaOzk3kjRdUfwgXUz97shuHUT0+yhr1yoKq+LmmWXYQvX1mRo96ppKHS+Ule7kQDmDIHogKSJiqVirK9k4IFrB1NhZx4SVjR9Kq4wM9tqXD55rqHMeKOCDgUjpRDsQO/RkDwAmtrvJXbh9IYDmUNuLUkQicupTUOuSr9XeAqve3Lycn7YP1FoEMz2yfUV2pMN8LvXOwJTqBq6LgPmj3wNu0divNNFdGBQPkCi3BMzfenDhrg5TDRpNTtge7PeOa4jenVqkaUgauIBgP/KBvnpNqWVsl2zlNnNS4cC20QlFXBJsCImyPBmVJrIX+4F+yAk7Uif+QJF8NyIkeNf+OsDLga9scHwamcCtKAp1LToyygh8vi2ajpZBHNfPUZfqahI9ZbXitL6nAgDBjxWnBaVr0pXF/l7uARhGFo1/63UN1c4TO1h2mQZSjs6uypsT8XPiX4h5/UVcR+iwA9I0GKdn5ezQlRT4fou28jAody64uKQtcBa1Bc3qp+8c6UGG4BFX8Bl+izWgHsYWRnIBJxtaLG4c1SRF7B7Ti+LP37h7QSA= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR12MB5396.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(376002)(396003)(366004)(136003)(346002)(230922051799003)(230273577357003)(230173577357003)(186009)(451199024)(64100799003)(1800799012)(2906002)(5660300002)(38070700009)(41300700001)(83380400001)(33656002)(26005)(7696005)(478600001)(71200400001)(6506007)(9686003)(53546011)(86362001)(55016003)(38100700002)(122000001)(76116006)(66556008)(6916009)(66476007)(64756008)(66446008)(316002)(54906003)(66946007)(52536014)(4326008)(8936002)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?B2quBYhJpjAdRc+Ss+3bYU6JQeKWz/ufDVtKd13m8HwqvzgtrgZSUJVhf/fE?= =?us-ascii?Q?55eRwd3bE1jiLnMrp1fn/3y5MKRGIgNY5ymdp7lJIaXYOvlmi3CicYZ7NqHS?= =?us-ascii?Q?4k1TiIpfPgiRuY/52MYtPqYevZtjCdUuXP0xyR7/Vmv7/1bLCE0LDoZyEuvr?= =?us-ascii?Q?0CWGnUTTgpo9TFQsqnANa2B0yHBiw1Hel33K1OTVbuxJnUZAu6LEm+aPcCh3?= =?us-ascii?Q?3AePAQPRBJ+B+hoIE2gPeQG+LuvM4gPlhLK9q6Wphz6PgEEkqBA0avQNLd2h?= =?us-ascii?Q?2iEjN/cSJB2p0w4NFGGjVbu/aK4uLFgnfttIlbTFqpmDIlPmr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yg8ERBLmbAB+BpRJoRnBb8Pn2E2p9chOWJFQB5Zn5ZL?= =?us-ascii?Q?zdeEHKtGW1bCMKFGf9d4fWWUS2fNtghDvOi67Sbea6KWBj2TmHnPhT6NcWK7?= =?us-ascii?Q?kBoGtJJMjB+A85nT81UvYkpYHwp1uEOwHijipKdYbXRdg0pHhUN3cfJvI0ZD?= =?us-ascii?Q?kpR8Oo+iVf3o7GbiRBhAUCaP1VKixEpnlf66nMclPVyCFgL9fYuPiIjPnWFy?= =?us-ascii?Q?t8LPpqApg2YJ9uFGyAFD2pNxthGcHhNaGqoWbOfIpLXvOu2l/75XjaS+FWjV?= =?us-ascii?Q?rw7AOtno8mYtSzWe26rAFLwaVkeXsYp17SXDzD3du5xtjpTdRJdR+Lw56fZS?= =?us-ascii?Q?3LHgsGQ0Y5hnfHTC6mu6T9DXbomEd1X+XoZ4xwMa?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR12MB5396.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdc59968-2703-484b-8376-08dc0c588578 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2024 12:35:51.5557 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +JWt7DcEXihZ5cnD8+VuYDGhJldttBKDShtejgpgxqE1uTjFbCoegm0phnyRSNVKSM5liJkToNCQCknaj5MOcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4850 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 Hi, > -----Original Message----- > From: Anoob Joseph > Sent: Wednesday, January 3, 2024 7:22 PM > To: Suanming Mou > Cc: dev@dpdk.org; Ciara Power > Subject: RE: [EXT] [PATCH] app/test-crypto-perf: fix invalid mbuf next op= eration >=20 > Hi Suanming, >=20 > Good catch. Please see inline. >=20 > Thanks, > Anoob >=20 > > -----Original Message----- > > From: Suanming Mou > > Sent: Wednesday, January 3, 2024 9:24 AM > > To: Ciara Power > > Cc: dev@dpdk.org > > Subject: [EXT] [PATCH] app/test-crypto-perf: fix invalid mbuf next > > operation > > > > External Email > > > > ---------------------------------------------------------------------- > > 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 =3D (struct rte_mbuf *) ((uint8_t *) m + > > mbuf_hdr_size + segment_sz); > > - m->next =3D next_mbuf; > > - m =3D next_mbuf; > > - remaining_segments--; > > > > + remaining_segments--; > > + if (remaining_segments > 0) { >=20 > [Anoob] Would it make sense to move assignment of next_mbuf also to here? > That way, the checks will become self explanatory. > next_mbuf =3D (struct rte_mbuf *) ((uint8_t *) m + > mbuf_hdr_size + segment_sz); >=20 Make sense. Maybe just like that: m->next =3D (struct rte_mbuf *) ((uint8_t *) m + mbuf_hdr_size + segment_sz); m =3D m->next; What do you think? > > + m->next =3D next_mbuf; > > + m =3D next_mbuf; > > + } else { > > + m->next =3D NULL; > > + } > > } while (remaining_segments > 0); > > - > > - m->next =3D NULL; > > } > > > > static void > > -- > > 2.34.1