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 E830F41EA5 for ; Wed, 15 Mar 2023 23:48:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E45B54161A; Wed, 15 Mar 2023 23:48:12 +0100 (CET) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mails.dpdk.org (Postfix) with ESMTP id A775240A7A for ; Wed, 15 Mar 2023 23:48:06 +0100 (CET) Received: by mail-wm1-f53.google.com with SMTP id az3-20020a05600c600300b003ed2920d585so1999517wmb.2 for ; Wed, 15 Mar 2023 15:48:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678920486; 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=brC/v8Fh2ig++OF/LEJ4kvK6HI8j9XYvDn54xL6GElM=; b=XPV/8I0s1RBV2z31JaCx/r6hzWLF5xRynb9BvxKSKiEfn8QL8UT62GukYue7nzwAYJ 5ekZqBoGoRRoOZ7cHILmbkQ9TROoT0mBY6on46rxQKLpCipHfnxKwQRPzSr3dlC3PzxF ATI87Nfx3XBfdETE6jXYkCnsDET7dMvzACPcOZ+mzy/kMgKpAf6TMatNZwZ26/5Zflqo ksxxcXRXLuIUHaWlxDiW43DxhyVZdRpbVCfIKZDoY190051DVLvu6+8BQglSDcMZieeF 0EddOjbC/ug1/ctEDjMaz8YRy365oBPoYycedygZgATKcbEfnLbiBItYKxEw7JlmSP8o 1dvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678920486; 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=brC/v8Fh2ig++OF/LEJ4kvK6HI8j9XYvDn54xL6GElM=; b=HsN97EKYyweZS3PkAdPBi4yuslUU56bLFqgRnndoNTltWYXByikV1iJfYMymJ2RBFl qWaBrt76Xo/ErDvedPqgr15519gRlpGY8bJn6tqgWAbIEwZAEhBDmBvr8xdE0iGJw3Py PQz+L8dsevh/orVACAA5YpZGI4So9vHSDJyuA8HEcb3UBHSzhdMVN76JbVLINUxPv2ru a2VnkcneAUJZ66QQetqje/+KjI6tAriJsArWhKHL0lh2/HdpY+LT201ga21qd80ttUHQ XbBM0+UoOC6De12jsNxXSLJJrBkKnA9s5Y8UBvQXGUZdzS7Pg0tbb9j7PF3j0D4e5AUR E+zw== X-Gm-Message-State: AO0yUKXpa1OH/QG2Gli2E7sBuE313L6lSkLr9wG78PnRDwTvyetIG1sA 93VDEXdz8SdveW3RrjRzWET9qrVvRce5Ig== X-Google-Smtp-Source: AK7set8hv6ZOlaD0QdKUIGbcvu3PTbKOkXR7JGgxcML/Kbo+jP3V9Z8ZNVtpKGxnybn+OdCJd8KKvw== X-Received: by 2002:a05:600c:21d4:b0:3ed:4b9b:f090 with SMTP id x20-20020a05600c21d400b003ed4b9bf090mr434538wmj.35.1678920486389; Wed, 15 Mar 2023 15:48:06 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id j15-20020adff00f000000b002cea9d931e6sm5851932wro.78.2023.03.15.15.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 15:48:06 -0700 (PDT) From: luca.boccassi@gmail.com To: Huisong Li Cc: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: separate setting RSS types' has been queued to stable release 20.11.8 Date: Wed, 15 Mar 2023 22:46:23 +0000 Message-Id: <20230315224631.1025649-32-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315224631.1025649-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-71-luca.boccassi@gmail.com> <20230315224631.1025649-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 03/17/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/7b870ee8535e5dae64601cc4b4a61e6da00200a0 Thanks. Luca Boccassi --- >From 7b870ee8535e5dae64601cc4b4a61e6da00200a0 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Fri, 10 Mar 2023 17:35:11 +0800 Subject: [PATCH] net/hns3: separate setting RSS types [ upstream commit 791e56935e488b8154a83daaf3952e1901ed7552 ] The settings of RSS types comes from the ethdev ops (like, dev_configure and rss_hash_update) and rte_flow API. For the ethdev ops, driver has to save it so as to it can be restored when reset is triggered. While rte_flow API no need to maintain this field, it can be restored by the saved rule. Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_flow.c | 3 ++- drivers/net/hns3/hns3_rss.c | 22 ++++++++++++++-------- drivers/net/hns3/hns3_rss.h | 1 + 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 3aaebd3515..f537526704 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1401,6 +1401,7 @@ hns3_disable_rss(struct hns3_hw *hw) ret = hns3_set_rss_tuple_by_rss_hf(hw, 0); if (ret) return ret; + hw->rss_info.rss_hf = 0; return 0; } @@ -1548,7 +1549,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, /* Filter the unsupported flow types */ flow_types = conf->conf.types ? rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT : - hw->rss_info.conf.types; + hw->rss_info.rss_hf; if (flow_types != rss_flow_conf.types) hns3_warn(hw, "modified RSS types based on hardware support," " requested:0x%" PRIx64 " configured:0x%" PRIx64, diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c index 7f4655333b..12a2f0e6f6 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c @@ -628,9 +628,6 @@ hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf) return ret; } - /* Update supported flow types when set tuple success */ - hw->rss_info.conf.types = rss_hf; - return 0; } @@ -648,7 +645,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf) { struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); - uint64_t rss_hf_bk = hw->rss_info.conf.types; + uint64_t rss_hf_bk = hw->rss_info.rss_hf; uint8_t key_len = rss_conf->rss_key_len; uint64_t rss_hf = rss_conf->rss_hf; uint8_t *key = rss_conf->rss_key; @@ -673,6 +670,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev, /* Update the shadow RSS key with user specified */ memcpy(hw->rss_info.key, key, hw->rss_key_size); } + hw->rss_info.rss_hf = rss_hf; rte_spinlock_unlock(&hw->lock); return 0; @@ -1035,6 +1033,7 @@ hns3_set_default_rss_args(struct hns3_hw *hw) /* Default hash algorithm */ rss_cfg->hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ; + hw->rss_info.rss_hf = 0; memcpy(rss_cfg->key, hns3_hash_key, RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size)); @@ -1072,15 +1071,22 @@ hns3_config_rss(struct hns3_adapter *hns) return ret; /* - * When muli-queue RSS mode flag is not set or unsupported tuples are + * When multi-queue RSS mode flag is not set or unsupported tuples are * set, disable all tuples. */ - rss_hf = hw->rss_info.conf.types; + rss_hf = hw->rss_info.rss_hf; if (!((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) || !(rss_hf & HNS3_ETH_RSS_SUPPORT)) rss_hf = 0; - return hns3_set_rss_tuple_by_rss_hf(hw, rss_hf); + ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_hf); + if (ret != 0) { + hns3_err(hw, "set RSS tuples failed, ret = %d.", ret); + return ret; + } + hw->rss_info.rss_hf = rss_hf; + + return 0; } /* @@ -1098,5 +1104,5 @@ hns3_rss_uninit(struct hns3_adapter *hns) return; /* Disable RSS */ - hw->rss_info.conf.types = 0; + hw->rss_info.rss_hf = 0; } diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h index eee5c98278..ffd76647c9 100644 --- a/drivers/net/hns3/hns3_rss.h +++ b/drivers/net/hns3/hns3_rss.h @@ -45,6 +45,7 @@ struct hns3_rss_tuple_cfg { struct hns3_rss_conf { /* RSS parameters :algorithm, flow_types, key, queue */ struct rte_flow_action_rss conf; + uint64_t rss_hf; uint8_t hash_algo; /* hash function type defined by hardware */ uint8_t rte_flow_hash_algo; uint8_t key[HNS3_RSS_KEY_SIZE_MAX]; /* Hash key */ -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-15 22:44:51.459998963 +0000 +++ 0032-net-hns3-separate-setting-RSS-types.patch 2023-03-15 22:44:49.647851603 +0000 @@ -1 +1 @@ -From 791e56935e488b8154a83daaf3952e1901ed7552 Mon Sep 17 00:00:00 2001 +From 7b870ee8535e5dae64601cc4b4a61e6da00200a0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 791e56935e488b8154a83daaf3952e1901ed7552 ] + @@ -12,2 +13,0 @@ -Cc: stable@dpdk.org - @@ -23 +23 @@ -index d5db09a263..21e00e515e 100644 +index 3aaebd3515..f537526704 100644 @@ -26 +26 @@ -@@ -1433,6 +1433,7 @@ hns3_disable_rss(struct hns3_hw *hw) +@@ -1401,6 +1401,7 @@ hns3_disable_rss(struct hns3_hw *hw) @@ -34 +34 @@ -@@ -1580,7 +1581,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, +@@ -1548,7 +1549,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, @@ -44 +44 @@ -index 751033d98f..f51d70a8e5 100644 +index 7f4655333b..12a2f0e6f6 100644 @@ -74 +74 @@ -@@ -1030,6 +1028,7 @@ hns3_rss_set_default_args(struct hns3_hw *hw) +@@ -1035,6 +1033,7 @@ hns3_set_default_rss_args(struct hns3_hw *hw) @@ -82 +82 @@ -@@ -1067,15 +1066,22 @@ hns3_config_rss(struct hns3_adapter *hns) +@@ -1072,15 +1071,22 @@ hns3_config_rss(struct hns3_adapter *hns) @@ -92 +92 @@ - if (!((uint32_t)mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) || + if (!((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) || @@ -108 +108 @@ -@@ -1093,5 +1099,5 @@ hns3_rss_uninit(struct hns3_adapter *hns) +@@ -1098,5 +1104,5 @@ hns3_rss_uninit(struct hns3_adapter *hns) @@ -116 +116 @@ -index 6e679b709b..21b90789d0 100644 +index eee5c98278..ffd76647c9 100644 @@ -119 +119 @@ -@@ -41,6 +41,7 @@ +@@ -45,6 +45,7 @@ struct hns3_rss_tuple_cfg {