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 E4DD6428F8 for ; Sun, 9 Apr 2023 17:32:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA80541149; Sun, 9 Apr 2023 17:32:21 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2074.outbound.protection.outlook.com [40.107.220.74]) by mails.dpdk.org (Postfix) with ESMTP id C2831410EE for ; Sun, 9 Apr 2023 17:32:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bDgU7nQ58LHAG9CwWKmLyKexvg/u6Y82+G6P4bKUOn5Jzy+7E8ahQoQVGq0Ews4vf2FN00IUzG5TnFudvpmLgJ+x0VGtsURL5VBe9YzqGmXbF9lLR7wXoHkkJDqcfrklJzU4CkpxLWWYnFY0pMEHxMaPtxnvUP4joATSa7bylkmNWb+ADpbOtR4dGdtqNLYGIhRZy/z0c8ajugn8JaXnp4TBoLPaWiYwPYAvkJKyh3aoAQTtRDVs07W6Kto3FOJyyiV3cmO0SbIU1UlsuiSAms+816F2yMkw7Av/+omwYmF5Hv2q/gY0NA1eSw2Kgk+qPRShtK1KnyBwdqGPGqftmw== 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=wcW/po5q9+XRxcUtW73iUw5yoItagN5t+4Qt8XVtpUo=; b=KeTjrkgNoJ1OfFtWsKDC7WVrL8ogWTKgzLOb8XG2X3ZIW/DfWhH+wftYsZb+umBpQYycxifN1xwbHWDb1p2VrqAWuAd8RkRXzrojjiTUNMZlx4Tgm8oEr5Ak/TbbJ7cJ1j/kxVdzOD8TzkPAxdhnCeF+VZVutGGpV23KLzODONpH4bFPibswdJFv1BfJIFTnd1X+QsiKY6YpHlOyCyhS6NBs6vhBvwokqpBIwKNapo1AAIVUqjYYggrQ7vdHlxWMcWzxQ27qb8qRnwPAuZ7ChhBpqcTiDiXrJP8vtJYcLrbGuxWR2jlV/0nhSPwl1x5RqM4W/4ZLRUEmm7k48FzV4g== 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=wcW/po5q9+XRxcUtW73iUw5yoItagN5t+4Qt8XVtpUo=; b=uQ2hEu+Wf/r0eXcos8YAZwwkfS5TPCWL1i8BvlkYgTHg0kHA8etm3c2DtUxdE0ZJF1ljPSVb3kusRp69B9wCI8wA4JSf9rCra4kmHOja55W3WVNEr/vkS847sQ5VCuazhFN/nLkOn/mr8MtL5j0hQ19NmKAb+WQ9WIZr9S5TjFsHXrFcXoPTFImx7i71wjM5R7K0OmHTLEVp8QgH/G8h5/Nq+TqtWdLLJGJxUICYyDaRxBWRfVQ+5QBm0SXv8628UmSTUE70FGrFHRKB4ojIlfy0kr4Mhbfg2D17Cjx/sn9lOfxLSHwkR4+8poca18a3M+TUNhbHqRbujgIwaB8gLg== Received: from MW4P220CA0017.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::22) by PH7PR12MB7282.namprd12.prod.outlook.com (2603:10b6:510:209::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.34; Sun, 9 Apr 2023 15:32:18 +0000 Received: from CO1NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:303:115:cafe::64) by MW4P220CA0017.outlook.office365.com (2603:10b6:303:115::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36 via Frontend Transport; Sun, 9 Apr 2023 15:32:18 +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 CO1NAM11FT004.mail.protection.outlook.com (10.13.175.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.24 via Frontend Transport; Sun, 9 Apr 2023 15:32:17 +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.5; Sun, 9 Apr 2023 08:32:10 -0700 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, 9 Apr 2023 08:32:08 -0700 From: Xueming Li To: Huisong Li CC: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: use hardware config to report redirection table' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:24:24 +0800 Message-ID: <20230409152529.5308-77-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-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: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT004:EE_|PH7PR12MB7282:EE_ X-MS-Office365-Filtering-Correlation-Id: e675b4be-01ea-4b42-9bb0-08db390f9a0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M2epx+/OQm5t7gkkvcIB7OiL3+x1mRpMQSEl3d/ZNp4bK9hpX7IqjJzsZHAmkq00bMCmXcVQpMm1EgRmV3NOv/Z7x73xvZ8REVy2Dc81/1Mr6wNVa4qTRhKYEdmK1wWyonuiRgd8Pd23Jncnu/uFD5pV/lFYCns9gvgWpbyHsHz0V4/wAPbKPoWFicwGkSllwT9OtrCYPvPJsXooHvIM6ZcpkX/L/Zi9oIBUAixrsA4d6HzguyFsx8GNPAAgbJFOGd0B27wdphAmquw6u5gMpyZPwfRfatoMzEaBtXX7mJprYNhky9DRPxDwNAK4Wwf5XNQmCY4Z/7/A9MuBZ9RFSEgILUONLEogDlFixHn5BYmGYZ/BlwQeGCLY8NoWyPdbfRwOb/j6ys5RLUPEk1qcstWemnfrmIcwbqSplUFtaZLKQfUWxLJjaw6+uOO/viT0pFvv5id9u9LyaNtz+m5ZtzeNBCi9esVOPivf9jsvuWQiViIt2LrWABnZlBXarWGrMy6ncP0J+7taOJTK6GPxLPndO8HR9M/W6AdDvoFNt1IoG6Ch74sa4Zrp8ZlDnasWhYOg5TI3ZfApTMaMRxLceFUWzb1BQ27i+MK3blev+8FrcQ2ugreQJACFMFpQJ5vkxz5uSwmgTwTbUpx9H7SshF7iGe0Kv6z1YaDNT6GDCvfef17B9w8SsJZd/z/4+btYTOxNg2KpJw/2rK6sB6J4S2zfKpEA5dTibHe8XBpJNNqd3OEn8rK8hnEUXnq44YcxNRyLnwarQETT2VOEtOsGwHq1pcLdr3D9+2KNwERhkLDHCVyfQ2qdiXDr5T5DMySAcPqm+EN60oSWe47danQ8LQ== 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:(13230028)(4636009)(346002)(136003)(39860400002)(376002)(396003)(451199021)(46966006)(36840700001)(40470700004)(86362001)(36756003)(316002)(41300700001)(70586007)(8676002)(4326008)(6916009)(966005)(7696005)(70206006)(54906003)(478600001)(40480700001)(55016003)(82310400005)(5660300002)(2906002)(8936002)(36860700001)(82740400003)(356005)(7636003)(16526019)(6286002)(186003)(6666004)(53546011)(1076003)(26005)(336012)(2616005)(426003)(47076005)(83380400001)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:32:17.4126 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e675b4be-01ea-4b42-9bb0-08db390f9a0f 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: CO1NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7282 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 04/11/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/log/?h=22.11-staging/commit/dde9ec15ea0e5461c9c2fb00e397d62a1e45a6f8 Thanks. Xueming Li --- >From dde9ec15ea0e5461c9c2fb00e397d62a1e45a6f8 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Fri, 10 Mar 2023 17:35:07 +0800 Subject: [PATCH] net/hns3: use hardware config to report redirection table Cc: Xueming Li [ upstream commit d1e37d1c6916858314a2c67e6317b0bb6c691b36 ] Currently, reta_query() API reports the redirection table from software. This patch uses the one in hardware to report. Fixes: c37ca66f2b27 ("net/hns3: support RSS") Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_cmd.h | 1 + drivers/net/hns3/hns3_rss.c | 65 ++++++++++++++++++++++++++++++++++--- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h index 994dfc48cc..eb394c9dec 100644 --- a/drivers/net/hns3/hns3_cmd.h +++ b/drivers/net/hns3/hns3_cmd.h @@ -606,6 +606,7 @@ struct hns3_rss_input_tuple_cmd { #define HNS3_RSS_CFG_TBL_SIZE_H 4 #define HNS3_RSS_CFG_TBL_BW_H 2 #define HNS3_RSS_CFG_TBL_BW_L 8 +#define HNS3_RSS_CFG_TBL_BW_H_M 0x3 /* Configure the indirection table, opcode:0x0D07 */ struct hns3_rss_indirection_table_cmd { diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c index 9addc00a67..7dc4e03d83 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c @@ -481,6 +481,54 @@ hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size) return 0; } +static int +hns3_get_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size) +{ + struct hns3_rss_indirection_table_cmd *req; + uint16_t max_bd_num, cfg_tbl_size; + uint8_t qid_msb_off, qid_msb_idx; + struct hns3_cmd_desc desc; + uint16_t q_id, q_hi, q_lo; + uint8_t rss_result_h; + uint16_t i, j; + int ret; + + req = (struct hns3_rss_indirection_table_cmd *)desc.data; + max_bd_num = DIV_ROUND_UP(size, HNS3_RSS_CFG_TBL_SIZE); + for (i = 0; i < max_bd_num; i++) { + hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INDIR_TABLE, + true); + req->start_table_index = + rte_cpu_to_le_16(i * HNS3_RSS_CFG_TBL_SIZE); + ret = hns3_cmd_send(hw, &desc, 1); + if (ret) { + hns3_err(hw, "fail to get RSS indirection table from firmware, ret = %d", + ret); + return ret; + } + + if (i == max_bd_num - 1 && (size % HNS3_RSS_CFG_TBL_SIZE) != 0) + cfg_tbl_size = size % HNS3_RSS_CFG_TBL_SIZE; + else + cfg_tbl_size = HNS3_RSS_CFG_TBL_SIZE; + + for (j = 0; j < cfg_tbl_size; j++) { + qid_msb_idx = + j * HNS3_RSS_CFG_TBL_BW_H / HNS3_BITS_PER_BYTE; + rss_result_h = req->rss_result_h[qid_msb_idx]; + qid_msb_off = + j * HNS3_RSS_CFG_TBL_BW_H % HNS3_BITS_PER_BYTE; + q_hi = (rss_result_h >> qid_msb_off) & + HNS3_RSS_CFG_TBL_BW_H_M; + q_lo = req->rss_result_l[j]; + q_id = (q_hi << HNS3_RSS_CFG_TBL_BW_L) | q_lo; + indir[i * HNS3_RSS_CFG_TBL_SIZE + j] = q_id; + } + } + + return 0; +} + int hns3_rss_reset_indir_table(struct hns3_hw *hw) { @@ -842,10 +890,11 @@ hns3_dev_rss_reta_query(struct rte_eth_dev *dev, uint16_t reta_size) { struct hns3_adapter *hns = dev->data->dev_private; + uint16_t reta_table[HNS3_RSS_IND_TBL_SIZE_MAX]; struct hns3_hw *hw = &hns->hw; - struct hns3_rss_conf *rss_cfg = &hw->rss_info; uint16_t idx, shift; uint16_t i; + int ret; if (reta_size != hw->rss_ind_tbl_size) { hns3_err(hw, "The size of hash lookup table configured (%u)" @@ -854,14 +903,22 @@ hns3_dev_rss_reta_query(struct rte_eth_dev *dev, return -EINVAL; } rte_spinlock_lock(&hw->lock); + ret = hns3_get_rss_indir_table(hw, reta_table, reta_size); + if (ret != 0) { + rte_spinlock_unlock(&hw->lock); + hns3_err(hw, "query RSS redirection table failed, ret = %d.", + ret); + return ret; + } + rte_spinlock_unlock(&hw->lock); + for (i = 0; i < reta_size; i++) { idx = i / RTE_ETH_RETA_GROUP_SIZE; shift = i % RTE_ETH_RETA_GROUP_SIZE; if (reta_conf[idx].mask & (1ULL << shift)) - reta_conf[idx].reta[shift] = - rss_cfg->rss_indirection_tbl[i]; + reta_conf[idx].reta[shift] = reta_table[i]; } - rte_spinlock_unlock(&hw->lock); + return 0; } -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:40.729985800 +0800 +++ 0076-net-hns3-use-hardware-config-to-report-redirection-t.patch 2023-04-09 21:45:38.689042200 +0800 @@ -1 +1 @@ -From d1e37d1c6916858314a2c67e6317b0bb6c691b36 Mon Sep 17 00:00:00 2001 +From dde9ec15ea0e5461c9c2fb00e397d62a1e45a6f8 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit d1e37d1c6916858314a2c67e6317b0bb6c691b36 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org