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 3F86F45DB9 for ; Wed, 27 Nov 2024 18:23:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C54A402DE; Wed, 27 Nov 2024 18:23:34 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 562B5402DE for ; Wed, 27 Nov 2024 18:23:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732728212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gXeBUJll3gAeCPA2l6sjzSZz0sCToQ5OEdQWbrRU0TI=; b=XuJv+c+l8hxVfDozhrp+drh1D6P9XpUTqnlDZbWY24YoOGnqNVWfA39YbVWVuGAFBWbAxk jgO93fN5WCvk6jGPltfDHm9VftyxBjcUvoYfdDCuOalwYjdXbgXCvkIPwg2CCVADagEfJw 2IIp/Gc1AbZHKauqhyzs0sraVR6DpKI= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-401-BFLqZFUmODGZXhf3OQx9dQ-1; Wed, 27 Nov 2024 12:23:29 -0500 X-MC-Unique: BFLqZFUmODGZXhf3OQx9dQ-1 X-Mimecast-MFC-AGG-ID: BFLqZFUmODGZXhf3OQx9dQ Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 73D1A1955F3A; Wed, 27 Nov 2024 17:23:28 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.52]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1201B300019E; Wed, 27 Nov 2024 17:23:26 +0000 (UTC) From: Kevin Traynor To: Danylo Vodopianov Cc: Dariusz Sosnowski , dpdk stable Subject: patch 'app/testpmd: fix aged flow destroy' has been queued to stable release 21.11.9 Date: Wed, 27 Nov 2024 17:19:02 +0000 Message-ID: <20241127171916.690404-115-ktraynor@redhat.com> In-Reply-To: <20241127171916.690404-1-ktraynor@redhat.com> References: <20241127171916.690404-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: zB7TbmB1wG1CIr3EYgN6YpIwvp_whjCdkvVa8YBe3yg_1732728208 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 21.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/02/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/bfc927a8beaa2bd9f4355fc96ccadcd61f63ab11 Thanks. Kevin --- >From bfc927a8beaa2bd9f4355fc96ccadcd61f63ab11 Mon Sep 17 00:00:00 2001 From: Danylo Vodopianov Date: Mon, 18 Nov 2024 19:03:23 +0100 Subject: [PATCH] app/testpmd: fix aged flow destroy [ upstream commit 098f949f8a70f7618f5390f9c1e9edfb9e5469c4 ] port_flow_destroy() function never assumed that rule array can be freed when it's executing, and port_flow_aged() just violated that assumption. In case of flow async create failure, it tries to do a cleanup, but it wrongly 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. Fixes: de956d5ecf08 ("app/testpmd: support age shared action context") Signed-off-by: Danylo Vodopianov Acked-by: Dariusz Sosnowski --- app/test-pmd/config.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index e060a1de49..aa979e886f 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2451,6 +2451,8 @@ 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: { + uint32_t flow_id; ctx.pf = container_of(type, struct port_flow, age_type); + flow_id = ctx.pf->id; printf("%-20s\t%" PRIu32 "\t%" PRIu32 "\t%" PRIu32 "\t%c%c%c\t\n", @@ -2463,7 +2465,8 @@ port_flow_aged(portid_t port_id, uint8_t destroy) ctx.pf->rule.attr->transfer ? 't' : '-'); if (destroy && !port_flow_destroy(port_id, 1, - &ctx.pf->id)) + &flow_id)) total++; break; + } case ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION: ctx.pia = container_of(type, -- 2.47.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-27 17:17:41.872956512 +0000 +++ 0115-app-testpmd-fix-aged-flow-destroy.patch 2024-11-27 17:17:38.349270016 +0000 @@ -1 +1 @@ -From 098f949f8a70f7618f5390f9c1e9edfb9e5469c4 Mon Sep 17 00:00:00 2001 +From bfc927a8beaa2bd9f4355fc96ccadcd61f63ab11 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 098f949f8a70f7618f5390f9c1e9edfb9e5469c4 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index c831166431..28d45568ac 100644 +index e060a1de49..aa979e886f 100644 @@ -28 +29 @@ -@@ -4161,6 +4161,8 @@ port_flow_aged(portid_t port_id, uint8_t destroy) +@@ -2451,6 +2451,8 @@ port_flow_aged(portid_t port_id, uint8_t destroy) @@ -33 +34 @@ -+ uint64_t flow_id; ++ uint32_t flow_id; @@ -36 +37 @@ - printf("%-20s\t%" PRIu64 "\t%" PRIu32 "\t%" PRIu32 + printf("%-20s\t%" PRIu32 "\t%" PRIu32 "\t%" PRIu32 @@ -38 +39 @@ -@@ -4173,7 +4175,8 @@ port_flow_aged(portid_t port_id, uint8_t destroy) +@@ -2463,7 +2465,8 @@ port_flow_aged(portid_t port_id, uint8_t destroy) @@ -41,2 +42,2 @@ -- &ctx.pf->id, false)) -+ &flow_id, false)) +- &ctx.pf->id)) ++ &flow_id))