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 7DC5445D32 for ; Mon, 18 Nov 2024 19:02:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71917410E3; Mon, 18 Nov 2024 19:02:47 +0100 (CET) Received: from egress-ip42a.ess.de.barracuda.com (egress-ip42a.ess.de.barracuda.com [18.185.115.201]) by mails.dpdk.org (Postfix) with ESMTP id 94D734025E; Mon, 18 Nov 2024 19:02:37 +0100 (CET) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03lp2106.outbound.protection.outlook.com [104.47.30.106]) by mx-outbound15-68.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Nov 2024 18:02:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yn0e4OTslCqEmL+i+W51p2/8sIveEbHwDmNmXxorstG+TWNxBLG8N8oaeqRAfPWL1bcfFujSdeIpWGSQ3tiyWNzwuk1wRFnwgBU9YD8O8lQ6xn7EKVlOUab536xqyEKKCVvjhV3ALIYL3hQRZ/ZLUYG8BMA7rZ3Z4RLdXTgwFjKqspKh84m9YpDK0GDXA0P/eoVMO2Ghl2b4XyyLlrxQ2KFqmD1n4VY4gP1sUOplBA54BDp5F9jqtL0d7qhnoMUO541RsgvK98aO4U+dInW2aj04Gt1/7vf2xbq/W3u5HjMq6B3NohlnWrhWAIeDP3xr0GnGiSVvxoxVw9kERb/9/w== 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=J2b7wLe3L9J1aT7w97DM/boP7jcbZJKgOpb6+l9QgoHfAfyKj5L/Fh+uDGDwGWn2OlKop/pqBeytU3MP9Nj6K5DgSfrPjq06sMq2cG29zzaBf8TqLecgfOnCQGTcpZel26jqB5CixQumY8mr1UXEyul2weL7jE9VEa/LkLmuwQZG5kHX8Eh/+K3G88Ogq/CFY6tD2gidD/Ir2Ch1S7iI/SvLr3JDSU2R+vBB14ZtnOBL2kyjyLNGteyqckhF8UZt72FrUsWdKspjboE+81WWoom1MuSSRipxUowcPZxMpZy0jG7ziLaKbI5LyvqD03Qvl5AgLKGrmcigKKj1cygD+g== 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=hexNUrd3cPqy7e5kJf/lStvOa8O8MGKsehJ0LLnJtZvzdqcLFeoqO94U23VzVDrPIolGOVa0PYYWV5Tyr6mIWgO6q53ruiqgjC7fvpSanjcYADob/qLrOtvBP1Axkx5XgVBl+YQQ1k/csNqt3POgUiL2xqW2h//3scGfwmPS7VM= Received: from DB8PR06CA0043.eurprd06.prod.outlook.com (2603:10a6:10:120::17) by GV1P190MB2043.EURP190.PROD.OUTLOOK.COM (2603:10a6:150:16f::18) 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:02:32 +0000 Received: from DU2PEPF00028D0D.eurprd03.prod.outlook.com (2603:10a6:10:120:cafe::18) by DB8PR06CA0043.outlook.office365.com (2603:10a6:10:120::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.20 via Frontend Transport; Mon, 18 Nov 2024 18:02: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 DU2PEPF00028D0D.mail.protection.outlook.com (10.167.242.21) with Microsoft SMTP Server id 15.20.8158.14 via Frontend Transport; Mon, 18 Nov 2024 18:02: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 19:02:26 +0100 Message-ID: <20241118180226.2046498-3-dvo-plv@napatech.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241118180226.2046498-1-dvo-plv@napatech.com> References: <20241118112625.1880659-2-dvo-plv@napatech.com> <20241118180226.2046498-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: DU2PEPF00028D0D:EE_|GV1P190MB2043:EE_ X-MS-Office365-Filtering-Correlation-Id: dea8ecdd-8e86-4610-84ff-08dd07fb2c5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?bEU0eDlFbkM4clkyV3lpT0NzZ1FPaXNsVlB5S2RQNGtGYVFRaXNsVkhiZlIr?= =?utf-8?B?WDFnUnVRcDVnTEMyNE5DdEpRTGhzQVExY3llWlpVOEx0MFE3ZHkxL2JOcVVl?= =?utf-8?B?TTJ6MCtzMkV6WFd4M0EzYVBoZE5icEFkdHZnTnVHb0JOR0crUTU0aCsyYkNG?= =?utf-8?B?ZTd1TXU5ME1JQjI4K2ExVnJ1YnpzZit3eUcraVRiMVprd1hCQmE1bU44a1pJ?= =?utf-8?B?UUxxZlFrSGMvalN6amJvSGV4OWEvT2lLUlYyT0hubmduRm5iVWEvdVRhaFRL?= =?utf-8?B?NHpmNjAwKzQ3OW0xc205dVRBcnhjdjVsRGFBZzlSTi90ZXo4MEw3VDRra05W?= =?utf-8?B?K1B2K3pQUDNLOTZsWnlQSFpUbU8yS0tWQkVKN2J5Ym1QTXNOaGlGVWRXbmlj?= =?utf-8?B?aTZGd0pLRVlOVFFqSFdRTjZDQnh1T2ZSeFZCNkZITStOTmgxNm5maEV3T0Fr?= =?utf-8?B?ZXArNWJEd0hiOGIwbjlVNFNNRWF3b3JidFk2Mm81VnlmdGNnQnkwYlgySGI4?= =?utf-8?B?V2ZDTEgwSGd6dERiNHZ4WGwyMWRJZkdWdU5QbTE3azNuK0RaSTI2SVlMOHlp?= =?utf-8?B?L1J6VXJPZVRwblg2YTVlUUlTYVAybjljeEdVM2VsYXlIUlhZNk9sWUNVYUxT?= =?utf-8?B?Um9SYnVUbjEycm1VNTBqUVJvMFkzcTBIdHZSdlczeHZQRC80WVlrK3VBaWZG?= =?utf-8?B?N0FvQ1pGQitZYlpIME41QVFiNVc3cFV6Ry9OZjdSVDVsY3VvSk1nbEVzNGhY?= =?utf-8?B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dCTUxSNEJQWENn?= =?utf-8?B?bkd0YUs2RHcxc2dsOTZrM0NHbG1IdnRjNmhjS0VtQlo1WVZIWjVRS292Y28y?= =?utf-8?B?OTJTVWp5YmRvZVRaaWpaMnE5Y2o0aDRDR0x2d0FyYUVXNmI2YzIzUTYyUEd2?= =?utf-8?B?d1Uxb093aWorbU9oOFBQOG5oM0UwcjJBc2Z4KzJjSVc5eHN5R0llT1U5dVBn?= =?utf-8?B?eTdraFN3Mks5eXMwWWI4UWNiZXpNUUFqODBnVXMvcy9odFE9PQ==?= 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)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: A4k3zjCmsXWVGmoVSBnbzZ0tmVl82moTJ2BPKk+GPob6l/3tHzA34EyjrY++0qjeWv66uBs3ZvztW/Vg4Z9/PNBeddzeRsXUl0cUAGo0pFTPHC2M7uIaI8bsusxAhsW4eCV0qT4Kylt7PM+KrVg/8sYr60uGT7LluXGN5k4uf8Zecf4GdSO4hUOtuIxBy+l+13A53ezzz3Szh5fsns5A3g3SPv0g9OPdT4aPAJR4ipQ1r9o5SGDJSyxF2HnFfCDBFfWEdFnVwy75/7h6ADB2lKLZUztM8UCsH6JnR5mjSPf3qzGkF4GAY03LNBtrfJfdN2OC62XxF34LIN9x/fB5Xzy/X8LuWDGShse8fLsZB4N4hFsTJhadb2e8kQjSR6bbqe71GjanJTiZ++cpiYo+UjZ8GGwHLZBUh3Z+8C+8JQb9EXa+vLid4yG3MIFrOlaqDMOJtlYd3e6rVingIdaznkvILo0hPR1Vep+HdbFsrSBZv6R2ys6P3Mu1/QIwVCcbSvcmYwHllyvmgNSckLOmp6HQTmwa45VTYEr6BIwNuuQ/RTpr3Q/Z4Re0DIXdfdCIIiLyqPqf7elMxSaVfdrE1ZbCdH10yNqsDcYVRo1EwsekkNcm2vruMX74MI4W9/hJXjcsVAZpB16TN/EHc4xHnsXAjdnwIwxyHVA29tnNrD0= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 18:02:31.4262 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dea8ecdd-8e86-4610-84ff-08dd07fb2c5a 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: DU2PEPF00028D0D.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1P190MB2043 X-BESS-ID: 1731952956-303908-13344-34938-1 X-BESS-VER: 2019.1_20241105.1725 X-BESS-Apparent-Source-IP: 104.47.30.106 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.260511 [from cloudscan11-226.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