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 C988245D5D for ; Thu, 21 Nov 2024 00:44:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C22DB40296; Thu, 21 Nov 2024 00:44:13 +0100 (CET) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id 650C64327F for ; Thu, 21 Nov 2024 00:44:12 +0100 (CET) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4315839a7c9so2259385e9.3 for ; Wed, 20 Nov 2024 15:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732146252; x=1732751052; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lIk8dxBRmGSkw8CLmfN8pbM8ETbe76NXdKjhtHionp8=; b=GmAby45d8jmEwym4j+NypoOHLE6q968GcJAY/9bG2VfvCJXB9yaMeMTO8mB60oJnx8 r/STyOyZWJcrjmxq4sua9K5+wNo6XZeYv+sPLD9+wgEyjx81qk0rgtQzc+X6F5AZrZtu kRYfRfKd6TOQpOnxVPaPq6UutcLrHUy97w5kl15QywKxWPNrowZ8agrajqpLLA2pgo4A XrcZVPy9Z3H9Aqs9mDJds1+w583otBBM2YVc8LmluQ9QqOYBb6XSy8dHSQ75pWmrH/pq Rfru9QiR8sVPfOaxq0ABkZn3RDAp4AAVj4xrgBslQwL3uOzVjQYmk2+f7XVD/s/PIJHL HAJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732146252; x=1732751052; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lIk8dxBRmGSkw8CLmfN8pbM8ETbe76NXdKjhtHionp8=; b=RevLjlVHCyG9RYuy7DWhl86yp6fKCwIGOIpBHmb5Ega/NF5bB5c9pMZ2tYgAe/e+jZ U2RRrf7XwJ+o86UxCDWraOtLWzNJ+BjzW8g9hvK1DDKNiugfQYYMf2AMxGaEms8tj+Zr yx8FazshOljOhbxTPwQeKdCzEY1J6RQGUVYS8rcXH4ddK01WMTTkp3ImzJy/WGUqYTIK bW7jTW8TdE7EFLScBPm0rCAUFIb1XuUL3hLjJ7Wh9Ba4Zdx/RuurVSg+eDOC+36tiJAg CmDecEYPOwQjY3YDaMDB5C4v2eMZidCW/xKQUL3hKKOR4LCvJVujFDICYWM1QyK+DjO5 LAlA== X-Forwarded-Encrypted: i=1; AJvYcCW71ouGOrEFgq6j72GED2yowyEgE9IrJ8k4K+Ndmbwuu3gsY4RssMDzoYvSk4YaF4bJgI2R3to=@dpdk.org X-Gm-Message-State: AOJu0Yxz6YmYDZiZYcv09fs5LZh7C5k7nZv0egDoufN94XVPvstD7nMT OxiRpFyre7TULsCTSSno8zXhajMY23Xq7ZDUKfwk/4H8lFDJJ0zy/1/wxU5I X-Gm-Gg: ASbGncuXSDXOusG9uSSRWomzzJ0gkj9dpj8RAVQdpqWfF5nL+sB4bi82SBVX5PAQQgy hQ5GDAZi4TWTva8kpxp6Wv/kk5ubV1LM2lfZt9SBobJvGZKde8KlEl5AuklGgHEZowr6Bn/X+dS pauIT35VIrvSEI4xcdu3Vwpi6IDRHhzZ/n3HOW1pqQkDwROduEQsNBHsYNrAVZEl4EHevQiKnDE J5PzggLbGovN+vS0lCD8KRa9vcl4rX7qm4Zp0xNz5KnKA5vyT2PIriN X-Google-Smtp-Source: AGHT+IEt1wQgxxgHHIA+hb0vWbChVoSbHarYuFrO03kUT5WYdk9arsLSRpf/RCShmlEqgSCglWg5Ng== X-Received: by 2002:a05:600c:3b25:b0:42c:e0da:f15c with SMTP id 5b1f17b1804b1-4334f018a5amr35478145e9.20.1732146251930; Wed, 20 Nov 2024 15:44:11 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b463b0d1sm34320155e9.42.2024.11.20.15.44.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 15:44:11 -0800 (PST) From: luca.boccassi@gmail.com To: Danylo Vodopianov Cc: Dariusz Sosnowski , dpdk stable Subject: patch 'app/testpmd: fix aged flow destroy' has been queued to stable release 22.11.7 Date: Wed, 20 Nov 2024 23:41:53 +0000 Message-ID: <20241120234215.233355-28-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241120234215.233355-1-luca.boccassi@gmail.com> References: <20241112220754.666489-40-luca.boccassi@gmail.com> <20241120234215.233355-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/22/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/2e0f9b4eab9cfdfe4e843970621be3f372752771 Thanks. Luca Boccassi --- >From 2e0f9b4eab9cfdfe4e843970621be3f372752771 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 4ff0e72115..83339ee455 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3561,8 +3561,10 @@ 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", "Flow", @@ -3573,9 +3575,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)) + &flow_id)) total++; break; + } case ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION: ctx.pia = container_of(type, struct port_indirect_action, age_type); -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-20 23:41:23.681026879 +0000 +++ 0028-app-testpmd-fix-aged-flow-destroy.patch 2024-11-20 23:41:22.760195468 +0000 @@ -1 +1 @@ -From 098f949f8a70f7618f5390f9c1e9edfb9e5469c4 Mon Sep 17 00:00:00 2001 +From 2e0f9b4eab9cfdfe4e843970621be3f372752771 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 4ff0e72115..83339ee455 100644 @@ -28 +29 @@ -@@ -4160,8 +4160,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) +@@ -3561,8 +3561,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) @@ -34 +35 @@ -+ uint64_t flow_id; ++ uint32_t flow_id; @@ -37 +38 @@ - printf("%-20s\t%" PRIu64 "\t%" PRIu32 "\t%" PRIu32 + printf("%-20s\t%" PRIu32 "\t%" PRIu32 "\t%" PRIu32 @@ -40 +41 @@ -@@ -4172,9 +4174,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) +@@ -3573,9 +3575,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) @@ -44,2 +45,2 @@ -- &ctx.pf->id, false)) -+ &flow_id, false)) +- &ctx.pf->id)) ++ &flow_id))