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 0CE21A0093 for ; Thu, 10 Mar 2022 13:12:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 079154114D; Thu, 10 Mar 2022 13:12:16 +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 49C9A4113E for ; Thu, 10 Mar 2022 13:12:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646914334; 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=j82vOSYOXDDvxSFmvCrsDLwYBqHcDAD0K4bgrnOmvGM=; b=CVnqtqDkbfRJq2rPNhazUzGMKXB/FYNbO4H/Q8DN5gD8JGCVP3NuWeGVJg1XsIEe62U/tO GLaT9wNpE31MNyrCUOyr5XP9+8lwKjp+fto88JXsW0lGb8DrOgACn2bCJHf/CAjhLNzDnp TUxJ1wG7zomBKurUE468SQAI2FW7VWk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-9PmGZq0ROYiBTCIkq9VAdg-1; Thu, 10 Mar 2022 07:12:10 -0500 X-MC-Unique: 9PmGZq0ROYiBTCIkq9VAdg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7B38835DE0; Thu, 10 Mar 2022 12:12:09 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC0417FCE8; Thu, 10 Mar 2022 12:12:08 +0000 (UTC) From: Kevin Traynor To: Shun Hao Cc: Matan Azrad , dpdk stable Subject: patch 'net/mlx5: fix meter policy creation assert' has been queued to stable release 21.11.1 Date: Thu, 10 Mar 2022 12:11:17 +0000 Message-Id: <20220310121127.1324802-11-ktraynor@redhat.com> In-Reply-To: <20220310121127.1324802-1-ktraynor@redhat.com> References: <20220310121127.1324802-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/14/22. 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/3bd5cf393d0ab0152596bf2d0d8a8c2270a047d5 Thanks. Kevin --- >From 3bd5cf393d0ab0152596bf2d0d8a8c2270a047d5 Mon Sep 17 00:00:00 2001 From: Shun Hao Date: Wed, 2 Mar 2022 12:33:01 +0200 Subject: [PATCH] net/mlx5: fix meter policy creation assert [ upstream commit 9267617bb0a6918ee049b1a16062bf0185e2e843 ] The meter policy creation doesn't belong to flow rule creation process, so thread workspace was not initialized and there will be assert error when using it. This patch removes the incorrect using of thread workspace in meter policy creation, and adds a flag in policy instead. When creating flow rule, can use the flag to set the mark flag in thread workspace. Fixes: 082becbf1f35 ("net/mlx5: fix mark enabling for Rx") Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.h | 2 ++ drivers/net/mlx5/mlx5_flow.c | 2 ++ drivers/net/mlx5/mlx5_flow_dv.c | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 2d682e1e81..128ebd6937 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -748,4 +748,6 @@ struct mlx5_flow_meter_policy { uint32_t skip_g:1; /* If green color policy is skipped. */ + uint32_t mark:1; + /* If policy contains mark action. */ rte_spinlock_t sl; uint32_t ref_cnt; diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index cee8f00413..5b36cfa042 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -6070,4 +6070,6 @@ flow_create_split_meter(struct rte_eth_dev *dev, NULL); MLX5_ASSERT(wks->policy); + if (wks->policy->mark) + wks->mark = 1; if (wks->policy->is_hierarchy) { wks->final_policy = diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index a35fb3de4e..1ed0ebb3d9 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -15449,7 +15449,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, } mhdr_dummy; struct mlx5_flow_dv_modify_hdr_resource *mhdr_res = &mhdr_dummy.res; - struct mlx5_flow_workspace *wks = mlx5_flow_get_thread_workspace(); - MLX5_ASSERT(wks); egress = (domain == MLX5_MTR_DOMAIN_EGRESS) ? 1 : 0; transfer = (domain == MLX5_MTR_DOMAIN_TRANSFER) ? 1 : 0; @@ -15489,5 +15487,4 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, "cannot create policy " "mark action for this color"); - wks->mark = 1; if (flow_dv_tag_resource_register(dev, tag_be, &dev_flow, &flow_err)) @@ -15501,4 +15498,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, dev_flow.handle->dvh.rix_tag; action_flags |= MLX5_FLOW_ACTION_MARK; + mtr_policy->mark = 1; break; } @@ -15784,4 +15782,6 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, mtr_policy->is_hierarchy = 1; mtr_policy->dev = next_policy->dev; + if (next_policy->mark) + mtr_policy->mark = 1; action_flags |= MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-10 12:05:31.780278514 +0000 +++ 0018-net-mlx5-fix-meter-policy-creation-assert.patch 2022-03-10 12:05:31.305630868 +0000 @@ -1 +1 @@ -From 9267617bb0a6918ee049b1a16062bf0185e2e843 Mon Sep 17 00:00:00 2001 +From 3bd5cf393d0ab0152596bf2d0d8a8c2270a047d5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9267617bb0a6918ee049b1a16062bf0185e2e843 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index dd5cd9209f..23a28f6e52 100644 +index 2d682e1e81..128ebd6937 100644 @@ -29 +30 @@ -@@ -780,4 +780,6 @@ struct mlx5_flow_meter_policy { +@@ -748,4 +748,6 @@ struct mlx5_flow_meter_policy { @@ -37 +38 @@ -index efb988a9bb..15a4a8cd98 100644 +index cee8f00413..5b36cfa042 100644 @@ -40 +41 @@ -@@ -6297,4 +6297,6 @@ flow_create_split_meter(struct rte_eth_dev *dev, +@@ -6070,4 +6070,6 @@ flow_create_split_meter(struct rte_eth_dev *dev, @@ -48 +49 @@ -index 34d2c7a99f..29751e7eda 100644 +index a35fb3de4e..1ed0ebb3d9 100644 @@ -51 +52 @@ -@@ -15567,7 +15567,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, +@@ -15449,7 +15449,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, @@ -59 +60 @@ -@@ -15607,5 +15605,4 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, +@@ -15489,5 +15487,4 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, @@ -65 +66 @@ -@@ -15619,4 +15616,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, +@@ -15501,4 +15498,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, @@ -71 +72 @@ -@@ -15902,4 +15900,6 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev, +@@ -15784,4 +15782,6 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,