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 D1F5D46BAE for ; Fri, 18 Jul 2025 21:38:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA3E840E42; Fri, 18 Jul 2025 21:38:07 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 1F47E40B8F for ; Fri, 18 Jul 2025 21:38:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752867486; 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=EbIb1w2lu7wGtt2/k5/JY3mMdHQifpfMOnlveTlBRuA=; b=G6w7dUL8odgTFnpIQP9oaTws+b4RLb4Hk1ONzs9cTEmSgfJvtCEdulzo9Q+yJFzuEiOECR /VkZgOy+RYt+b8pyoXwXI/KM7sRtIjVRAD1yfltxhShD3okD4FaAvQZ8F5VVjhWMZlyaek 2pl/zOeYi/LVbuRS5VL7P2HGwOWBLpo= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-22-fDZ6FtN_Mnas66hgaNdr1w-1; Fri, 18 Jul 2025 15:38:05 -0400 X-MC-Unique: fDZ6FtN_Mnas66hgaNdr1w-1 X-Mimecast-MFC-AGG-ID: fDZ6FtN_Mnas66hgaNdr1w_1752867484 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4DBC41956089; Fri, 18 Jul 2025 19:38:04 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.40]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B90F318003FC; Fri, 18 Jul 2025 19:38:02 +0000 (UTC) From: Kevin Traynor To: Chengwen Feng Cc: Dengdui Huang , dpdk stable Subject: patch 'net/hns3: fix queue TC configuration on VF' has been queued to stable release 24.11.3 Date: Fri, 18 Jul 2025 20:31:24 +0100 Message-ID: <20250718193247.1008129-150-ktraynor@redhat.com> In-Reply-To: <20250718193247.1008129-1-ktraynor@redhat.com> References: <20250718193247.1008129-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 25O5co22wwRQTkpHPpWItCvahxhzP891e-Vzx7QCVu0_1752867484 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 24.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/23/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://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/362128b06fd312ae99e7566befda20da52f976ba Thanks. Kevin --- >From 362128b06fd312ae99e7566befda20da52f976ba 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 [ 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 @@ -179,4 +179,5 @@ 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, @@ -971,4 +972,11 @@ struct hns3_reset_tqp_queue_cmd { }; +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 diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index bfe4c0fa2e..8680e76797 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1176,10 +1176,12 @@ hns3_init_txq(struct hns3_tx_queue *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++) { @@ -1196,7 +1198,22 @@ hns3_init_tx_ring_tc(struct hns3_adapter *hns) 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; } @@ -1274,7 +1291,6 @@ hns3_init_tx_queues(struct hns3_adapter *hns) hns3_init_txq(txq); } - hns3_init_tx_ring_tc(hns); - return 0; + return hns3_init_tx_ring_tc(hns); } -- 2.50.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-07-18 20:29:16.254656354 +0100 +++ 0150-net-hns3-fix-queue-TC-configuration-on-VF.patch 2025-07-18 20:29:11.132907950 +0100 @@ -1 +1 @@ -From a542f48bc0ec83c296ae01ad691479c17caf99b5 Mon Sep 17 00:00:00 2001 +From 362128b06fd312ae99e7566befda20da52f976ba Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a542f48bc0ec83c296ae01ad691479c17caf99b5 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -43 +44 @@ -index f9fde3948a..785e06db9c 100644 +index bfe4c0fa2e..8680e76797 100644 @@ -46 +47 @@ -@@ -1181,10 +1181,12 @@ hns3_init_txq(struct hns3_tx_queue *txq) +@@ -1176,10 +1176,12 @@ hns3_init_txq(struct hns3_tx_queue *txq) @@ -61 +62 @@ -@@ -1201,7 +1203,22 @@ hns3_init_tx_ring_tc(struct hns3_adapter *hns) +@@ -1196,7 +1198,22 @@ hns3_init_tx_ring_tc(struct hns3_adapter *hns) @@ -85 +86 @@ -@@ -1279,7 +1296,6 @@ hns3_init_tx_queues(struct hns3_adapter *hns) +@@ -1274,7 +1291,6 @@ hns3_init_tx_queues(struct hns3_adapter *hns)