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 14F4845CD8 for ; Mon, 18 Nov 2024 19:03:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DB21427A7; Mon, 18 Nov 2024 19:03: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 6E106410EE; Mon, 18 Nov 2024 19:03:40 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2107.outbound.protection.outlook.com [104.47.17.107]) by mx-outbound19-89.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Nov 2024 18:03:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C/0wwM7+66XXNFAnvz1gQvnh7FWN33LyACn5HBM1/la02wjdibLswR5KjiaE161gA0Qm4EskBnqJW3mnOAxrvtzvEigX/rr1+ZsXrifdPM/xWtnonZhsi+WjKC2NOntRp2Az7Svc7XypVMeo1MxRTqtSAoE8Gyw2X7qpHxeiGSNpZvy5P55qcArTa5iyW9mQhQLhV+cZpgav1Psz6RbCuLsXwQuWK+Xz1lWcJf1fc2DpvwSHsp87i+xSOEbEnncqboTfDodjrmAhUqunjy7KNrSM1Vag5/0qvBPG3YYfNBrCiYvBheUnXCLhqtSE3Wz84pZ1cQOa0BHQejNR+5UNyQ== 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=/CT2pb9qrlLz3Ou6Nn+AbBFsENw48Svcn5klwrZNrYQ=; b=G4bR33559YAXNM8LF9zqMF22YlounYeQrWQQH0bZcqSQ7bWfq1KzNwJOn56LjP1pt7O31XUTVfQQ0ufL+qLsQ9Nq3O3ILQfWoAOz+T3V+lPU5ocsQcaZpQZtmHb2nWraecSEvbRnmBwUElXwvWAqqM4I/1p0SrhWrns3VY4a7kOlegWR/sdHQnvo7F4Sd0h9GMpeSRAn12C3uzqU497o3bqjRuZq2I5nAFpLXkP754vasVXbBV1iKgrw/3e+tf7vSVqOve1VUKaGea7bqjsTy/15ZCTiSSDGR8CShXeGuBzclA7tuh48UF9TaKbtNoMh0OmM43vpBpCp9YFB5zl4vA== 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=/CT2pb9qrlLz3Ou6Nn+AbBFsENw48Svcn5klwrZNrYQ=; b=D3nx7G867mUMGbKd4GwtPdwQ2qrqgNJ0jc1+nBuQil8SZKucKdncqMsFvNjR/d1YRQ6h6P9MHfp6QxGUsosnw8TedmUs9RwV1K9A1Z1KJUpn+P2rxxtYC5ltW2FoFwmR1g46KBqaRchmJOpHDinYMMsSCKyuE3YD2rq/NICMh3Q= Received: from AM6P192CA0078.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::19) by VI1P190MB0671.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:12e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Mon, 18 Nov 2024 18:03:31 +0000 Received: from AMS0EPF000001B1.eurprd05.prod.outlook.com (2603:10a6:209:8d:cafe::c7) by AM6P192CA0078.outlook.office365.com (2603:10a6:209:8d::19) 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 18:03:30 +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 AMS0EPF000001B1.mail.protection.outlook.com (10.167.16.165) with Microsoft SMTP Server id 15.20.8158.14 via Frontend Transport; Mon, 18 Nov 2024 18:03:30 +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 v3 1/2] app/testpmd: fix flow update Date: Mon, 18 Nov 2024 19:03:22 +0100 Message-ID: <20241118180323.2046886-2-dvo-plv@napatech.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241118180323.2046886-1-dvo-plv@napatech.com> References: <20241118112625.1880659-2-dvo-plv@napatech.com> <20241118180323.2046886-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: AMS0EPF000001B1:EE_|VI1P190MB0671:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a1a2ed1-2018-4a59-e732-08dd07fb4f88 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?Kys0QTdKak1Qd3RaV044alN0SzBXQWlpZjBweWlDcTViWnFxM2RFVTJCWVhR?= =?utf-8?B?cWdIU3h6cG9jcVlvdDBOd2F6MWxGcUFNV0ZoVnNBb0hWVW5XeGRoMXBtWnFp?= =?utf-8?B?c3oyVWpYSGhTdEtzREREN09zbjNHVkNvS3U4OGVMc1dPaHFnTDRwdjE5cWh6?= =?utf-8?B?UGJxclFwaWl1L29VM3k2OU85eTVwQ20ybHJsTkFibWR2eCtKWjR5bjhJcEc1?= =?utf-8?B?NW5WZStiM0lXWVE4c1ZHU3ZXYVlWK28wRzN2NXNxVDArdHVOSVFkbnJaTHp6?= =?utf-8?B?bnlOTWVJSGpYa3dZbDRQQ29HeXpNQU5YQkFlNmNRbUxQbzRsWnBIcnFJNmp4?= =?utf-8?B?SzFKZFMzeG1jSXc4OEhRYVNKOG9qUVV5akp4THFRZ0pKQ1dqWnNSeVEwUTBO?= =?utf-8?B?N3RFVFBzdjFvRVo3MXc2NE9WNm5nNjJqR0s5N2NKWlpFVVE0YVdLbWVMbjhl?= =?utf-8?B?US8yVmVGMlljMi84UzBUd2c5S2E1OEtJTGVQdHdoRy84TW1VVUgzcXAybHRW?= =?utf-8?B?dWRieUtOOUlYcHZVdjF4VmdUV050K0pWdm02d1NHVXJVL0p3L1FmZDJkai9L?= =?utf-8?B?Vy9sbDhnY3c0UDQ5d0NEakNqOEdOVi9LMCs3OFIwdXdOZk9MV0lheDVPZjBk?= =?utf-8?B?cjU3Q3cyUE9Ec0s4SU1YY3Z4a0hDMVZ3OWliSDh6dGdPSFZDcGxmWmdqTHhi?= =?utf-8?B?WDVxaS82ZS85L29GaHZzWUcvaHJsdStEek1oZ1pLbmFnMHBhTTk3THZ4bTRG?= =?utf-8?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yT0Nma1NTRVQz?= =?utf-8?B?a21JQ0FDa0hmd21Ta2NUUFE4NmNNakg3TnNDM2FPVGMyNU1YUFlBMzZhdW5S?= =?utf-8?B?NHlWYkpBem8xTFg3TmRKQnV0bm1wQUFMMnNNRzArRG1TZjE0SVh0V1JLbi9Q?= =?utf-8?B?YU1PWjByZnlRZDQ2aGxKMXA2WGpOWitxaEFOaHZGRDNyNWVQTnUyNXhtQXhr?= =?utf-8?B?QSsvNm9xcUJRMVBRc3BxMjEwREFQS0c3cFVyRzZhWkxKSmc9PQ==?= 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: QJWptGa7fEOKyI8UvKvttoDJstd3NpFCfM6KQQvgr9Lcq/JBiOhunEBFzPlb/3QcbuI2M+T+ozhKVbZ93JmcYIOJDoWpTSc270v3SfxfCBJ5IjQ1MXAuQW114pE2qpPEsqGKwS5uh5vQwoaGUD3jimdzEwkDOqeKA8AqmCc92yNxNkJdjLcyDgwItLoB0FQ3cmIlgbejm2sa+1ZCxIBulPnHlsFnRthdTioqOUKIeY1BmhDn7crRT9vgGoOuY2dqyy5stoFcqHP0GHzaXvJhUzMAX/hZIIQ7DH+2njHkKdrcLZ4tCRBgXBP8N05S8BLIKsNrYO63AnzvPDYjykg3N+858Ld+ksrrXaF5b7h6aJxLO+fcX0KZChc/W1ioFr73Ob3Ma9BbQ2nVKtIWtAqMdqT8QANahOcHhqQ8wm7GcfA/DJ7VzbK6kGWJKykdjX4DkxNaLqUPd3PS7cUAelny76GzdcNdJ80X6motGdMofGLa7V4Iy1bkZcHkMFEoRFn/inMCkkHB0xj7GXgnYLPfzcJAAGhqJR9LkAf2Sa9+XXsSp1bjZztMcrs3QwpAFlPNZGfq5g5o3QcgPm5Jz/rgVXO45G+UdUbVpL0IOcC0DSHIxe9qToZuRUR6gxXsF87kHabbxehmv2dg/tFqkJTyGXHGVch/yl0OG57/GFrM938= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 18:03:30.5755 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a1a2ed1-2018-4a59-e732-08dd07fb4f88 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: AMS0EPF000001B1.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1P190MB0671 X-BESS-ID: 1731953014-304953-13342-35757-2 X-BESS-VER: 2019.1_20241105.1725 X-BESS-Apparent-Source-IP: 104.47.17.107 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVkYGZmZAVgZQMNnYxCDRzCjRwD zN0CDVwsg0NTHZLDU5ydzY0sTUzNhQqTYWAG1wj2tBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.260511 [from cloudscan19-195.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-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 If actions provided to “flow update…“ command contained an age action, then testpmd did not update the age action context accordingly. Thus "flow aged destroy" command can not execute successfully. Fix was done with next steps 1. Generate new port flow entry to add/replace action(s). 2. Set age context if age action is present. 3. Replace flow in the flow list. Fixes: 2d9c7e56e52c ("app/testpmd: support updating flow rule actions") Cc: stable@dpdk.org Signed-off-by: Danylo Vodopianov --- app/test-pmd/config.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 88770b4dfc..c831166431 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3882,7 +3882,8 @@ port_flow_update(portid_t port_id, uint32_t rule_id, const struct rte_flow_action *actions, bool is_user_id) { struct rte_port *port; - struct port_flow **flow_list; + struct port_flow **flow_list, *uf; + struct rte_flow_action_age *age = age_action_get(actions); if (port_id_is_invalid(port_id, ENABLED_WARN) || port_id == (portid_t)RTE_PORT_ALL) @@ -3897,6 +3898,16 @@ port_flow_update(portid_t port_id, uint32_t rule_id, flow_list = &flow->next; continue; } + + /* Update flow action(s) with new action(s) */ + uf = port_flow_new(flow->rule.attr_ro, flow->rule.pattern_ro, actions, &error); + if (!uf) + return port_flow_complain(&error); + if (age) { + flow->age_type = ACTION_AGE_CONTEXT_TYPE_FLOW; + age->context = &flow->age_type; + } + /* * Poisoning to make sure PMDs update it in case * of error. @@ -3913,6 +3924,14 @@ port_flow_update(portid_t port_id, uint32_t rule_id, printf("Flow rule #%"PRIu64 " updated with new actions\n", flow->id); + + uf->next = flow->next; + uf->id = flow->id; + uf->user_id = flow->user_id; + uf->flow = flow->flow; + *flow_list = uf; + + free(flow); return 0; } printf("Failed to find flow %"PRIu32"\n", rule_id); -- 2.43.5