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 8D3F241D4F for ; Thu, 23 Feb 2023 10:39:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8658A4318C; Thu, 23 Feb 2023 10:39:32 +0100 (CET) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id 82838427E9 for ; Thu, 23 Feb 2023 10:39:31 +0100 (CET) Received: by mail-wr1-f49.google.com with SMTP id l25so9738071wrb.3 for ; Thu, 23 Feb 2023 01:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=QqNTmyRjClAck3Sld3XZRwbABvBK05fQH9iFKoTJn98=; b=gqzqo1OYS3KUqj2OBOPJD0EYiZzw//WLJkeY8dq55ny1QSSZ9g2zUEDn5BXJkVms9G BwW2Z8GmQE4S4ZDP8HIMu/0aBLk0HUWkUnuyFD7Wlqfwvs9uwKL6ZhdeXysZZ8KXnsNH oCGXkJ6Gk1SyYUWuUSROCD7ZR/iReFBrQSHFQO8bnskhgDlVTwCsLErb4Dv9nSs6qwbR Q07IX31aYZ+VNNlTOrquOIIsuTR2T9xK4ml7JZz6dbcHxDpvyN3afTh3xXBE654/Z9RI ptLX+XUn8EkmJ6SmYh4Z6csNrIR3KRpp0wv0e/9RH9cWSf8+uSVJcRI9YPIAnddM6Sxq a3gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=QqNTmyRjClAck3Sld3XZRwbABvBK05fQH9iFKoTJn98=; b=Gjaehh3YWIvjzrCgYaEAM3PrfR4xw6416tGVICKk8plFvt/CE/5HGAmVmVRClhC/Dx jmMdHb7uqOQ08O76Tu0MeMqNYK/TPmGme7LMuWKmcSI17s51NDrNI06L3oL0qYV5z5u5 2mUd/VLX7FUxkfMiam1I04KiiStAqLnC/WOz21LMhEQjFn1PY+uKTSfgLaiHUHGYG5so HMWmH12k5OZ7Lt3I4LnVNxGqMJsQ7NN8EW8kKLLpB5+qOaOQb0rlGrQBA8jB9bqilBO+ fqiAlUIGFvqZzZrnlyrz6HRGb9ApqV+axME8tI+tMcHjZaw52FlcWhFhRKGhvjOD3cw4 N6Uw== X-Gm-Message-State: AO0yUKWf6sMywApHy7K/5AYZ+6lJhYavFYey55e/MRllxPSafh7z/XOa A/Uh49k+V49x25aBf78dUwA= X-Google-Smtp-Source: AK7set+orqZUtFdtHiLv6gUyOxIE0df4kX7liAkwNTbXIgPIO/yrN3JJA8XQjFTuuFBy4iLt+OORGw== X-Received: by 2002:a5d:6b8a:0:b0:2c5:cc5d:17d2 with SMTP id n10-20020a5d6b8a000000b002c5cc5d17d2mr10553061wrx.66.1677145171267; Thu, 23 Feb 2023 01:39:31 -0800 (PST) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id z6-20020adfe546000000b002425be3c9e2sm9274813wrm.60.2023.02.23.01.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 01:39:30 -0800 (PST) From: luca.boccassi@gmail.com 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 20.11.8 Date: Thu, 23 Feb 2023 09:36:47 +0000 Message-Id: <20230223093715.3926893-43-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230223093715.3926893-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-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 20.11.8 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/25/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/1ec2d6e14c158c7148691362ca77aba8f4160705 Thanks. Luca Boccassi --- >From 1ec2d6e14c158c7148691362ca77aba8f4160705 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 67379d5bbb..0e0cf418ee 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1279,7 +1279,7 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, !memcmp(comp->key, with->key, with->key_len); 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 && !memcmp(comp->queue, with->queue, @@ -1564,15 +1564,7 @@ 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); } static int @@ -1645,17 +1637,32 @@ hns3_restore_filter(struct hns3_adapter *hns) return hns3_restore_rss_filter(hw); } +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, const struct hns3_rss_conf *conf, bool add) { 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 09:36:29.956546584 +0000 +++ 0043-net-hns3-use-RSS-filter-list-to-check-duplicated-rul.patch 2023-02-23 09:36:28.270170750 +0000 @@ -1 +1 @@ -From 6afde23d843ecf67453eaf69924bd79873f6f207 Mon Sep 17 00:00:00 2001 +From 1ec2d6e14c158c7148691362ca77aba8f4160705 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 67379d5bbb..0e0cf418ee 100644 @@ -22 +23 @@ -@@ -1300,7 +1300,7 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, +@@ -1279,7 +1279,7 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, @@ -31 +32 @@ -@@ -1596,15 +1596,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, +@@ -1564,15 +1564,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, @@ -48 +49 @@ -@@ -1676,17 +1668,32 @@ hns3_restore_filter(struct hns3_adapter *hns) +@@ -1645,17 +1637,32 @@ hns3_restore_filter(struct hns3_adapter *hns)