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 66DAD41D44 for ; Mon, 27 Feb 2023 08:12:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 625C040A84; Mon, 27 Feb 2023 08:12:34 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2047.outbound.protection.outlook.com [40.107.220.47]) by mails.dpdk.org (Postfix) with ESMTP id 7CD70410FB for ; Mon, 27 Feb 2023 08:12:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LEcV6OuAS4Jjp68Hn/2dFdOG1pmE/n1SnqtniTBb2FBVy14HCjoBNsOsJpnZhLXXqcQ2q3yAGCixguUv0cReeH7C8Z7rRXzdTB/ZuVGalmb9mJ9weVLIwvTr0at8Gtih8aFQ1NF6v0U/pJs97SxInID912aWGOtNsL09uYPUNRUwmQMccta0E5dCxBs6dzmnr/0Ow9aVKIEHP5tQBz0vaOE4M17jdEjv1bL3+4nASY/GeJbnDl3EEeFFlU6qrhbGigqOgxU/4ZgSBJ0MFXBNfbJ+uNlsP7+zySmClnrtR1EwE5Ow2GZg+FoD7wzeha+DztX3gij1gMTgWP2Q6ekisA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T6U+7oCIhVAOsY0grVU9r5hnVTLKzQ+78YoB6qj/skg=; b=kp1GUCvCwq39/wjDyo2zLpCht4RjW2NX0kNXDduVxHe5Di5jnh8xdys2244N1eCs0DtGxOoKM0euMJjiS2gBrdi7Ztk5RnAfjfy5ZE2rQELwXr3RVaO74BdXUfxwvOqqMnlGmZjLRImcDEtOdf/3r/bwbIomwYNImQuRhaTHQShRRZE2KckHww9b4KMTMR0ktXBLqqF01BwODPwoJRr6lHm/ty621b9SXfw5gC3uwlMWXXUZLAFpcE10gdTF6/+1j9XuUj7Exh6zoINvbPueM6KDxjqyb11oDR4ulf1P2JB5K9L7kyvFCR206XnD/GPMopj/YyPhjqCiuWNri62JAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=huawei.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T6U+7oCIhVAOsY0grVU9r5hnVTLKzQ+78YoB6qj/skg=; b=FMO+fleJ+lx8ZiWHXzkfU0fLdmXwi6jhOfeStvCVdqDQfI5PsFlM4OCQhzskjgac+Um6sY+ADcd+RQXfw5KKqGaarNbrsH525z9dfijdA6QoshvPZss9xmSMeW3x6tFbVCQPhsI4OH0UvzzlcHWaGNNb/XVZdozdNK3QqO4Rs/NEYFb1pAT6fUG6uXWMQBunLQyjqlobQelTVaMnJFp7p83YAXuypqqYG4gswTCOs7JRgiTPFLYONmiO3kb3RF6FMQ/uPegahF93Gsbjo7CNrE1LyCvMf7/AnY0o0VV2pjGauskp3DWz+goX3+NBmA79RYDjMxm2k3LXpGQUVt9zTQ== Received: from BN6PR17CA0039.namprd17.prod.outlook.com (2603:10b6:405:75::28) by DS0PR12MB8293.namprd12.prod.outlook.com (2603:10b6:8:f3::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.26; Mon, 27 Feb 2023 07:12:30 +0000 Received: from BL02EPF00010209.namprd05.prod.outlook.com (2603:10b6:405:75:cafe::7) by BN6PR17CA0039.outlook.office365.com (2603:10b6:405:75::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:12:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF00010209.mail.protection.outlook.com (10.167.241.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Mon, 27 Feb 2023 07:12:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 26 Feb 2023 23:12:15 -0800 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 26 Feb 2023 23:12:13 -0800 From: Xueming Li To: Huisong Li CC: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: fix config struct used for conversion' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 15:00:12 +0800 Message-ID: <20230227070107.15664-104-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00010209:EE_|DS0PR12MB8293:EE_ X-MS-Office365-Filtering-Correlation-Id: a1a0c7b6-0ba4-4eb3-34ad-08db1891fd66 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NFLk8E1OYQmJewgf1Hyi/YGKtuyFKQQnFT8Sjc6f5dmLWfrC1otdivyPs7Eh4HHZAgrptx46e9SP7t0v/fxSqop96xJGT9W7pmp1ZC9y2oEEV7YXoqgtQ5qKRigCLO8hHlAyDXRQIW3XhYD2Zahfup/Nh9XqJIYdsCyINoiWxuzpT5bytkFZO/9yT/aMYtMglnU6Eb0KvSfkdiyx/1oY0NkmXoxNirFSK68+CnJcmQj8mrI00pzta14tISA0JPeYYnZYq5uBqg3UQK3ileiAOjjlnnbL7DgT0pl+33qUKIHx12OglsDHz7Nm8/nmuv/426Q6Lw9s6tyy8HUxGahumDpx5XdWj/A4uOyfxrsaDZiehC5tstQOvdclQF0Wlh1L9v9wb+82Fzt5fHBNMNRUDWZu0lOs1n+xtssx5zVigAauB/hJNkzXqrPbzgtOHOCTWbzWiWwsSYbLzSOZ8jTYexq5CvVBtdFAT8wrN5KufLMD0UpXvk+1knJ4+ttQft6i89ggR8reLqv2nT2VV+JMkn1zlxI+g7JVklJPwK0ylMPKgpAjf5NXuLmTNbNLdNeJJhble39TjnI3Mud63+60RpI22O7KxPc3W2WCbyusudaaJs/D4amf0KgRFua3UGgm/J679rKc/gxT/opAeZmFwmtYz281VnceXTS9DHhSP7/i0s6WqjmAvJwSzbNiVAKcxWlbYGSFAXJBBEqIRk2Bf7mBXbCWk63JDdV/NPF3yoiak9ZFoOVz6ycFZmQP9QtdvlX2X4BgTAt9ilYhEHkYvQ== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(396003)(39860400002)(136003)(346002)(376002)(451199018)(46966006)(36840700001)(40470700004)(40460700003)(6286002)(16526019)(7636003)(82740400003)(70206006)(6916009)(8936002)(70586007)(41300700001)(36860700001)(2906002)(5660300002)(55016003)(40480700001)(336012)(53546011)(1076003)(478600001)(426003)(2616005)(8676002)(356005)(4326008)(186003)(7696005)(26005)(47076005)(966005)(86362001)(83380400001)(316002)(36756003)(82310400005)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:12:30.1684 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1a0c7b6-0ba4-4eb3-34ad-08db1891fd66 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00010209.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8293 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 22.11.2 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/01/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=5c129d88989ba3c08c0a34d9145a11e0e31cf588 Thanks. Xueming Li --- >From 5c129d88989ba3c08c0a34d9145a11e0e31cf588 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 Cc: Xueming Li [ 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 fbc38dd3d4..a30b19cfdb 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -95,8 +95,8 @@ static const struct rte_flow_action * 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; for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) { @@ -115,8 +115,8 @@ 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 * queue region configuration. @@ -1296,30 +1296,6 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, sizeof(*with->queue) * with->queue_num)); } -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, const struct rte_flow_action_rss *rss) @@ -1733,9 +1709,10 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, struct rte_flow *flow) { 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; rss_filter_ptr = rte_zmalloc("hns3 rss filter", @@ -1745,19 +1722,27 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, return -ENOMEM; } - /* - * 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.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:44.249532800 +0800 +++ 0105-net-hns3-fix-config-struct-used-for-conversion.patch 2023-02-27 14:08:40.849237000 +0800 @@ -1 +1 @@ -From 815c7db53167f7ee1573dca18fa7f889e44764d4 Mon Sep 17 00:00:00 2001 +From 5c129d88989ba3c08c0a34d9145a11e0e31cf588 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 815c7db53167f7ee1573dca18fa7f889e44764d4 ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index 632247b846..dd762c02cb 100644 +index fbc38dd3d4..a30b19cfdb 100644