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 46B6E45CD8; Mon, 18 Nov 2024 19:25:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3896B427DE; Mon, 18 Nov 2024 19:25:30 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2058.outbound.protection.outlook.com [40.107.243.58]) by mails.dpdk.org (Postfix) with ESMTP id 3EB7241104; Mon, 18 Nov 2024 19:25:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ncZ8Ya9X73HhIoXL7lXOFltqaEd0EIDh57i/gPEdR0jWRD5Ueq+PsFYQn5c8KUAl/xx0OTUrLJw/6P9BTYt9OxI1sxcIoM1dOmGSKsHuzycPjAHlxspU69abHDuXJXyh7HM7WZ18zCaKH8Q2MiTPwl78ZoJdK36cq8wLfmdyMUpdog3xkzdUrJ4o8HihEe3HRHprX1d2ItCqK0hmcD+ypMWqiNibWBBvuL8zs/LG3LiukBRXKWp4ROWqEXOHEvRk1vfWFCo989HGtDav3e3Beyj8Q4LW/BQZInOme7jFeWuVaZ51Iyn/iN8DsRJC+ip3bmWWPfBSOUOzhicJa+ecag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=tCHfF4/N62p0chopKfELUGJ9QN/Meu8Gl4oSAfKgPvI=; b=iWIyA/Z5Lla0x/xC9495AA/ZNHevMhPN7i/1NliVI/VZMhnArYbYJxO7qfX7SXRazqP6KwZJxbyggQMS6kihH8hps8sexhg4od61XxExNfMR9kcfyzN2VB4cTz6m/URbyVQg8fOQg0NlnjsZahPIm06MjmjYMfkhX/eWA5xLrur9UXWe15Z+xbwjVOhLKmjehOlAZ0DInCheC8mab34Ezdlmki2vNntB0Hgdk4REdfc8e85ofERqwYtrr/US+cM2PJlRLnOqnmE/byma34ddU4hg+qpfLpfv+GGMYxWkkAbzugTKTC+9I+fxfh0BeXNuuyTy4f0T8DNvktFye2OUbQ== 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=tCHfF4/N62p0chopKfELUGJ9QN/Meu8Gl4oSAfKgPvI=; b=uHSCMAilQIsnVqzWWA8r0jbuJ0ALG9CRG0DZrV/TLVs55NEqPogCfxOWzKU+8Fa0ZSMFM7Thsw8O90UuQXXY+PgXiDdsBrN/JHUSlkM45BUxyHSBwOX7Hp3rc4dsAfyj1gNQTqSf43tq7gP5R/IDd26wMoiUYbZViTfyDyBJBXlWp3fYMIFcI++P1+EnXZPB7WL2biZY19DDnqTnnQxTGRtfv1LAppJx1PJKg6FZjyN50jjuYuumoJPPalW48qFD5vPojMKGlNEBDLuuL+Ae34p5/kX1rIaCSHrrxLSLkNWDmMuoF4xEbvbOq6Ep0tp6ln6xQqI4A3VoGCIK1P9LlQ== Received: from CH3PR12MB8460.namprd12.prod.outlook.com (2603:10b6:610:156::15) by CH2PR12MB4279.namprd12.prod.outlook.com (2603:10b6:610:af::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Mon, 18 Nov 2024 18:25:26 +0000 Received: from CH3PR12MB8460.namprd12.prod.outlook.com ([fe80::2e9d:7265:3b84:59b5]) by CH3PR12MB8460.namprd12.prod.outlook.com ([fe80::2e9d:7265:3b84:59b5%5]) with mapi id 15.20.8158.023; Mon, 18 Nov 2024 18:25:26 +0000 From: Dariusz Sosnowski To: Danylo Vodopianov , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , "aman.deep.singh@intel.com" , "yuying.zhang@intel.com" , Ori Kam , "mko-plv@napatech.com" , "ckm@napatech.com" , "sil-plv@napatech.com" CC: Gregory Etelson , Alexander Kozyrev , "dev@dpdk.org" , "stable@dpdk.org" , "ferruh.yigit@amd.com" Subject: RE: [PATCH v3 2/2] app/testpmd: fix aged flow destroy Thread-Topic: [PATCH v3 2/2] app/testpmd: fix aged flow destroy Thread-Index: AQHbOeQ4WSu952rDi0SvThbvg2CxeLK9Wqrw Date: Mon, 18 Nov 2024 18:25:26 +0000 Message-ID: References: <20241118112625.1880659-2-dvo-plv@napatech.com> <20241118180323.2046886-1-dvo-plv@napatech.com> <20241118180323.2046886-3-dvo-plv@napatech.com> In-Reply-To: <20241118180323.2046886-3-dvo-plv@napatech.com> 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: CH3PR12MB8460:EE_|CH2PR12MB4279:EE_ x-ms-office365-filtering-correlation-id: 15b2b27a-8d28-41db-dc1d-08dd07fe5fab x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|7416014|376014|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?q7fEM4/Gb5KTNTT2r3dXjJDi67T1AtCiU1GoxIpDQDVpTAsiBmEBi71udGJ4?= =?us-ascii?Q?1vrdOCFIRCaeExK59ibkfIJuzcQAZ84YTL7Xpjyl9ltX9EWA8rF6ptg1Vkr3?= =?us-ascii?Q?6rJ/IjpbM2edfR8I8WZuEO5/BiNqMZKxTufewplIC5qBCI+dGUgm4nCOmfOV?= =?us-ascii?Q?zUtWUKLvWdBTFFzNWXBWYWaNF3CGapohQtU6Ne75ddZMosELwtomLs7/Rx7O?= =?us-ascii?Q?mB982dQ6XTHrmzbvG6lRB3gL1PQjLYKTX20ZLRjH3SxbGEJk6MN2V3ya98IW?= =?us-ascii?Q?8i23q9UnqpasrPdE32r+B43d4pfSGzsT2TWJJz9nal2dlpMh+8j8nzborm2K?= =?us-ascii?Q?5bg2twqh//sDDovCtYa9lIQgA2htG2jS3gqlZK3J4dX7F4oEC1VLVQmp6SdB?= =?us-ascii?Q?C5s4BIaFfIa3olND2KaURi+BHKyRwtD4/PGYsOtib15CfMbvqRE3P374XUFC?= =?us-ascii?Q?1TuAk43bu9reiXDwFxtyXizS95jojoQDJJel8y1EZmdDvZpMbSoHCUsPKbsJ?= =?us-ascii?Q?ISsVSI3sdjgllzpHNxr1j2LxbGn7R39P0pcYjqYwjmVIH60P0vLVMdfQKjoz?= =?us-ascii?Q?nPq7i7BICIh9vcDvUdvOsowEmfv+EfRG7r9QMZcbBZ9gpSeTq0VeoLUxOTk2?= =?us-ascii?Q?WpAPO+9PzKTCyvbdUssuEVSEvBGpgErICM8isNzwrWIul1KGSsOEMbQujNmJ?= =?us-ascii?Q?rS030QBDdC69uRfW5U7595mRXu5oeGGIxeT6AhA730TznfOKbqRPTn+isqZU?= =?us-ascii?Q?krgpYxepdpId4pge/XcNizhCwMkzox9j3UMCfGrfqyNmSJwLC89yyiQELiyz?= =?us-ascii?Q?xEGMHQHU8hwuLvBuomgqMzeaLx4l2QhWNEkgDLPha/MsNIN7JFbAC/VoezxY?= =?us-ascii?Q?RKwum0K5cE5AyWyyhsOmRlLmk/zWWKV14ITCTLjcPifiqo6mhCIEloRsc/Q7?= =?us-ascii?Q?f9XgFA/FaoyAWGFu9mRnsIiSJpwg0dp04znTiaexmyJp9/nJqeCeBUonQXBy?= =?us-ascii?Q?xO8i1LX26J4CPMOuW5F3vtQe03XGHPvlEzoYzfHElpR9Ap5bTHVQqZBDSjyT?= =?us-ascii?Q?GRkxvWOBldZaX2FH8VdIT/wMvJCHqvb1+64crdP0b4E4Uak9jxQAl15chawZ?= =?us-ascii?Q?579WVtM0Ov+GQ4oYUkZ2zH/bSTYOCqWZecXFr3GZEBD3tQJ/y5tN4uJiOYFa?= =?us-ascii?Q?0kZlj3NWiUrRSpM6Deu+tCjp6l06n8CRiNWN8w+Pqe1MfqVH9I5VCLD6lVFp?= =?us-ascii?Q?KXYMc1H8i/sViZ6RcmecKFzPSbWJHRn0xnuAy3NwHG/2GK+cb8H62pTHszGU?= =?us-ascii?Q?+Th3MHcmmSc6x0BYOf7C9KgpnGve5gHDlAHis+tFMEwUFUp+mRUASsDMNyuF?= =?us-ascii?Q?vo0wLNE=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR12MB8460.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(7416014)(376014)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?HDGPbb0OHnvTxdNVIWq6anv8B3H0sdaQhiJsahQJVyY2BvhsVocskouVy+a0?= =?us-ascii?Q?ZvIuI6fqRBI/BNies1CR3uvRxc3h4wLU/iL28TZe/N7zaKISUsOwZfc/VdBp?= =?us-ascii?Q?ho+LC8703x65A23gHTG70ZrHtIkh45IpVZudy+JxC3DOS/qq5IiH1KOapG5D?= =?us-ascii?Q?nb3sbARXdgKHa8/woZjdzcj2BsBWVPEx7QtN8ht8z+Ia0fS0lUX6EBr9Jroc?= =?us-ascii?Q?RKqfJFF0kmyepB1lrlTOQr7oYLdh8aAhSRzQqN7GMhs+vtXkIm+dIMUbmSBZ?= =?us-ascii?Q?lbILf2sA/KDK93wsB13NMgktLjmA8g/l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0b903Kuf4eVLJAkHN+RMBdXzEFY8F3bcJQCNz7noalQKY+bSPF?= =?us-ascii?Q?8lfbdnuanc2QjmsO3zXhVClfPwVrkviySbVs4w3yQ0vIeHVjPp8fZtct3grw?= =?us-ascii?Q?3/9c+eE9A/S7wYk1+AClk4qQufMaTgnZtvK3vHlO8EI+bbfxe1VD0anpXtAm?= =?us-ascii?Q?HacvNxFg6nn3whoGwlo2pB+mC+fpuXmQQrVV7WLeoVLOCM6v4Iom59NT3pck?= =?us-ascii?Q?wa9VzSuI07buXOtAdAiQxNxyK054c3ELIhnM4bma8t6T6nA6xIGBLiRaGJgM?= =?us-ascii?Q?c6GFr2Q7uJpyjUFTIgYMDb+bP0To4ok8AzbAsz735uVXSa7ct15by4fVLbF0?= =?us-ascii?Q?eTri88SFvJ2nj3auc6KJgZJtS/18MWxvicK7EEq8?= 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: CH3PR12MB8460.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15b2b27a-8d28-41db-dc1d-08dd07fe5fab X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Nov 2024 18:25:26.4078 (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: FCo4bMl3LGI4OwuCN1zOMgZp21/MynA68CfaHUOgKarGOquBBnlMUBbEDb+HNgWSKhjYXfqF+OBVF9zQEHa6Tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4279 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 > -----Original Message----- > From: Danylo Vodopianov > Sent: Monday, November 18, 2024 19:03 > To: NBU-Contact-Thomas Monjalon (EXTERNAL) ; > aman.deep.singh@intel.com; yuying.zhang@intel.com; Ori Kam > ; mko-plv@napatech.com; ckm@napatech.com; Dariusz > Sosnowski ; sil-plv@napatech.com > Cc: Gregory Etelson ; Alexander Kozyrev > ; dev@dpdk.org; stable@dpdk.org; > ferruh.yigit@amd.com > Subject: [PATCH v3 2/2] app/testpmd: fix aged flow destroy >=20 > External email: Use caution opening links or attachments >=20 >=20 > port_flow_destroy() function never assumed that rule array can be freed w= hen > it's executing, and port_flow_aged() just violated that assumption. >=20 > In case of flow async create failure, it tries to do a cleanup, but it wr= ongly removes > a 1st flow (with id 0). pf->id is not set at this moment and it always is= 0, thus 1st > flow is removed. A local copy of > flow->id must be used to call of port_flow_destroy() to avoid access > and processing of flow->id after the flow is removed. >=20 > Fixes: de956d5ecf08 ("app/testpmd: support age shared action context") > Cc: stable@dpdk.org >=20 > Signed-off-by: Danylo Vodopianov > --- > app/test-pmd/config.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > c831166431..28d45568ac 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -4160,8 +4160,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) > } > type =3D (enum age_action_context_type *)contexts[idx]; > switch (*type) { > - case ACTION_AGE_CONTEXT_TYPE_FLOW: > + case ACTION_AGE_CONTEXT_TYPE_FLOW: { > + uint64_t flow_id; > ctx.pf =3D container_of(type, struct port_flow, a= ge_type); > + flow_id =3D ctx.pf->id; > printf("%-20s\t%" PRIu64 "\t%" PRIu32 "\t%" PRIu3= 2 > "\t%c%c%= c\t\n", > "Flow", > @@ -4172,9 +4174,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) > ctx.pf->rule.attr->egress ? 'e' : '-', > ctx.pf->rule.attr->transfer ? 't' : '-'); > if (destroy && !port_flow_destroy(port_id, 1, > - &ctx.pf->id, fa= lse)) > + &flow_id, > + false)) > total++; > break; > + } > case ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION: > ctx.pia =3D container_of(type, > struct port_indirect_action, age_= type); > -- > 2.43.5 >=20 > Disclaimer: This email and any files transmitted with it may contain conf= idential > information intended for the addressee(s) only. The information is not to= be > surrendered or copied to unauthorized persons. If you have received this > communication in error, please notify the sender immediately and delete t= his e- > mail from your system. Acked-by: Dariusz Sosnowski Best regards, Dariusz Sosnowski