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 EB06B41D52 for ; Thu, 23 Feb 2023 16:08:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C787A43282; Thu, 23 Feb 2023 16:08:07 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id D74854327F for ; Thu, 23 Feb 2023 16:08:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677164885; 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=J1CT9aa9tbl9VaFZGNXdPdP7k6MfYARs6OFexRgajvs=; b=AQS+qb1gzY4YDZAxEVcMFM0KLNu/8+AmljLcpB0X/q/vtwltwtQYb/zGoXYWjpT8M7rqL7 lXUZi9EgfBP2iTDzPUv7o+tNQZFzqLfakltsLYqVmT/bm8T2m68jVV8J6Q3SCQP+1NIRiv u5zKDWZXkAYUQUx+84nT8f6ND/ixUrM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-300-fI_XsD9dNuGcHtBkGxmIRA-1; Thu, 23 Feb 2023 10:08:02 -0500 X-MC-Unique: fI_XsD9dNuGcHtBkGxmIRA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DDA7E85CCE3; Thu, 23 Feb 2023 15:08:00 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3459D2166B29; Thu, 23 Feb 2023 15:08:00 +0000 (UTC) From: Kevin Traynor To: Huisong Li Cc: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: use RSS filter list to check duplicated rule' has been queued to stable release 21.11.4 Date: Thu, 23 Feb 2023 15:05:51 +0000 Message-Id: <20230223150631.723699-60-ktraynor@redhat.com> In-Reply-To: <20230223150631.723699-1-ktraynor@redhat.com> References: <20230223150631.723699-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 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.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/28/23. 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/8ba1441f48dc4c1d222f90d0da4df3442ddea03e Thanks. Kevin --- >From 8ba1441f48dc4c1d222f90d0da4df3442ddea03e Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Tue, 31 Jan 2023 21:02:56 +0800 Subject: [PATCH] net/hns3: use RSS filter list to check duplicated rule [ upstream commit 6afde23d843ecf67453eaf69924bd79873f6f207 ] All rules from user are saved in RSS filter list, so use RSS filter list to check duplicated rule. Fixes: c37ca66f2b27 ("net/hns3: support RSS") Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_flow.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 78d0bd7e5e..d0d0c7c636 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1254,5 +1254,5 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, return (func_is_same && rss_key_is_same && - comp->types == (with->types & HNS3_ETH_RSS_SUPPORT) && + comp->types == with->types && comp->level == with->level && comp->queue_num == with->queue_num && @@ -1552,13 +1552,5 @@ hns3_config_rss_filter(struct hns3_hw *hw, /* Set hash algorithm and flow types by the user's config */ - ret = hns3_hw_rss_hash_set(hw, &rss_flow_conf); - if (ret) - return ret; - - ret = hns3_rss_conf_copy(rss_info, &rss_flow_conf); - if (ret) - hns3_err(hw, "RSS config init fail(%d)", ret); - - return ret; + return hns3_hw_rss_hash_set(hw, &rss_flow_conf); } @@ -1633,4 +1625,21 @@ hns3_restore_filter(struct hns3_adapter *hns) } +static bool +hns3_rss_action_is_dup(struct hns3_hw *hw, + const struct rte_flow_action_rss *act) +{ + struct hns3_rss_conf_ele *filter; + + TAILQ_FOREACH(filter, &hw->flow_rss_list, entries) { + if (!filter->filter_info.valid) + continue; + + if (hns3_action_rss_same(&filter->filter_info.conf, act)) + return true; + } + + return false; +} + static int hns3_flow_parse_rss(struct rte_eth_dev *dev, @@ -1639,9 +1648,7 @@ hns3_flow_parse_rss(struct rte_eth_dev *dev, struct hns3_adapter *hns = dev->data->dev_private; struct hns3_hw *hw = &hns->hw; - bool ret; - ret = hns3_action_rss_same(&hw->rss_info.conf, &conf->conf); - if (ret) { - hns3_err(hw, "Enter duplicate RSS configuration : %d", ret); + if (hns3_rss_action_is_dup(hw, &conf->conf)) { + hns3_err(hw, "duplicate RSS configuration"); return -EINVAL; } -- 2.39.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-23 14:46:25.264058965 +0000 +++ 0060-net-hns3-use-RSS-filter-list-to-check-duplicated-rul.patch 2023-02-23 14:46:23.808236098 +0000 @@ -1 +1 @@ -From 6afde23d843ecf67453eaf69924bd79873f6f207 Mon Sep 17 00:00:00 2001 +From 8ba1441f48dc4c1d222f90d0da4df3442ddea03e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6afde23d843ecf67453eaf69924bd79873f6f207 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index 5711757684..4cca675c53 100644 +index 78d0bd7e5e..d0d0c7c636 100644 @@ -22 +23 @@ -@@ -1301,5 +1301,5 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, +@@ -1254,5 +1254,5 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, @@ -29 +30 @@ -@@ -1597,13 +1597,5 @@ hns3_config_rss_filter(struct hns3_hw *hw, +@@ -1552,13 +1552,5 @@ hns3_config_rss_filter(struct hns3_hw *hw, @@ -44 +45 @@ -@@ -1677,4 +1669,21 @@ hns3_restore_filter(struct hns3_adapter *hns) +@@ -1633,4 +1625,21 @@ hns3_restore_filter(struct hns3_adapter *hns) @@ -66 +67 @@ -@@ -1683,9 +1692,7 @@ hns3_flow_parse_rss(struct rte_eth_dev *dev, +@@ -1639,9 +1648,7 @@ hns3_flow_parse_rss(struct rte_eth_dev *dev,