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 62F60A0C41 for ; Tue, 30 Nov 2021 17:44:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 579BB410F7; Tue, 30 Nov 2021 17:44:17 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 501A241177 for ; Tue, 30 Nov 2021 17:44:15 +0100 (CET) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (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 smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 14E734000A for ; Tue, 30 Nov 2021 16:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290655; bh=QJZtkqnpipQldcLGpTx42cFHtkNBztIA9aZKoLEsW2k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TbxVVwn58miZ1HIu8qy/0VIFIJx5Z6/uWWpelDywo1pEiWhzXL2PrEcqcasoXKdhf SsltqykR5kNxpzYD2IFNwAysaVIaulkTYj5266X3qDVHbBDqKuVvj83ymsjkMXqQYB Wh1GmY/Hy+3QhpPmew2VxBvglYk6J7lf6rD2/SZMVfNL/O4+VjHDFGr1xWC9QajFZK H6xrze6bkxibTs8iYUr06zBD2zWJjJHrPFdrb5XuOZzXubSxTw9wgtSXwewwX+8V7h +Owlr8DSNbnOdz4MnsRy3TvmTLJsM98FxwMypwNvdV63tSpdVOvqoS19pahWiOkfYN 5CJ8Uhf1UA9dA== Received: by mail-ed1-f70.google.com with SMTP id q17-20020aa7da91000000b003e7c0641b9cso17479823eds.12 for ; Tue, 30 Nov 2021 08:44:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QJZtkqnpipQldcLGpTx42cFHtkNBztIA9aZKoLEsW2k=; b=4EjZuHe/Jc6wjmxJZLlmb2bREHhnuQhh3g3PRIQY+sCJz+9AbxEAI3+9ATrv4SvnW/ oTnDYLXLzY5jPMxB2XAGB2sXraxgjBZ3qFkvrwTQxwxfZXYJ+LG68q6btc3pD84KncVu IgdQbiXvAWzyXGeJEaIA47bb6cZjfeshESaoZs1guDC/1S7t9I3+SUeS17+GYh4aNZbS DrgYfhDQfS8VweSLB1uavmqFg9DfMqqtLKl4nCEVgZut3UqXiRBZRrg2fDiScOc7Aol/ 7n7HPEzXJuOzQtw0kHAuC0rcPbOzzqe0EVUh+vFir/iKaAS3AuZWlCD/T0JhXernjvba b8Iw== X-Gm-Message-State: AOAM5319M6eISPQSxk06Gi70xgPTjg/36nE9bbtjAATDtQ+ftdVRQq02 Sr4/X4Qhazly7wOzlwDrLqAcPWPLCKK7k4BV7TJ7GhZ28m/Bt2yzlKAXShb/Gxdri0+zVeuhL6O iaoQzFYKDG0AFt7w/HO5uqYhq X-Received: by 2002:a17:906:fcc8:: with SMTP id qx8mr253911ejb.370.1638290654122; Tue, 30 Nov 2021 08:44:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqBN1ArVgVQlB5RW6bKhTAspK2ckyQHJ8SkD9QRr1jUz4nNySLjOoTbcddyDCuPGRNnuGjhw== X-Received: by 2002:a17:906:fcc8:: with SMTP id qx8mr253883ejb.370.1638290653880; Tue, 30 Nov 2021 08:44:13 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id d23sm3907796edq.51.2021.11.30.08.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:44:13 -0800 (PST) From: christian.ehrhardt@canonical.com To: Jiawei Wang Cc: Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix metadata and meter split shared tag' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:36:01 +0100 Message-Id: <20211130163605.2460997-157-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.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 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/b2543bbdc370a927376a095924798675018ace10 Thanks. Christian Ehrhardt --- >From b2543bbdc370a927376a095924798675018ace10 Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Fri, 19 Nov 2021 15:02:00 +0200 Subject: [PATCH] net/mlx5: fix metadata and meter split shared tag [ upstream commit 16f4aa57ca381c4283826cdfce2cd4e172744ca7 ] In the metadata flow split, PMD created the prefix subflow with removed Queue or RSS action and appended the set tag and copy table jump actions. If the flow being split for metadata was the meter prefix subflow, the driver supposed to share the same meter split tag action for the metadata split flow. There was the wrong check for preceding meter split tag action, causing append with metadata split set tag action and resulting the meter suffix subflow was missed due to tag value mismatch. This patch adds the checking before copying into extend action list, to make sure the correct shared tag is used. Fixes: 8d72fa668964 ("net/mlx5: share tag between meter and metadata") Signed-off-by: Jiawei Wang Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index eff0057a60..0d73eebcfc 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3685,6 +3685,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, * Pointer to the Q/RSS action. * @param[in] actions_n * Number of original actions. + * @param[in] mtr_sfx + * Check if it is in meter suffix table. * @param[out] error * Perform verbose error reporting if not NULL. * @@ -3697,7 +3699,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, struct rte_flow_action *split_actions, const struct rte_flow_action *actions, const struct rte_flow_action *qrss, - int actions_n, struct rte_flow_error *error) + int actions_n, int mtr_sfx, + struct rte_flow_error *error) { struct mlx5_rte_flow_action_set_tag *set_tag; struct rte_flow_action_jump *jump; @@ -3711,15 +3714,15 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, * - Add jump to mreg CP_TBL. * As a result, there will be one more action. */ - ++actions_n; memcpy(split_actions, actions, sizeof(*split_actions) * actions_n); + /* Count MLX5_RTE_FLOW_ACTION_TYPE_TAG. */ + ++actions_n; set_tag = (void *)(split_actions + actions_n); /* - * If tag action is not set to void(it means we are not the meter - * suffix flow), add the tag action. Since meter suffix flow already - * has the tag added. + * If we are not the meter suffix flow, add the tag action. + * Since meter suffix flow already has the tag added. */ - if (split_actions[qrss_idx].type != RTE_FLOW_ACTION_TYPE_VOID) { + if (!mtr_sfx) { /* * Allocate the new subflow ID. This one is unique within * device and not shared with representors. Otherwise, @@ -3751,6 +3754,12 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, MLX5_RTE_FLOW_ACTION_TYPE_TAG, .conf = set_tag, }; + } else { + /* + * If we are the suffix flow of meter, tag already exist. + * Set the QUEUE/RSS action to void. + */ + split_actions[qrss_idx].type = RTE_FLOW_ACTION_TYPE_VOID; } /* JUMP action to jump to mreg copy table (CP_TBL). */ jump = (void *)(set_tag + 1); @@ -3926,17 +3935,6 @@ flow_create_split_metadata(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "no memory to split " "metadata flow"); - /* - * If we are the suffix flow of meter, tag already exist. - * Set the tag action to void. - */ - if (mtr_sfx) - ext_actions[qrss - actions].type = - RTE_FLOW_ACTION_TYPE_VOID; - else - ext_actions[qrss - actions].type = - (enum rte_flow_action_type) - MLX5_RTE_FLOW_ACTION_TYPE_TAG; /* * Create the new actions list with removed Q/RSS action * and appended set tag and jump to register copy table @@ -3944,7 +3942,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev, * in advance, because it is needed for set tag action. */ qrss_id = flow_mreg_split_qrss_prep(dev, ext_actions, actions, - qrss, actions_n, error); + qrss, actions_n, + mtr_sfx, error); if (!mtr_sfx && !qrss_id) { ret = -rte_errno; goto exit; -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:14.954580261 +0100 +++ 0157-net-mlx5-fix-metadata-and-meter-split-shared-tag.patch 2021-11-30 16:50:06.138876083 +0100 @@ -1 +1 @@ -From 16f4aa57ca381c4283826cdfce2cd4e172744ca7 Mon Sep 17 00:00:00 2001 +From b2543bbdc370a927376a095924798675018ace10 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 16f4aa57ca381c4283826cdfce2cd4e172744ca7 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -28 +29 @@ -index 43598f92ee..84e6f3048c 100644 +index eff0057a60..0d73eebcfc 100644 @@ -31 +32 @@ -@@ -5251,6 +5251,8 @@ exit: +@@ -3685,6 +3685,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, @@ -40 +41 @@ -@@ -5263,7 +5265,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, +@@ -3697,7 +3699,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, @@ -48 +48,0 @@ - struct mlx5_priv *priv = dev->data->dev_private; @@ -50 +50,2 @@ -@@ -5278,15 +5281,15 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, + struct rte_flow_action_jump *jump; +@@ -3711,15 +3714,15 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, @@ -71 +72 @@ -@@ -5319,6 +5322,12 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, +@@ -3751,6 +3754,12 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, @@ -84 +85 @@ -@@ -5773,17 +5782,6 @@ flow_create_split_metadata(struct rte_eth_dev *dev, +@@ -3926,17 +3935,6 @@ flow_create_split_metadata(struct rte_eth_dev *dev, @@ -102 +103 @@ -@@ -5791,7 +5789,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev, +@@ -3944,7 +3942,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev,