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 ADAF14624E for ; Mon, 17 Feb 2025 18:08:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0049400EF; Mon, 17 Feb 2025 18:08:31 +0100 (CET) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by mails.dpdk.org (Postfix) with ESMTP id 0466D400EF for ; Mon, 17 Feb 2025 18:08:30 +0100 (CET) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-30a303a656aso10321661fa.0 for ; Mon, 17 Feb 2025 09:08:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739812109; x=1740416909; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ASaaCJ+rGwz7ovGEgn6s9jqEwMZ8r8fz3KikNVTUoLg=; b=ToI/wtQeZ1/D8PawxsNGsTuvjk6NMIzP+Pz/8po70uQ9WErG6tT4kWzjXlgQDW+mZE VQKGRAiBxs+olc+8UcYJP/zSXM/nLdZgdKboRDRe7UC17AvESnetJBFhmWTfGHQfupCW lMqSlglFdikhmlY/Go366/KsQS8ZSDIYY1lAPgLdbgUdHK/da1LERukT57Av2CRR++kC Rl75VfqowxUs0pLs1Mg/IM13cMLExfAbjfYGkV2rgOXGp8PJtzIG/qgi2HL/0r149t2k /oY1uZlNsS+DccfsKW2Ex0hmZX8+9JhNtax5DiEhB7g/Npjl1dBtbJ/dot+uKyN9PYm3 jFig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739812109; x=1740416909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ASaaCJ+rGwz7ovGEgn6s9jqEwMZ8r8fz3KikNVTUoLg=; b=PJeS15dcNZ89F6REB8ENnwcMEu221aMr0ED3YO6IXxNBRzTdfRF6OwKQAP/JUZUfQ3 ij7v1INL0tDnJ6QkCeKo24d+hly1yvcfcAEBqlZKxBnlomzTFLZeTJ0KN8NJqXCkLkKG 7W0yNbq0EiB9jgtB78rp233NUSRuebSTfoB7FYxD8Sm7aSWpZ/g8tgfVe2HNe/6Jk0iP PCEDjYsfWILpbUbn0Elbjhc9T4KrO3QjVOWUtwf9YKx0BR0Dnsx1YMEQATphIUYJbSAF RqMX8U40THotqdTb/exC9taepd8GAds2dBIt8/P3f/WeevJg5dEvIAQd81QlOhp7J/Lv Qqdg== X-Gm-Message-State: AOJu0YykvXuFqgxc2soUO7aMQ/8inMCclnpslI2DUptMm69QHedsOTUv SUJMiAUcxboN0elivmDbDwVk/EgYid6Sn5XkXQHEpwWgyqOITv9iIjboPPeiA12W+w== X-Gm-Gg: ASbGncvyzuV3VFsry5CJE+X3rvLym2ILqCjYyCJebfvLd+LbzRnl6nlnYSguFyQAWoz Wb5hanSJ+OTOluCh6WSydEHBUsJtr4tvPS5O7KFwV1vvkTB+m7M/naK+mbw41hU99I6jI/jDgvC h1g0KEEHyia9AA4YobsRGVlcIUWc0ltuigYVNcsmW6ttQ+b2wcg7p3YhdYKSPME/CNEFXIOXRXo NfsZTBXhY0j5TMkZ6kU3hBRPH4Cg+X8sKVTKAaC23A/RX7Ci/3ZnG6iC4yMhswHAc3BIFbG0BbD nKS7KccxNwWy1scSvBT15Q== X-Google-Smtp-Source: AGHT+IEI2xC8/bX7seBAZ+9erNgdzR4/gx0a45kJ2YRpaWOJZIn9cEHYE/JTjraOhl1qNH15CoMRew== X-Received: by 2002:adf:ed48:0:b0:38f:2a3e:870c with SMTP id ffacd0b85a97d-38f33f38891mr11190679f8f.16.1739812098597; Mon, 17 Feb 2025 09:08:18 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:f83c:95e7:29fd:a997]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-38f259d8f1csm12913774f8f.69.2025.02.17.09.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 09:08:18 -0800 (PST) From: luca.boccassi@gmail.com To: Dengdui Huang Cc: dpdk stable Subject: patch 'net/hns3: fix reset timeout' has been queued to stable release 22.11.8 Date: Mon, 17 Feb 2025 17:04:35 +0000 Message-ID: <20250217170456.1068278-62-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250217170456.1068278-1-luca.boccassi@gmail.com> References: <20250217170456.1068278-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.8 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/19/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/123786e4ac5f10646fec5018a74cd32725173b84 Thanks. Luca Boccassi --- >From 123786e4ac5f10646fec5018a74cd32725173b84 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 7bdf7740c1..50e135b8e3 100644 --- a/drivers/net/hns3/hns3_cmd.c +++ b/drivers/net/hns3/hns3_cmd.c @@ -304,8 +304,17 @@ hns3_cmd_get_hardware_reply(struct hns3_hw *hw, return hns3_cmd_convert_err_code(desc_ret); } -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; @@ -326,7 +335,7 @@ 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; } @@ -400,7 +409,7 @@ hns3_cmd_send(struct hns3_hw *hw, struct hns3_cmd_desc *desc, int num) * if multi descriptors to be sent, use the first one to check. */ 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, ntc); @@ -605,9 +614,6 @@ hns3_cmd_init_queue(struct hns3_hw *hw) hw->cmq.csq.desc_num = HNS3_NIC_CMQ_DESC_NUM; 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); if (ret) { diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h index 0a4d59bd9b..ae797a7692 100644 --- a/drivers/net/hns3/hns3_cmd.h +++ b/drivers/net/hns3/hns3_cmd.h @@ -10,7 +10,8 @@ #include #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 #define HNS3_CMDQ_RX_OUTVLD_B 1 @@ -62,7 +63,6 @@ enum hns3_cmd_return_status { 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.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-02-17 16:13:19.033936981 +0000 +++ 0062-net-hns3-fix-reset-timeout.patch 2025-02-17 16:13:16.858441592 +0000 @@ -1 +1 @@ -From 9f7c28c5e98062576dfbf555cd5ede7e33d6624b Mon Sep 17 00:00:00 2001 +From 123786e4ac5f10646fec5018a74cd32725173b84 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9f7c28c5e98062576dfbf555cd5ede7e33d6624b ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 146444e2fa..398b75384e 100644 +index 7bdf7740c1..50e135b8e3 100644 @@ -61 +62 @@ -@@ -611,9 +620,6 @@ hns3_cmd_init_queue(struct hns3_hw *hw) +@@ -605,9 +614,6 @@ hns3_cmd_init_queue(struct hns3_hw *hw) @@ -72 +73 @@ -index 79a8c1edad..4d707c13b2 100644 +index 0a4d59bd9b..ae797a7692 100644