Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp264879lqi; Wed, 6 Mar 2024 17:07:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWwLWt3p2v28qSER339miLqcwbPKeIdpwRocuG19+Oz/y2Ahi2G409r9P5lIv2/BsziZljit3ozzrUA988k7vb0vq7Q04n6wdxtPP1tdQ== X-Google-Smtp-Source: AGHT+IEJwK8LVASw6BMar84eBXDtqhWXf/QtsKHL6HtV8B8KbMvHd2YP27N6s+MxtBaKKxZqOgAx X-Received: by 2002:a05:6512:3196:b0:513:40eb:b422 with SMTP id i22-20020a056512319600b0051340ebb422mr600265lfe.34.1709773659280; Wed, 06 Mar 2024 17:07:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709773659; cv=pass; d=google.com; s=arc-20160816; b=keq+OQ8FkudWRfkWYg2YW97iwr1itG025d/XsjZS1WA4XNv8iKg/g4U9LJOjF3t7bB p0xKNyJXtcZtXTUiyjdBhco2RDuxQaW5gZYKv2HmiIvu66wdhzEM5NvU1w0sSun019UV bZjQQXQdopmeHeRklVGuQBmCXRg9ou37lqPqZRyBF4iM8LkV3Y612rhOTRpR7PvqPKyU kxdQ1YpKK2bY5SpIYZIWrCmRd77RsH905qDlFMV3i16C+HzuXgWnvzPEapfdh0WY87AG p1uXKwjYPALnuOjS5UkfvI2i1nb0TuGiULA6p2MtejrGsUFMOSauxQNod9vRNBzA/goD uZHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=5kckJPsvMQ/j5hR5sXU2L8PEN5jnLOB1WRZNAJA7KSg=; fh=28Gsh8p/Rrgoh0ZJgxMb30MiNZzzGa/AucmCEg5DMJI=; b=dWgq2KKgK0ZMoPMwiSkO5LYE3N7oLGTSDrDoSxLm5DUzmI/nxojDsY2wxJsrqd0ULj Lqq2pvs7pPUZHNmkc7QRaqlKyqhPw9t5EQXRY6AUudNiwGHZLBbTYrn/nfNX8lDezJw6 iU+3ZsiO5KIWnVWL13YfmcOg1TJYYY+HLjVPlvmrA0YtERcN/HHnd8TWL7LCYEIyO4ze L/rT/7qyUeNwFqOnJhNmCD1sJZkWkFt3u6io4pHkeMCPKFtP7cs7gTpTtXDrYAEvkv72 qm3DnvVFRV4CHNON53RvvUanyhzLe5Nt0LcWvoOOZmNfbXV8LqG30RZUe6R0i+CaRT3k +O5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-94810-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b23-20020a170906491700b00a45b8c249c8si1102811ejq.1027.2024.03.06.17.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:07:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94810-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-94810-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D48E81F219B3 for ; Thu, 7 Mar 2024 01:07:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A913117753; Thu, 7 Mar 2024 01:06:24 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61DF4441F; Thu, 7 Mar 2024 01:06:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709773584; cv=none; b=VmqfsdSXR841/ciSEsUtyFvV01dZU9g3cj5cSubzlpppTZgBRcVW8MKcxSNWGOn0BFV6+fyu0Hi0WLWvN1mtjS960Ox3m+o86xfkNgi9klBC9pufb982QCjutyQkduDMeSHrtnL3ivZ65/FO7kXBTpDxU4GtnTyoUPlZePEjcLc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709773584; c=relaxed/simple; bh=DX48RV47OzBnXclpfmlm6rGmKGY9E4cUG+76FGHaRAU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jxf2dVllO/WFu+I/BPtqIjQ4AjsWDVwzw1KrpqhELRt4cD/jNH/UYmvrsfDnPMPA9g/FrxzVWqZLnr5mGltEWAdgi0slBWA7oDTRojA/W9nasxkX3X+HrscSYvD5Z9UwIgq7InddDqSUf0LeRncafzQdXjIu/Ffs7plrocAPB30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4TqrhH1Z57zbcnS; Thu, 7 Mar 2024 09:05:35 +0800 (CST) Received: from kwepemm600007.china.huawei.com (unknown [7.193.23.208]) by mail.maildlp.com (Postfix) with ESMTPS id D8C9C18007B; Thu, 7 Mar 2024 09:06:17 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 7 Mar 2024 09:06:17 +0800 From: Jijie Shao To: , , , , , CC: , , , , , Subject: [PATCH net 6/8] net: hns3: fix reset timeout under full functions and queues Date: Thu, 7 Mar 2024 09:01:13 +0800 Message-ID: <20240307010115.3054770-7-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240307010115.3054770-1-shaojijie@huawei.com> References: <20240307010115.3054770-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600007.china.huawei.com (7.193.23.208) From: Peiyang Wang The cmdq reset command times out when all VFs are enabled and the queue is full. The hardware processing time exceeds the timeout set by the driver. In order to avoid the above extreme situations, the driver extends the reset timeout to 1 second. Signed-off-by: Peiyang Wang Signed-off-by: Jijie Shao --- .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c | 2 +- .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c index d92ad6082d8e..652d71326231 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c @@ -351,7 +351,7 @@ static int hclge_comm_cmd_csq_done(struct hclge_comm_hw *hw) static u32 hclge_get_cmdq_tx_timeout(u16 opcode, u32 tx_timeout) { static const struct hclge_cmdq_tx_timeout_map cmdq_tx_timeout_map[] = { - {HCLGE_OPC_CFG_RST_TRIGGER, HCLGE_COMM_CMDQ_TX_TIMEOUT_500MS}, + {HCLGE_OPC_CFG_RST_TRIGGER, HCLGE_COMM_CMDQ_CFG_RST_TIMEOUT}, }; u32 i; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h index 533c19d25e4f..552396518e08 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h @@ -55,7 +55,7 @@ #define HCLGE_COMM_NIC_CMQ_DESC_NUM_S 3 #define HCLGE_COMM_NIC_CMQ_DESC_NUM 1024 #define HCLGE_COMM_CMDQ_TX_TIMEOUT_DEFAULT 30000 -#define HCLGE_COMM_CMDQ_TX_TIMEOUT_500MS 500000 +#define HCLGE_COMM_CMDQ_CFG_RST_TIMEOUT 1000000 enum hclge_opcode_type { /* Generic commands */ -- 2.30.0