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 06E93A0093 for ; Thu, 17 Mar 2022 13:06:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE0D84067B; Thu, 17 Mar 2022 13:06:32 +0100 (CET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mails.dpdk.org (Postfix) with ESMTP id 1C9DE4067B for ; Thu, 17 Mar 2022 13:06:32 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id r6so7071209wrr.2 for ; Thu, 17 Mar 2022 05:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z2r6YkMv2PmyteaCVNcg+l2SQvoozR+i1VvJpVPGII4=; b=o5iY3iwFYj77N4/AmubDYTq+o8C5Eobh5q+DfOt5diu1FCFvabegNerKAasE+G0shy QgsToI+G+PJ21ODGMQMPKz3mylxRR4IMZaeK9D3q3atgrR8sZZqH8An/nfTawfg1UE+t ZL7npYcvSImZno6Tf64MpPqH9CKbSCHyW4cF9QZUOH+hqhNjc/0Q1DbqLLvi7Pc6kdYB noO88bD0pIFnXUH8dNjiuQZOWUvEPTEsrUXkyVLCDVsT1hZ8TqOrMEHngnrJHi4FqFqw fyWxlO+Wz4X5ZTx4VGFnl2dSQ5oxHS5Jt6QK2s0zKy1FTO6RCrW+iLkbt6gVJNv3aaEZ 7JpA== 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=z2r6YkMv2PmyteaCVNcg+l2SQvoozR+i1VvJpVPGII4=; b=3rbPUDGXLq0ELMmdpLPbi2kf7YNQvH97MZY3LC9vL+FinPY2Fjog8+AITbcQ37lDNw z6T3z7l23OXukBIea3u95RxH2btH92s9xoTN/QRkN1LsBEiM1LlSQyLRbVcOa4Rp+vnL qa1yglJVHmqui6iWW9pcX3nwXDo9PGL5aU8vIschVaB6oKI9qUn4WGVmYCkVz5EWqGCm ihvfiY091CgGXbYIX1vkyUgjUMqFpV5OKRusJVQUin+LUXoaZDmtKMY8jbUbIsRkUmJP D+HLlu+WtBZSfSbIDF3hTyUPYgLzF4nazU5cskVpDoRBhqM0Djze1aQMqVbzCif57GmU u4eg== X-Gm-Message-State: AOAM531865OvFEqiJYuhWkl4jw3Rdkp+Z4R2h4v6HVvPUn0WUlgT9em6 37ns4LFylP1u4Cx0V/6CUVQ= X-Google-Smtp-Source: ABdhPJzkaKyj36Fq++945k5WWgl1jqdV1mNlghyogYePFonMnjN26x4A/ab5JrWkfoOx+iozD+OPWg== X-Received: by 2002:a5d:59ac:0:b0:203:9615:31db with SMTP id p12-20020a5d59ac000000b00203961531dbmr3755704wrr.457.1647518791601; Thu, 17 Mar 2022 05:06:31 -0700 (PDT) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id x2-20020adff0c2000000b001f1fa284a32sm3835552wro.115.2022.03.17.05.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 05:06:30 -0700 (PDT) From: luca.boccassi@gmail.com To: Jiawei Wang Cc: Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix port matching in sample flow rule' has been queued to stable release 20.11.5 Date: Thu, 17 Mar 2022 12:06:24 +0000 Message-Id: <20220317120627.917448-1-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315133233.635559-9-luca.boccassi@gmail.com> References: <20220315133233.635559-9-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 20.11.5 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/19/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/1d25333ce0a0b615ee571078a7b3f270beb306d9 Thanks. Luca Boccassi --- >From 1d25333ce0a0b615ee571078a7b3f270beb306d9 Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Mon, 7 Mar 2022 04:10:42 +0200 Subject: [PATCH] net/mlx5: fix port matching in sample flow rule [ upstream commit 04c0d3f20f54618c2b62f353b31b5a2fb20d687a ] If there are an explicit port match and sample action in the same flow, mlx5 PMD pushes the explicit port match in the prefix subflow, and uses the tag item match in the suffix subflow. The explicit port match was translated into source vport match so the sample suffix subflow lost this match after flow split. This patch copies the explicit port match to the sample suffix subflow, and the latter gets the correct source vport value in the flow matcher. Fixes: b4c0ddbfcc58 ("net/mlx5: split sample flow into two sub-flows") Signed-off-by: Jiawei Wang Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index bed853e726..cee8bc3418 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -4714,7 +4714,7 @@ flow_check_match_action(const struct rte_flow_action actions[], return flag ? actions_n + 1 : 0; } -#define SAMPLE_SUFFIX_ITEM 2 +#define SAMPLE_SUFFIX_ITEM 3 /** * Split the sample flow. @@ -4753,6 +4753,7 @@ flow_check_match_action(const struct rte_flow_action actions[], static int flow_sample_split_prep(struct rte_eth_dev *dev, uint32_t fdb_tx, + const struct rte_flow_item items[], struct rte_flow_item sfx_items[], const struct rte_flow_action actions[], struct rte_flow_action actions_sfx[], @@ -4792,6 +4793,12 @@ flow_sample_split_prep(struct rte_eth_dev *dev, [MLX5_IPOOL_RSS_EXPANTION_FLOW_ID], &tag_id); set_tag->data = tag_id; /* Prepare the suffix subflow items. */ + for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) { + if (items->type == RTE_FLOW_ITEM_TYPE_PORT_ID) { + memcpy(sfx_items, items, sizeof(*sfx_items)); + sfx_items++; + } + } tag_spec = (void *)(sfx_items + SAMPLE_SUFFIX_ITEM); tag_spec->data = tag_id; tag_spec->id = set_tag->id; @@ -5263,7 +5270,7 @@ flow_create_split_sample(struct rte_eth_dev *dev, sfx_items = (struct rte_flow_item *)((char *)sfx_actions + act_size); pre_actions = sfx_actions + actions_n; - tag_id = flow_sample_split_prep(dev, fdb_tx, sfx_items, + tag_id = flow_sample_split_prep(dev, fdb_tx, items, sfx_items, actions, sfx_actions, pre_actions, actions_n, sample_action_pos, -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-17 12:05:30.337012733 +0000 +++ 0001-net-mlx5-fix-port-matching-in-sample-flow-rule.patch 2022-03-17 12:05:30.300855283 +0000 @@ -1 +1 @@ -From 04c0d3f20f54618c2b62f353b31b5a2fb20d687a Mon Sep 17 00:00:00 2001 +From 1d25333ce0a0b615ee571078a7b3f270beb306d9 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 04c0d3f20f54618c2b62f353b31b5a2fb20d687a ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index cd55bdc2c0..78cb38d42b 100644 +index bed853e726..cee8bc3418 100644 @@ -29 +30 @@ -@@ -5783,7 +5783,7 @@ flow_check_match_action(const struct rte_flow_action actions[], +@@ -4714,7 +4714,7 @@ flow_check_match_action(const struct rte_flow_action actions[], @@ -38 +39 @@ -@@ -5824,6 +5824,7 @@ flow_check_match_action(const struct rte_flow_action actions[], +@@ -4753,6 +4753,7 @@ flow_check_match_action(const struct rte_flow_action actions[], @@ -41 +42 @@ - int add_tag, + uint32_t fdb_tx, @@ -46,3 +47,3 @@ -@@ -5951,6 +5952,12 @@ flow_sample_split_prep(struct rte_eth_dev *dev, - .data = tag_id, - }; +@@ -4792,6 +4793,12 @@ flow_sample_split_prep(struct rte_eth_dev *dev, + [MLX5_IPOOL_RSS_EXPANTION_FLOW_ID], &tag_id); + set_tag->data = tag_id; @@ -59,3 +60,3 @@ -@@ -6563,7 +6570,7 @@ flow_create_split_sample(struct rte_eth_dev *dev, - jump_table = attr->group * MLX5_FLOW_TABLE_FACTOR + - next_ft_step; +@@ -5263,7 +5270,7 @@ flow_create_split_sample(struct rte_eth_dev *dev, + sfx_items = (struct rte_flow_item *)((char *)sfx_actions + + act_size); @@ -63,2 +64,2 @@ -- tag_id = flow_sample_split_prep(dev, add_tag, sfx_items, -+ tag_id = flow_sample_split_prep(dev, add_tag, items, sfx_items, +- tag_id = flow_sample_split_prep(dev, fdb_tx, sfx_items, ++ tag_id = flow_sample_split_prep(dev, fdb_tx, items, sfx_items,