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 8C52546211 for ; Thu, 13 Feb 2025 11:03:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 814C742F59; Thu, 13 Feb 2025 11:03:52 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 485A942F51 for ; Thu, 13 Feb 2025 11:03:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739441030; 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=ZFOq7U8X5TFUEJzsIJBGuEsHxdrJbGl+piBS+cpRmY4=; b=ehp7DZ2ZCAFEW9tb6KEYZyPpaSF/C8KCjt7cWoeba+uruJ/3uw/axR8e3aAV9EpzWu5CWS 1spzmDna8rzLhP8+9YAq7SQcQ8Q32J1F20v20T+uAJofMc+un2nSTl2oddrIQvkHGayMln z0buzNVjzXYmOhQ79ERceCG3sRz3ZUE= 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-163-F0OLtUTbOhmTCMaZ8pwrIQ-1; Thu, 13 Feb 2025 05:03:46 -0500 X-MC-Unique: F0OLtUTbOhmTCMaZ8pwrIQ-1 X-Mimecast-MFC-AGG-ID: F0OLtUTbOhmTCMaZ8pwrIQ_1739441026 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 EA68F196E078; Thu, 13 Feb 2025 10:03:45 +0000 (UTC) Received: from rh.Home (unknown [10.45.224.21]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A94991800365; Thu, 13 Feb 2025 10:03:43 +0000 (UTC) From: Kevin Traynor To: Dengdui Huang Cc: dpdk stable Subject: patch 'net/hns3: fix reset timeout' has been queued to stable release 24.11.2 Date: Thu, 13 Feb 2025 09:59:11 +0000 Message-ID: <20250213095933.362078-104-ktraynor@redhat.com> In-Reply-To: <20250213095933.362078-1-ktraynor@redhat.com> References: <20250213095933.362078-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: xYFDEwusmPH0ISzi-646WufsA7wCY1TdIdsVbOXprrc_1739441026 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.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 02/17/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/cd5ba7e5d643d8502865e271b407478a291f4d65 Thanks. Kevin --- >From cd5ba7e5d643d8502865e271b407478a291f4d65 Mon Sep 17 00:00:00 2001 From: Dengdui Huang Date: Mon, 10 Feb 2025 11:01:13 +0800 Subject: [PATCH] net/hns3: fix reset timeout [ upstream commit 9f7c28c5e98062576dfbf555cd5ede7e33d6624b ] There is low probability that the driver reset timeout, the root cause is that the firmware processing take a litter long than normal when process reset command. This patch fix it by changing the timeout of the reset command to 100 ms. Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware") Signed-off-by: Dengdui Huang --- drivers/net/hns3/hns3_cmd.c | 18 ++++++++++++------ drivers/net/hns3/hns3_cmd.h | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c index 146444e2fa..398b75384e 100644 --- a/drivers/net/hns3/hns3_cmd.c +++ b/drivers/net/hns3/hns3_cmd.c @@ -305,6 +305,15 @@ hns3_cmd_get_hardware_reply(struct hns3_hw *hw, } -static int hns3_cmd_poll_reply(struct hns3_hw *hw) +static uint32_t hns3_get_cmd_tx_timeout(uint16_t opcode) { + if (opcode == HNS3_OPC_CFG_RST_TRIGGER) + return HNS3_COMQ_CFG_RST_TIMEOUT; + + return HNS3_CMDQ_TX_TIMEOUT_DEFAULT; +} + +static int hns3_cmd_poll_reply(struct hns3_hw *hw, uint16_t opcode) +{ + uint32_t cmdq_tx_timeout = hns3_get_cmd_tx_timeout(opcode); struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); uint32_t timeout = 0; @@ -327,5 +336,5 @@ static int hns3_cmd_poll_reply(struct hns3_hw *hw) rte_delay_us(1); timeout++; - } while (timeout < hw->cmq.tx_timeout); + } while (timeout < cmdq_tx_timeout); hns3_err(hw, "Wait for reply timeout"); return -ETIME; @@ -401,5 +410,5 @@ hns3_cmd_send(struct hns3_hw *hw, struct hns3_cmd_desc *desc, int num) */ if (HNS3_CMD_SEND_SYNC(rte_le_to_cpu_16(desc->flag))) { - retval = hns3_cmd_poll_reply(hw); + retval = hns3_cmd_poll_reply(hw, desc->opcode); if (!retval) retval = hns3_cmd_get_hardware_reply(hw, desc, num, @@ -612,7 +621,4 @@ hns3_cmd_init_queue(struct hns3_hw *hw) hw->cmq.crq.desc_num = HNS3_NIC_CMQ_DESC_NUM; - /* Setup Tx write back timeout */ - hw->cmq.tx_timeout = HNS3_CMDQ_TX_TIMEOUT; - /* Setup queue rings */ ret = hns3_alloc_cmd_queue(hw, HNS3_TYPE_CSQ); diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h index 79a8c1edad..4d707c13b2 100644 --- a/drivers/net/hns3/hns3_cmd.h +++ b/drivers/net/hns3/hns3_cmd.h @@ -11,5 +11,6 @@ #include -#define HNS3_CMDQ_TX_TIMEOUT 30000 +#define HNS3_CMDQ_TX_TIMEOUT_DEFAULT 30000 +#define HNS3_COMQ_CFG_RST_TIMEOUT 100000 #define HNS3_CMDQ_CLEAR_WAIT_TIME 200 #define HNS3_CMDQ_RX_INVLD_B 0 @@ -63,5 +64,4 @@ struct hns3_cmq { struct hns3_cmq_ring csq; struct hns3_cmq_ring crq; - uint16_t tx_timeout; enum hns3_cmd_return_status last_status; }; -- 2.48.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-02-12 17:29:45.526464387 +0000 +++ 0104-net-hns3-fix-reset-timeout.patch 2025-02-12 17:29:34.613947499 +0000 @@ -1 +1 @@ -From 9f7c28c5e98062576dfbf555cd5ede7e33d6624b Mon Sep 17 00:00:00 2001 +From cd5ba7e5d643d8502865e271b407478a291f4d65 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9f7c28c5e98062576dfbf555cd5ede7e33d6624b ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org