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 9962046C4D for ; Wed, 30 Jul 2025 09:14:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9498D4025E; Wed, 30 Jul 2025 09:14:03 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2042.outbound.protection.outlook.com [40.107.237.42]) by mails.dpdk.org (Postfix) with ESMTP id D95DB4025E for ; Wed, 30 Jul 2025 09:14:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Fdi/wy6qoZDt56SygyrkjdrDufIY3XBT8SMTphwbMpbNxPCtw8LEw9o/DQ4LJIiVcB16i09kJNZxeFbv7Lsk92QzHZk0aA0ePRiL6sc/Itb08lGTgLS/VQOsa5C7LVw7zMr+EUYW61To0Zh9xGJ+Ou3UviRS0p+A5X2StJpjVKJ/l9MUH2/kI0ZUjtNbt7uo0g3c/n/x3AYH8Gf2VJLs+A81GuAJf38gWxJbI5GXY6+ZVHZo3MhCqi4GvQ2CZsw0t4Ynf8WpSLuFpQVKiBsiUJbj37nA7USwB2EX0/xP4iXDvMouUAYi+K4W7MfVxQ7NJ8ACURkihcbJtBD9evHXSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5vUPAD1WEkCaDSpXOTjVYoQNiT9/+JobMjv+fWe9fwY=; b=s9EiXjNNen4U3bdIpVnWxRuthIU034FoxjTGrdKi1EDDf5/FNxBhMDE1lchcsPcLNaAL8y5zV98REyjg1eqDBCXUkDyz/gLKoRgZbmSLt8+C9gpL873TAlIDz1lcOjvjKLofUglOYDPd8jYP2l8rfqUi+JiUr3G39O0AVW3S0DeJQHh+GmgE8M+PiPYyfR1NY2kTdFtH2Z2hEBS0gsPQ+1uTDlheJ2/pdaVQcoA2Yq86SKoZzmi/P2Joq/D7Z/fPAsoQGO1k5/KTYS2utmzycXduolR3z1r3VU1F45LheELqsRHsYZ47dL3faDZfpiVWOWfj0nUjtd/zUc+fEpuFwg== 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 (0) 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=5vUPAD1WEkCaDSpXOTjVYoQNiT9/+JobMjv+fWe9fwY=; b=IFlt1P2/eIKs+xEJQ6FYNptvetPqaFWdy02QGYaVHh+Ob6hAtWcXfxF2nF+ijopQFGajQzOVCs+DoVqyhzfhArq4vJ3bRcVPPggIpM2+XiO/0JHCC2KNDc6hCfVk34HAoAe6E8Ho/ZBbfwqwwSFY4igM6+b80j28hcFOrYnKR91wv6E4cHaU+ZR66MAj0WYsZRGtx3g/P4GiYwQMmO6uSweg57HPeOB8hXqx+XR9QmMFXlvNq5FlPB4ALTluTiGGjqa4w8VJrxqDm+WNj6dIaiz738rgTj+st3G1eDzbgT/g7Kd2sZ2f3XCqbYzJXTY5EzVGSDHpJTehNXULQcu5tA== Received: from SJ0PR03CA0106.namprd03.prod.outlook.com (2603:10b6:a03:333::21) by SJ2PR12MB9242.namprd12.prod.outlook.com (2603:10b6:a03:56f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.26; Wed, 30 Jul 2025 07:13:58 +0000 Received: from BY1PEPF0001AE1B.namprd04.prod.outlook.com (2603:10b6:a03:333:cafe::26) by SJ0PR03CA0106.outlook.office365.com (2603:10b6:a03:333::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8964.22 via Frontend Transport; Wed, 30 Jul 2025 07:13:58 +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 BY1PEPF0001AE1B.mail.protection.outlook.com (10.167.242.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.10 via Frontend Transport; Wed, 30 Jul 2025 07:13:57 +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.1544.14; Wed, 30 Jul 2025 00:13:39 -0700 Received: from nvidia.com (10.126.231.35) 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.1544.14; Wed, 30 Jul 2025 00:13:37 -0700 From: Xueming Li To: Chengwen Feng CC: Xueming Li , Dengdui Huang , dpdk stable Subject: patch 'net/hns3: fix queue TC configuration on VF' has been queued to stable release 23.11.5 Date: Wed, 30 Jul 2025 15:10:36 +0800 Message-ID: <20250730071045.136672-26-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250730071045.136672-1-xuemingl@nvidia.com> References: <20250626120145.27369-1-xuemingl@nvidia.com> <20250730071045.136672-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] 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: BY1PEPF0001AE1B:EE_|SJ2PR12MB9242:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c10343e-8254-488e-eec9-08ddcf38a681 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700013|1800799024|13003099007|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jbxQJV7l6m6D2teGpejoLes81SLiDtWMXr10Fy0wdAsuX5vvIsnQArYxkSqD?= =?us-ascii?Q?I6SksR6WomIXh9EtDVGJLDxtmZwJIbvS07i+cVvXSSlSAxQaN3OFaSsTzmfi?= =?us-ascii?Q?nwqtCRcbmRGnfAJvq/JjuYvC/N0It5AbJ9dCKGPvtF2Ai2njr6fSrimTr97J?= =?us-ascii?Q?ZRE2j+WTVlwtbV85UVkGYeuth8qQDOg+1fl5mixr/Qob0qHLn+V2rPbdDPl4?= =?us-ascii?Q?lf4Gmvgm/7TekJysUUjf0nrSj8Lj1trkwg6o/MYBxul0/+1a9KJo/+YvVbVI?= =?us-ascii?Q?yNBmd5QbV8obSBwu46BbHofLmxIRGDNtVmmlbaAOuFfiEsX0JTKPoWxkXW0R?= =?us-ascii?Q?4phrc1C3+8Fv1kIGtUdaOCa4+mlpDZGy+6huyo8NAvJszFRppHHPCYzGqG31?= =?us-ascii?Q?nMKB7cp5mv3OTBJ1wOpQ32OEtLFzRxROuVRO3Nl/8wWKOvY4a9xgZlS02tvy?= =?us-ascii?Q?pX1vQIMgvMpB5sUVqPR4abf4pQjgR8MaJacWlTTLYviOj56a8Xv6U1FhE1jm?= =?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2jnAXElLvvVOMoz9yj9vRXnwgdPOQold3dqpCiq?= =?us-ascii?Q?QU6bpyhY2KTlcBLzlzAWxtvoNUmjBB3HatE0WFwTN4qmy1XNx3lcgUYwaFGx?= =?us-ascii?Q?0jm2yJE2rfnGysgTqcD93091qkbXGuvlVB2+20wRb7RcTqyVQSokaB9YMg?= =?us-ascii?Q?=3D=3D?= 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:(13230040)(82310400026)(376014)(36860700013)(1800799024)(13003099007)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2025 07:13:57.3402 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7c10343e-8254-488e-eec9-08ddcf38a681 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: BY1PEPF0001AE1B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9242 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 23.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/10/25. 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=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b51cd2bb2959e35393215732b6a8ea7659634d72 Thanks. Xueming Li --- >From b51cd2bb2959e35393215732b6a8ea7659634d72 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Tue, 1 Jul 2025 17:09:59 +0800 Subject: [PATCH] net/hns3: fix queue TC configuration on VF Cc: Xueming Li [ upstream commit a542f48bc0ec83c296ae01ad691479c17caf99b5 ] The VF cannot configure the mapping of queue to TC by directly writing the register. Instead, the mapping must be modified by using firmware command. Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") Signed-off-by: Chengwen Feng Signed-off-by: Dengdui Huang --- drivers/net/hns3/hns3_cmd.h | 8 ++++++++ drivers/net/hns3/hns3_rxtx.c | 26 +++++++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h index 4d707c13b2..e21a2b652f 100644 --- a/drivers/net/hns3/hns3_cmd.h +++ b/drivers/net/hns3/hns3_cmd.h @@ -178,6 +178,7 @@ enum hns3_opcode_type { /* TQP commands */ HNS3_OPC_QUERY_TX_STATUS = 0x0B03, + HNS3_OPC_TQP_TX_QUEUE_TC = 0x0B04, HNS3_OPC_QUERY_RX_STATUS = 0x0B13, HNS3_OPC_CFG_COM_TQP_QUEUE = 0x0B20, HNS3_OPC_RESET_TQP_QUEUE = 0x0B22, @@ -970,6 +971,13 @@ struct hns3_reset_tqp_queue_cmd { uint8_t rsv[19]; }; +struct hns3vf_tx_ring_tc_cmd { + uint16_t tqp_id; + uint16_t rsv1; + uint8_t tc_id; + uint8_t rsv2[19]; +}; + #define HNS3_CFG_RESET_MAC_B 3 #define HNS3_CFG_RESET_FUNC_B 7 #define HNS3_CFG_RESET_RCB_B 1 diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index 9c0d4b4cd4..909f69fbfe 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1176,12 +1176,14 @@ hns3_init_txq(struct hns3_tx_queue *txq) hns3_init_tx_queue_hw(txq); } -static void +static int hns3_init_tx_ring_tc(struct hns3_adapter *hns) { + struct hns3_cmd_desc desc; + struct hns3vf_tx_ring_tc_cmd *req = (struct hns3vf_tx_ring_tc_cmd *)desc.data; struct hns3_hw *hw = &hns->hw; struct hns3_tx_queue *txq; - int i, num; + int i, num, ret; for (i = 0; i < HNS3_MAX_TC_NUM; i++) { struct hns3_tc_queue_info *tc_queue = &hw->tc_queue[i]; @@ -1196,9 +1198,24 @@ hns3_init_tx_ring_tc(struct hns3_adapter *hns) if (txq == NULL) continue; - hns3_write_dev(txq, HNS3_RING_TX_TC_REG, tc_queue->tc); + if (!hns->is_vf) { + hns3_write_dev(txq, HNS3_RING_TX_TC_REG, tc_queue->tc); + continue; + } + + hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_TQP_TX_QUEUE_TC, false); + req->tqp_id = rte_cpu_to_le_16(num); + req->tc_id = tc_queue->tc; + ret = hns3_cmd_send(hw, &desc, 1); + if (ret != 0) { + hns3_err(hw, "config Tx queue (%u)'s TC failed! ret = %d.", + num, ret); + return ret; + } } } + + return 0; } static int @@ -1274,9 +1291,8 @@ hns3_init_tx_queues(struct hns3_adapter *hns) txq = (struct hns3_tx_queue *)hw->fkq_data.tx_queues[i]; hns3_init_txq(txq); } - hns3_init_tx_ring_tc(hns); - return 0; + return hns3_init_tx_ring_tc(hns); } /* -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-07-30 15:02:13.527121798 +0800 +++ 0025-net-hns3-fix-queue-TC-configuration-on-VF.patch 2025-07-30 15:02:12.830853514 +0800 @@ -1 +1 @@ -From a542f48bc0ec83c296ae01ad691479c17caf99b5 Mon Sep 17 00:00:00 2001 +From b51cd2bb2959e35393215732b6a8ea7659634d72 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit a542f48bc0ec83c296ae01ad691479c17caf99b5 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -47 +49 @@ -index f9fde3948a..785e06db9c 100644 +index 9c0d4b4cd4..909f69fbfe 100644 @@ -50 +52 @@ -@@ -1180,12 +1180,14 @@ hns3_init_txq(struct hns3_tx_queue *txq) +@@ -1176,12 +1176,14 @@ hns3_init_txq(struct hns3_tx_queue *txq) @@ -67 +69 @@ -@@ -1200,9 +1202,24 @@ hns3_init_tx_ring_tc(struct hns3_adapter *hns) +@@ -1196,9 +1198,24 @@ hns3_init_tx_ring_tc(struct hns3_adapter *hns) @@ -93 +95 @@ -@@ -1278,9 +1295,8 @@ hns3_init_tx_queues(struct hns3_adapter *hns) +@@ -1274,9 +1291,8 @@ hns3_init_tx_queues(struct hns3_adapter *hns)