From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 58A0CA04B0;
	Tue, 22 Sep 2020 14:06:23 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id E0EF11DBC1;
	Tue, 22 Sep 2020 14:04:09 +0200 (CEST)
Received: from incedge.chinasoftinc.com (unknown [114.113.233.8])
 by dpdk.org (Postfix) with ESMTP id 75B511DAE7
 for <dev@dpdk.org>; Tue, 22 Sep 2020 14:03:46 +0200 (CEST)
X-ASG-Debug-ID: 1600776225-149d111bae1ab940002-TfluYd
Received: from mail.chinasoftinc.com (inccas002.ito.icss [10.168.0.52]) by
 incedge.chinasoftinc.com with ESMTP id AClMr2ReMMowCXGp (version=TLSv1
 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO);
 Tue, 22 Sep 2020 20:03:45 +0800 (CST)
X-Barracuda-Envelope-From: huwei013@chinasoftinc.com
X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.52
X-ASG-Whitelist: Client
Received: from localhost.localdomain (120.133.139.157) by INCCAS002.ito.icss
 (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 22 Sep 2020
 20:03:45 +0800
From: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>
X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.60
To: <dev@dpdk.org>
CC: <xavier.huwei@huawei.com>
Date: Tue, 22 Sep 2020 20:03:29 +0800
X-ASG-Orig-Subj: [PATCH v2 17/17] net/hns3: fix storing RSS info when creating
 flow action
Message-ID: <20200922120329.21185-18-huwei013@chinasoftinc.com>
X-Mailer: git-send-email 2.9.5
In-Reply-To: <20200922120329.21185-1-huwei013@chinasoftinc.com>
References: <20200922085401.12272-1-huwei013@chinasoftinc.com>
 <20200922120329.21185-1-huwei013@chinasoftinc.com>
MIME-Version: 1.0
Content-Type: text/plain
X-Originating-IP: [120.133.139.157]
X-Barracuda-Connect: inccas002.ito.icss[10.168.0.52]
X-Barracuda-Start-Time: 1600776225
X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA
X-Barracuda-URL: https://incspam.chinasofti.com:443/cgi-mod/mark.cgi
X-Virus-Scanned: by bsmtpd at chinasoftinc.com
X-Barracuda-Scan-Msg-Size: 1490
Subject: [dpdk-dev] [PATCH v2 17/17] net/hns3: fix storing RSS info when
	creating flow action
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>

Currently, when calling the rte_flow_query API function to query the RSS
information, the queue related information is not as expected.

The root cause is that when application call the rte_flow_create API
function to create RSS action, the operation of storing the data whose typs
is struct rte_flow_action_rss is incorrect in the '.create' ops
implementation function named hns3_flow_create.

This patch fixes it by replacing memcpy with hns3_rss_conf_copy function to
store the RSS information in the hns3_flow_create.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 05cc95e..2cdfb68 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1839,8 +1839,8 @@ hns3_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 			ret = -ENOMEM;
 			goto err;
 		}
-		memcpy(&rss_filter_ptr->filter_info, rss_conf,
-			sizeof(struct hns3_rss_conf));
+		hns3_rss_conf_copy(&rss_filter_ptr->filter_info,
+				   &rss_conf->conf);
 		rss_filter_ptr->filter_info.valid = true;
 		TAILQ_INSERT_TAIL(&process_list->filter_rss_list,
 				  rss_filter_ptr, entries);
-- 
2.9.5