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 5C43445D36 for ; Mon, 18 Nov 2024 12:26:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC54D40EDB; Mon, 18 Nov 2024 12:26:49 +0100 (CET) Received: from egress-ip42b.ess.de.barracuda.com (egress-ip42b.ess.de.barracuda.com [18.185.115.246]) by mails.dpdk.org (Postfix) with ESMTP id 95C9440263; Mon, 18 Nov 2024 12:26:34 +0100 (CET) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02lp2049.outbound.protection.outlook.com [104.47.11.49]) by mx-outbound42-231.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Nov 2024 11:26:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jiOEKHEVXtKBb1WP0EMl62fV3FsfxLNLBRw9qKzHHiZi/zZaZutoT//Def61tie5RNEvW5mngYKJrhGubYa+ZnKMPTxr0brFxizlIzY/KJcBUdvKmYylnp6jeSzCzit363IQCS38StUFLaiduXLIu8lURBMOBIQryFRXw/UBfE43xGQnVgcjPhAsVQvwVNYjClNCjyL+LoaCTTR1SxV6Ic4aVLC97mY6atEwO/a+P2jaYRhlbW8/xrSDyjAT2KV1EHcvUm/UmtrQunBrQxCDOOocBk/zI/u7tecGlNKug5CRmffgaIvRp69UfVp/BR5LwjrpVMGx6DmxZrSdxPhVPg== 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=XH8tK4tOcilmqjuvbg9MhUsBsIqwm6nvoPEIPEUZn94=; b=H4GMsOTlRINEGxEanwq04QYnG3HixwwdK+4VIVKK82CiI3ZRZ9DB3eWrLqjLYj9mejxP623ABfmXzz0Qei4X4bZVrNnLLUdKDRQ5DodxFBUt/J13BxBayP1dPxB/GxkM+YfWLW88LZAx/5ZH3hvr5sNH6DKzlSIg30qq6SKIRM2eeTiCFyJgpnWPOCB+DHbL0UxIGVEHKgz/vBi5ptkk7vR4XdrrMLXtgXcUfFio6mgkpLSEGFbIaxCZc5wUMnnH6txiy7jgBr9VT+5vFDXe6jiqGeBYmNoU2cH6LD/Taw4bOPLTa2dDFWGYC5Na1l7aK3gsH4o1XZjJlVrbUsh9QA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=monjalon.net smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XH8tK4tOcilmqjuvbg9MhUsBsIqwm6nvoPEIPEUZn94=; b=mCp3HhS+dgdPz7pG8KIFvrFegBUbmYdjuh89AGiXQb9SGHz0jPBWyEY8pyYyIvMeHJj7aFmKbUsK7ybEKGy1tvMEd3bEUVwtjd6DkfNgpRO1KfnD0CSf1Ivkk9kFsCWODMtzTJomt5dPa8w/EbWZ2O/iXul51cmpkSCSz/jfQYo= Received: from DUZP191CA0001.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f9::24) by PR3P190MB0971.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:8b::14) 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 11:26:31 +0000 Received: from DB1PEPF000509F7.eurprd02.prod.outlook.com (2603:10a6:10:4f9:cafe::b3) by DUZP191CA0001.outlook.office365.com (2603:10a6:10:4f9::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.24 via Frontend Transport; Mon, 18 Nov 2024 11:26:31 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=k8s-node-23.default.svc.cluster.local; Received: from k8s-node-23.default.svc.cluster.local (178.72.21.4) by DB1PEPF000509F7.mail.protection.outlook.com (10.167.242.153) with Microsoft SMTP Server id 15.20.8158.14 via Frontend Transport; Mon, 18 Nov 2024 11:26:31 +0000 From: Danylo Vodopianov To: thomas@monjalon.net, aman.deep.singh@intel.com, yuying.zhang@intel.com, orika@nvidia.com, mko-plv@napatech.com, ckm@napatech.com, dsosnowski@nvidia.com, sil-plv@napatech.com Cc: getelson@nvidia.com, akozyrev@nvidia.com, dev@dpdk.org, stable@dpdk.org, ferruh.yigit@amd.com Subject: [PATCH v2 2/2] app/testpmd: fix aged flow destroy Date: Mon, 18 Nov 2024 12:26:25 +0100 Message-ID: <20241118112625.1880659-3-dvo-plv@napatech.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241118112625.1880659-1-dvo-plv@napatech.com> References: <20241031150010.2991953-1-dvo-plv@napatech.com> <20241118112625.1880659-1-dvo-plv@napatech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509F7:EE_|PR3P190MB0971:EE_ X-MS-Office365-Filtering-Correlation-Id: 33112147-9bad-4a45-c61a-08dd07c3da2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?c2xRK0VnQXA3OHczOTNBWW9QOGNQNDN4U3NXKzk4S3ovRFdxUlRWU0VXaS9Q?= =?utf-8?B?QlpQTjJTdmNhdW9WMmRmRndNcDNjdmJ1VFozaXMxNVMzREpMeUxnakVZd1k1?= =?utf-8?B?VVhJbVg2dW9tMG94NEgzVy9OM0xRbTlkKy91MTczUGJQUWhCMVBSdVh6NDZ1?= =?utf-8?B?b0tZTHZYdk5VTlh4SFpDNFhpcGMwbFJRYUFDeCtZbTFBQmhFVmNZL3F2NW0r?= =?utf-8?B?RE1EbHp6c01CMWZEdlk3UTcrRVZ5TytpaVVSdTJwNCtwSWFPeHZTZlNhb1VY?= =?utf-8?B?QnNybUpiVWo2VkFuQThwRVExcjVkaWVWMHVwSThWM2IyUVhmb01WMkpub3dv?= =?utf-8?B?Yy9UUnpMTUtabktBMlZSL1lSTTFHTHRlU3M2elR5UCsrSndGKy96Tm42ZWk4?= =?utf-8?B?VkZMaTNZc2hxMytJdVErRWZWeEJDc3d2enI1amZKdjE4cTUyRHV5Y3ZwUXhn?= =?utf-8?B?VEVZRGlndHNGM3phMlE5cGdvR2YxbFFYSEd5S0wzMlhBdTRwUkJsK2JDeElu?= =?utf-8?B?OUdmOGtzVURHdXMxSXVTWnFuUVRqYTc5Q0U3MHdCcWgvYXBjK0p5OXlPMWZQ?= =?utf-8?B?Y0RjUjdYWFVudkdtTlc3KzA1ZkhIL3dCaTd0amJzcHYrQ2hqOGtsaGFyblR5?= =?utf-8?B?OHpkTHZGRDRFZHZPNk9xMDN1d1FNMmhKSTVtcHM0cEtwWERqeEdnaVRqc1I1?= =?utf-8?B?RWhDelF1Z2krSUxNeDB1MTRyZytYaEVwNmpEQVBpYkYwUzVranFSWmxFcmV1?= =?utf-8?B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OaXB1N00y?= =?utf-8?B?OVI0ZndId0ZGVXpEQkFER2trbUxOYS90ZERqNURqbkpiRFB5eG1QOTlBUzhU?= =?utf-8?B?TnBGZEJ2bmhLU2N2NVl5ZXM1ZEdZem9zWHlRV1M0azNZY1pEQzUweGhmSWQx?= =?utf-8?B?eTdoODNFSTRtM0txVERzeTljSW1Jb1NrZzREVzNCWDJsa05aZFlsOHpUcUll?= =?utf-8?B?VWN0Sm05blczdW1ueFdFd1lIcVJxL1JDcnlWTnorNmxjQ3c9PQ==?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:k8s-node-23.default.svc.cluster.local; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Dup/m/L7ZfC0LrN0wOF+YGZlaqxy2L/EYaRdZdRpQWMrhGmKA0u47XO3ZZyQpYo+uFC0WECN3Vpoo4XFFhPL+iYCvVHH/W0YFDmRUaVLQuhZObXd1la63zizqqLc+EZQiRBz7edUB+C+qoUHw/lidtIyBN4hI4ppIbdAEPI9RUZantTf7TnTz/Orr4NnUSUuBgFOMv9XMF+pEyKLb15L82aQzkZ+yQj+xAqVrP7kwetYCI1Gh9SKp4mXm/UxsWs4Cb76x2gLQbd45WnTd7Nbp64fCoh1W5ak+RRK0YRJXGxS0NshMrPZV8j9n0skWMZUh1lhByNeWhLJHtlikaSL5jd4VRvwcv5fNhJW04ICzqUAX/zAc75Wq01nhyQk7KcTAdEep12BvoNYrnq0ZPPQC3lBUCR37c7pdz1sAC5LTZSoX3TtUfUFUKevYRqKDidLRyGfGtBDx85n+Z/G6FtBToUjpTxWEJiJAjk/q3UwKiZuYeeXPkQIujfY3ll5DnnlQi0HxVoRpnvtBTlzIQbZF9JbUlAxOzcRnQJjvSCgW/kTI7AOzWlkTZSLR7suS/lU/Ylm3FckEcMFv3Mo4jBEXKf+XgofVL/fZL7nytXbEbqR9KTYthQZYdBZtOXhHzbGsbemCxn30zqOVX3+ydWdaVyNLe59Mujp3iEJBvLTkBI= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 11:26:31.2462 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33112147-9bad-4a45-c61a-08dd07c3da2e X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[k8s-node-23.default.svc.cluster.local] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509F7.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P190MB0971 X-BESS-ID: 1731929193-310983-13346-3853-1 X-BESS-VER: 2019.1_20241105.1725 X-BESS-Apparent-Source-IP: 104.47.11.49 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVobmBiZAVgZQ0MjYMMXYJDnFLM XcyMQwJdXEyMzcLMXQ1MA4KS052ThNqTYWABZ/i5RBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.260505 [from cloudscan8-9.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Avoid removal of additional flows after requested number of flows has been already removed. port_flow_destroy() function goes through all flows and compares given flow ‘id’ with them. However in some cases it can advance pointer with “given ID” and thus remove additional flow. port_flow_destroy() function never assumed that rule array can be freed when it's executing, and port_flow_aged() just violated that assumption. Fixes: de956d5ecf08 ("app/testpmd: support age shared action context") Cc: stable@dpdk.org Signed-off-by: Danylo Vodopianov --- app/test-pmd/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index c831166431..04de2fe59d 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -4160,8 +4160,9 @@ port_flow_aged(portid_t port_id, uint8_t destroy) } type = (enum age_action_context_type *)contexts[idx]; switch (*type) { - case ACTION_AGE_CONTEXT_TYPE_FLOW: + case ACTION_AGE_CONTEXT_TYPE_FLOW: { ctx.pf = container_of(type, struct port_flow, age_type); + uint64_t flow_id = ctx.pf->id; printf("%-20s\t%" PRIu64 "\t%" PRIu32 "\t%" PRIu32 "\t%c%c%c\t\n", "Flow", @@ -4172,9 +4173,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, false)) + &flow_id, false)) total++; break; + } case ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION: ctx.pia = container_of(type, struct port_indirect_action, age_type); -- 2.43.5