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 90EEF41D52 for ; Thu, 23 Feb 2023 16:08:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2894F4328C; Thu, 23 Feb 2023 16:08:10 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 0E7334327B for ; Thu, 23 Feb 2023 16:08:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677164888; 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=K+RQiAJFgpZ9xKYTrqWfCOhYUfbIGVAh+lSqW2PFRhw=; b=TUkVu+vvNTACwVDEeHUzeFwjkJXnJMqt7SAzzOIIBuTejrFvABo+qB4eOXnDS5pVShlb3F Q7VHT0DBmP8KgkNPE7OC4qFwK+qnnFV0Xdf3okh8JDXrCcBmrLhBgzmpFPYdZl0Qya5FvM O89FEhKPMTgfUyZY00yLywT1d5Gagyg= 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-35-BmQhNyTfOOScyiwQ-ONeUA-1; Thu, 23 Feb 2023 10:08:04 -0500 X-MC-Unique: BmQhNyTfOOScyiwQ-ONeUA-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 D527718E092D; Thu, 23 Feb 2023 15:08:03 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B7C02166B34; Thu, 23 Feb 2023 15:08:03 +0000 (UTC) From: Kevin Traynor To: Huisong Li Cc: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: fix config struct used for conversion' has been queued to stable release 21.11.4 Date: Thu, 23 Feb 2023 15:05:54 +0000 Message-Id: <20230223150631.723699-63-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/69d2be50d9ec4bbad7342d2bf00894b918150b0f Thanks. Kevin --- >From 69d2be50d9ec4bbad7342d2bf00894b918150b0f Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Tue, 31 Jan 2023 21:02:59 +0800 Subject: [PATCH] net/hns3: fix config struct used for conversion [ upstream commit 815c7db53167f7ee1573dca18fa7f889e44764d4 ] When the type in 'struct rte_flow_action' is RTE_FLOW_ACTION_TYPE_RSS, the 'conf' pointer references the 'struct rte_flow_action_rss' instead of the 'struct hns3_rss_conf' in driver. But driver uses 'struct hns3_rss_conf' to convert this 'conf' pointer to get RSS action configuration. In addition, RSS filter configuration is directly cloned to RSS filter node instead of coping it after successfully setting to hardware. Fixes: c37ca66f2b27 ("net/hns3: support RSS") Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_flow.c | 59 ++++++++++++++---------------------- 1 file changed, 22 insertions(+), 37 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index cc1a7f5eaa..8ed1e405c0 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -96,6 +96,6 @@ hns3_find_rss_general_action(const struct rte_flow_item pattern[], const struct rte_flow_action actions[]) { + const struct rte_flow_action_rss *rss_act; const struct rte_flow_action *act = NULL; - const struct hns3_rss_conf *rss; bool have_eth = false; @@ -116,6 +116,6 @@ hns3_find_rss_general_action(const struct rte_flow_item pattern[], } - rss = act->conf; - if (have_eth && rss->conf.queue_num) { + rss_act = act->conf; + if (have_eth && rss_act->queue_num) { /* * Pattern have ETH and action's queue_num > 0, indicate this is @@ -1250,28 +1250,4 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, } -static int -hns3_rss_conf_copy(struct hns3_rss_conf *out, - const struct rte_flow_action_rss *in) -{ - if (in->key_len > RTE_DIM(out->key) || - in->queue_num > RTE_DIM(out->queue)) - return -EINVAL; - if (in->key == NULL && in->key_len) - return -EINVAL; - out->conf = (struct rte_flow_action_rss) { - .func = in->func, - .level = in->level, - .types = in->types, - .key_len = in->key_len, - .queue_num = in->queue_num, - }; - out->conf.queue = memcpy(out->queue, in->queue, - sizeof(*in->queue) * in->queue_num); - if (in->key) - out->conf.key = memcpy(out->key, in->key, in->key_len); - - return 0; -} - static bool hns3_rss_input_tuple_supported(struct hns3_hw *hw, @@ -1690,7 +1666,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, { struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); + const struct rte_flow_action_rss *rss_act; struct hns3_rss_conf_ele *rss_filter_ptr; struct hns3_rss_conf_ele *filter_ptr; - const struct hns3_rss_conf *rss_conf; + struct hns3_rss_conf *new_conf; int ret; @@ -1702,17 +1679,25 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, } - /* - * After all the preceding tasks are successfully configured, configure - * rules to the hardware to simplify the rollback of rules in the - * hardware. - */ - rss_conf = (const struct hns3_rss_conf *)act->conf; - ret = hns3_flow_parse_rss(dev, rss_conf, true); + rss_act = (const struct rte_flow_action_rss *)act->conf; + new_conf = &rss_filter_ptr->filter_info; + memcpy(&new_conf->conf, rss_act, sizeof(*rss_act)); + if (rss_act->queue_num > 0) { + memcpy(new_conf->queue, rss_act->queue, + rss_act->queue_num * sizeof(new_conf->queue[0])); + new_conf->conf.queue = new_conf->queue; + } + if (rss_act->key_len > 0) { + if (rss_act->key != NULL) { + memcpy(new_conf->key, rss_act->key, + rss_act->key_len * sizeof(new_conf->key[0])); + new_conf->conf.key = new_conf->key; + } + } + + ret = hns3_flow_parse_rss(dev, new_conf, true); if (ret != 0) { rte_free(rss_filter_ptr); return ret; } - - hns3_rss_conf_copy(&rss_filter_ptr->filter_info, &rss_conf->conf); rss_filter_ptr->filter_info.valid = true; -- 2.39.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-23 14:46:25.332714731 +0000 +++ 0063-net-hns3-fix-config-struct-used-for-conversion.patch 2023-02-23 14:46:23.813236116 +0000 @@ -1 +1 @@ -From 815c7db53167f7ee1573dca18fa7f889e44764d4 Mon Sep 17 00:00:00 2001 +From 69d2be50d9ec4bbad7342d2bf00894b918150b0f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 815c7db53167f7ee1573dca18fa7f889e44764d4 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index 632247b846..dd762c02cb 100644 +index cc1a7f5eaa..8ed1e405c0 100644 @@ -45 +46 @@ -@@ -1297,28 +1297,4 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, +@@ -1250,28 +1250,4 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, @@ -74 +75 @@ -@@ -1734,7 +1710,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, +@@ -1690,7 +1666,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, @@ -84 +85 @@ -@@ -1746,17 +1723,25 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, +@@ -1702,17 +1679,25 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,