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 4B8F741EA5 for ; Wed, 15 Mar 2023 23:48:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47DF042BFE; Wed, 15 Mar 2023 23:48:13 +0100 (CET) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mails.dpdk.org (Postfix) with ESMTP id DAF9A40141 for ; Wed, 15 Mar 2023 23:48:08 +0100 (CET) Received: by mail-wm1-f50.google.com with SMTP id r19-20020a05600c459300b003eb3e2a5e7bso2303556wmo.0 for ; Wed, 15 Mar 2023 15:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678920488; 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=KIEEtIus8lm8YGyx2f4W2cJLDHSBouELlmzH0+T8lNI=; b=o7ZVuohSCdwzXjiwINexQfV7OaFPdaGzUSAkm8l3nPTXe9qZ8YCpOmchzjFOR4lOmW JDA0f8aL479G7RcALRpdPJ6WX5jzWVeuglWw/CBxhtz0FY3Pu2dyUTwYu95DNWd2mJo2 MbKxQ1tHBZHQOX+2J2E2T6HG4ZN3fHg7BF7Qwi8kPMSDrMcZxkHiJLgQ4o2a000nkHS/ OMPqZ7WhVuhkIG0xfam/b8EhkfgQ6YWa64AW5rS0mbkVDoWE3QtPVRVM7oGI092T9OVw 9HHbTZVisXffRyZ/S9pLDTxFLfEs/qrjba/Xh3JIM9tAGjNDTVvAcGirZb1R5FynLW0O GO/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678920488; 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=KIEEtIus8lm8YGyx2f4W2cJLDHSBouELlmzH0+T8lNI=; b=0EtiqjCFJFop1zdTnIn0+rwssO8DcPFzLBh6mo0UkZhVLkU4B7yLluS+csqFP7NHfm /xsybC5B/P8a2AnxcsbgxmDDr0OjFvr4yD560f6Si/YNDEeAOwLTIgrwKlGoyZUzw4Cd im5+IV50/DN70fYBZqaMfXlcnDCtjdeshcKTHmudg+5i0LqXiEPcfVemUr1UjPlsqWH/ TesitqtNAl83iQfDb/ZizAcPLEhkAe10M/RDyovYJbmcyTwab1TARlr6SLC3Wj8erVe4 tyjQmZgN61pKn3K7MYdCS5cps0clG0Df8CPEBARVmmCpO61xSMQhXo78hReYSsUKrKi2 IWSg== X-Gm-Message-State: AO0yUKUbb/Us2j6wNwPjknYa6IjKeiNJxZ7hdWiwcrL8TgKiWfRQ33Qe 8s5TZUBRRgEDUK41yYAtc2jK5E1u5DSMpA== X-Google-Smtp-Source: AK7set8lVHT8AgO10xmG9DxH9wcvEdfLWu7LnMP6slP+YItqCqgVX/m4pG7QpJ4O8MvQTTEseQzrCg== X-Received: by 2002:a05:600c:190c:b0:3e1:fc61:e0e5 with SMTP id j12-20020a05600c190c00b003e1fc61e0e5mr18838272wmq.33.1678920488489; Wed, 15 Mar 2023 15:48:08 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id 23-20020a05600c229700b003dc522dd25esm3074401wmf.30.2023.03.15.15.48.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 15:48:08 -0700 (PDT) From: luca.boccassi@gmail.com To: Huisong Li Cc: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: use new RSS rule to configure hardware' has been queued to stable release 20.11.8 Date: Wed, 15 Mar 2023 22:46:25 +0000 Message-Id: <20230315224631.1025649-34-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/0b181e7369fa0850b223e875968b79d1e94d31ce Thanks. Luca Boccassi --- >From 0b181e7369fa0850b223e875968b79d1e94d31ce Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Fri, 10 Mar 2023 17:35:13 +0800 Subject: [PATCH] net/hns3: use new RSS rule to configure hardware [ upstream commit 218a119a08e01f203f92b46334b6b2f03ff9765d ] Remove redundant assignment and directly use new RSS rule to configure hardware. Additionally, considering that the new rule configuration may need to be modified, the 'const' of input parameter about it is removed. Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_flow.c | 52 ++++++++++++++---------------------- 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 5f9e63f8dd..15f3172cbb 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1450,6 +1450,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config) { uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0}; bool use_default_key = false; + uint64_t flow_types; uint8_t hash_algo; int ret; @@ -1469,10 +1470,18 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config) hw->rss_key_size); if (ret) return ret; - hw->rss_info.rte_flow_hash_algo = hash_algo; - ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_config->types); + /* Filter the unsupported flow types */ + flow_types = rss_config->types ? + rss_config->types & HNS3_ETH_RSS_SUPPORT : + hw->rss_info.rss_hf; + if (flow_types != rss_config->types) + hns3_warn(hw, "modified RSS types based on hardware support," + " requested:0x%" PRIx64 " configured:0x%" PRIx64, + rss_config->types, flow_types); + + ret = hns3_set_rss_tuple_by_rss_hf(hw, flow_types); if (ret) hns3_err(hw, "Update RSS tuples by rss hf failed %d", ret); @@ -1518,48 +1527,27 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf) } static int -hns3_config_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf) +hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf) { - uint64_t flow_types; + struct rte_flow_action_rss *rss_act; uint16_t num; int ret; - struct rte_flow_action_rss rss_flow_conf = { - .func = conf->conf.func, - .level = conf->conf.level, - .types = conf->conf.types, - .key_len = conf->conf.key_len, - .queue_num = conf->conf.queue_num, - .key = conf->conf.key_len ? - (void *)(uintptr_t)conf->conf.key : NULL, - .queue = conf->conf.queue, - }; - + rss_act = &conf->conf; /* Set rx queues to use */ - num = RTE_MIN(hw->data->nb_rx_queues, rss_flow_conf.queue_num); - if (rss_flow_conf.queue_num > num) + num = RTE_MIN(hw->data->nb_rx_queues, rss_act->queue_num); + if (rss_act->queue_num > num) hns3_warn(hw, "Config queue numbers %u are beyond the scope of truncated", - rss_flow_conf.queue_num); + rss_act->queue_num); hns3_info(hw, "Max of contiguous %u PF queues are configured", num); if (num) { - ret = hns3_update_indir_table(hw, &rss_flow_conf, num); + ret = hns3_update_indir_table(hw, rss_act, num); if (ret) return ret; } - /* Filter the unsupported flow types */ - flow_types = conf->conf.types ? - rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT : - 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, - rss_flow_conf.types, flow_types); - /* Update the useful flow types */ - rss_flow_conf.types = flow_types; - /* Set hash algorithm and flow types by the user's config */ - return hns3_hw_rss_hash_set(hw, &rss_flow_conf); + return hns3_hw_rss_hash_set(hw, rss_act); } static int @@ -1649,7 +1637,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw, } static int -hns3_flow_parse_rss(struct rte_eth_dev *dev, const struct hns3_rss_conf *conf) +hns3_flow_parse_rss(struct rte_eth_dev *dev, struct hns3_rss_conf *conf) { struct hns3_adapter *hns = dev->data->dev_private; struct hns3_hw *hw = &hns->hw; -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-15 22:44:51.575719254 +0000 +++ 0034-net-hns3-use-new-RSS-rule-to-configure-hardware.patch 2023-03-15 22:44:49.651851686 +0000 @@ -1 +1 @@ -From 218a119a08e01f203f92b46334b6b2f03ff9765d Mon Sep 17 00:00:00 2001 +From 0b181e7369fa0850b223e875968b79d1e94d31ce Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 218a119a08e01f203f92b46334b6b2f03ff9765d ] + @@ -10,2 +11,0 @@ -Cc: stable@dpdk.org - @@ -19 +19 @@ -index 4da98d7adc..3700d073b1 100644 +index 5f9e63f8dd..15f3172cbb 100644 @@ -22 +22 @@ -@@ -1482,6 +1482,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config) +@@ -1450,6 +1450,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config) @@ -30 +30 @@ -@@ -1501,10 +1502,18 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config) +@@ -1469,10 +1470,18 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config) @@ -51 +51 @@ -@@ -1550,48 +1559,27 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf) +@@ -1518,48 +1527,27 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf) @@ -108 +108 @@ -@@ -1680,7 +1668,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw, +@@ -1649,7 +1637,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,