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 1E71F45D39; Mon, 18 Nov 2024 18:34:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9F8C410D4; Mon, 18 Nov 2024 18:33:50 +0100 (CET) Received: from egress-ip11b.ess.de.barracuda.com (egress-ip11b.ess.de.barracuda.com [18.185.115.215]) by mails.dpdk.org (Postfix) with ESMTP id 018174066F; Mon, 18 Nov 2024 11:25:49 +0100 (CET) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03lp2170.outbound.protection.outlook.com [104.47.51.170]) by mx-outbound19-21.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Nov 2024 10:25:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mAB9EedwvPRK/OtEr+RwY4pHDyn2X4ROxdd89c4q2YsH+QFoNpfINsm7ynnT1VJcQAr0Z68P+PkW09BwTF7kwnWwBegInoFNtW5M7bQjtTRlbsxAccTkC1GWpwAva1iOThplQ6zzCNrDq+q/TcUG1iE/Gz2yeCA1zsrGBpTbnHgGYfJvX92IX8uUX/uyQx+KUndC+MFn1ox1F7Hm1PdJG1Fx/3AOll/MGHozK14N5i7Fh6h5Xx9equyW26UAKVvV8LNys5hwhy/aQalDJasHQBss/9Lptcok5RD8bIYRoR5Az1Ifj6dUj+3hqysmaCWH33OM0WY0Vae94yHz+eKEoA== 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=Rrw0wwTcTUKbQODCcsRK24NaQb470vfJW2kwnlX93gbaEYnkqLBau9uxKX6EADlbv9xr3CaUPmXFUVEwhmf6m53jBTrxoL4f3RftLWlohgqr8N3e5IkrfSUhyFChCJ6frYw3K9OWNsCl4dZDj31MxkC1Ik9a0YO9L9M69iCQt8XFPmbbQV+mjOVAPWcVvtxORoZyYZ21Oi1FtLZbBA1vGnx2LaZ6Ld96pgFKvpb+UgFKbG4Bibf5Kyowx4GpF3ciYJ+p3QYH5pWk8qs5/TYIRf7QHEDQTWZs1H9SADYrBIhTdblADXP8Ygt9a1gGljTxkW2Kv0KbM4QgmpAo5g2P5Q== 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=QVY0ER4HsPfQMASp+oGRZPFPveGSC3ucth8482FpMSrRWZiUQqzZ5Pkuwua5uYHGanAugzMEQEs0b+kIy5U4RcP6XkRZEdH3BiHYyuQy25vB58VzvX0W0BS3geLTBPU4YB9+RXI/m9vha5B3Y20zNakh+dKAtlx9m3e12riQ4ak= Received: from AS9PR06CA0065.eurprd06.prod.outlook.com (2603:10a6:20b:464::30) by DU0P190MB1705.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:329::10) 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 10:25:35 +0000 Received: from AM2PEPF0001C717.eurprd05.prod.outlook.com (2603:10a6:20b:464:cafe::f7) by AS9PR06CA0065.outlook.office365.com (2603:10a6:20b:464::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22 via Frontend Transport; Mon, 18 Nov 2024 10:25:35 +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 AM2PEPF0001C717.mail.protection.outlook.com (10.167.16.187) with Microsoft SMTP Server id 15.20.8158.14 via Frontend Transport; Mon, 18 Nov 2024 10:25:35 +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 11:25:28 +0100 Message-ID: <20241118102528.1858308-3-dvo-plv@napatech.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241118102528.1858308-1-dvo-plv@napatech.com> References: <20241031150010.2991953-1-dvo-plv@napatech.com> <20241118102528.1858308-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: AM2PEPF0001C717:EE_|DU0P190MB1705:EE_ X-MS-Office365-Filtering-Correlation-Id: aaf549c8-1a7d-467a-1857-08dd07bb56eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?UlhCWlNDb3gzSVNxWVdOcVJGbVBHTXVGclUvK0JNT0grRjdpR2RpQlF2NGt4?= =?utf-8?B?T0xvcnJBMGVpeGFVOFFvSHVlYnlHNFBIZVlCMFBrODcyZHBlb3VXWWFPSFE1?= =?utf-8?B?ZDJUYUdqQkFkaXdXMDJkUE4ycEF4a0x2cXNwcjA5NmlGWER2S0JKcFJ0MU9X?= =?utf-8?B?VUVyM2hpM1Ezc2xrS1BJYTlBQk9uRnFyQnRyZnBnd2NOM0lERis3VXlzNW5v?= =?utf-8?B?TFdpVnU0VmVNamM5WEJiRkdZdjRBSnVpUWhYM3YwRWZ2QnlTOVJSbjczcjh0?= =?utf-8?B?MndUTW5YTkNEbUdGTnJQdDRielpzNjhCVVBJSG1XNnBKYWQvenVXZlljeFpQ?= =?utf-8?B?WDExV0NsYVMrWEpXTklNdERqWWZCSlhzZmlpMmgzNXpyV0wyZ3ZuaFZPaExo?= =?utf-8?B?WTdnMDBiUHd6QjlIemZmaDdsODJrOVZUTXViK0JQNHM5NzB5alpQUnVXWVdj?= =?utf-8?B?cENUeWpKN0VjdG53RktsT0ZlVUM3UDBFSUZmeXhVL3R1dUZzK3piaTBLSEtt?= =?utf-8?B?QVhuUWtNVTJNQ2gxUTUrZ0YyWERIZFBVdi9YL0cyU0dwbTdGaTBSZTNsWHZK?= =?utf-8?B?aXpOV0RaaE5IQVFxeEVZejk2MXdhQVJPVEZ2L3d0dTgwdFZVZXFOWE1YczZw?= =?utf-8?B?cEQ2aUV6NFB2WmgvMUsyaFQxRTFIdzg2a0QxZW5HZHBNZmxXRUwyZDJlWHZa?= =?utf-8?B?eWtjVUNYK2t3VGxvZG9ORDNFV1JqazA5N3hyV3YyeWJQVVhWdkRQTHc0RVAx?= =?utf-8?B?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wakIrdXYxdzZl?= =?utf-8?B?ckVKUUduS2NMcWdDOEVyRlFHaFU3UDJNVXRNN2M2WFoxQVd2Y3N1T3BkYzFB?= =?utf-8?B?Rmtaek9sVkozcE12K2FvVkdOSkphVjZ6WDhvRkZEK25hSmcrdmQyeEhxUzlH?= =?utf-8?B?Yk0vV1Fwc3hsRTlUdGcyNnQ1N2tKdUpBMjZ3MGFJK2tkby9uNjB2NTZyclV2?= =?utf-8?B?L3V3eXpLMmhEaXpkOXgzemVobmRHWGFDU1F4U3REMG1XeXc9PQ==?= 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)(376014)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: f+HQ0HC6G/5nHB8C0/c6QQuXpAlsVxBP2q2UiMvddexRuRo7oNNnM6fhjtdsiYCsh1p1aNuVTw4ad4k+vGafoDd0Lau1GhnDb/+hNN+RAHzTX72S8tG96x3W1esssR5HOOtVdtFdO112QCRzw302JMAvMyuIJ+BIUgwTznxR7JOQtZqDV4JsrIQe6x3fZv2ut3yCYESzZTC/I8eKx282hRrLYFG01kMwFy2ugYf+IHWK0wZ8cirCYW8b6AwPEIGtzfkwiQq91D2jbBtdZC6iLhMQDZd7ItcUbzcPe7AAvE9aZpach3XQ6m2cgcVz3Pn+5r6FUUgeF2T06fakzAOyJeNZwKgpTTdGvYeG7Y6x7zKL5kMl/ViZ1JyyFd87jtgzpiFw9ipV5MWcy1+Cjd6aJv+/O3BwVK5rmvoVnrRyLAkg52zTV0/WLp4du8JMEapQNhchYN5Te3F7HpQKFJZYI1kGM4Z/FrIvCISG0cqnlxDb+M+uXnSBp3qsJ1lxR5lELVFBE8lN38cnfUm79oAzuniqcedP+oYdHLNm0/ENaF5Vi74utJBPkKz1gITtjanuA//dOY9bWG2PGTmLtx8A2FHsyKL2NssrnFcxZYjV760CBx0e77xcPueGWf4nXGco8JA5mjeQaqdRXZ4UprXt6EdANOndb26oRcpPmWqb+ss= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 10:25:35.2505 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aaf549c8-1a7d-467a-1857-08dd07bb56eb 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: AM2PEPF0001C717.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0P190MB1705 X-BESS-ID: 1731925547-304885-13526-3386-1 X-BESS-VER: 2019.1_20241105.1725 X-BESS-Apparent-Source-IP: 104.47.51.170 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.260504 [from cloudscan19-159.eu-central-1b.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-Mailman-Approved-At: Mon, 18 Nov 2024 18:33:47 +0100 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 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