From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42685C4361B for ; Mon, 7 Dec 2020 08:14:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C015622582 for ; Mon, 7 Dec 2020 08:14:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C015622582 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CC8E89286; Mon, 7 Dec 2020 08:14:34 +0000 (UTC) Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700080.outbound.protection.outlook.com [40.107.70.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id B99D28910A for ; Mon, 7 Dec 2020 08:14:32 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZUaFIOn2eRggxT9IDg0aaYrQF0D0il+HLWO6WFs5/cmLUaNzjiv7Rl9dbkjwROKhRwBsuW0ylP55FGH9Iha00E9mq9LaGfch+RILS41XJzcsMrKlW/80OXYslvEEw0TmLgfQsZDSr1llRsE+trPYNiLd8CIxVOcaFCOeM7GTS4Xar4vPrHvtgfxMoSUo6wuPNKWa930JQEQEXt43CVGXRuQQSgc2T5nrsJmXNCi99MLVC0HqWMTwSbmGXkcsy4Mm/fbOV36j8QtaNNzBJr3f3jr54T7LxKWAw54j4C2URp0XRjy3aCRVfRU6/i77ZEniLGiuArwvXhO+3EBsWxRGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uq4qKb7WXvg89vfKIzGFgIV7PQQIUdM/9MM04xUCczo=; b=HnUBU5uu5QDMfEOjFIx7d79La9IddbvCJTWW8bXFGRuUqyyZ085dIPyxF63v07nHHNMS3TY9u6jvteLBTqGhAlJHwLst0ZfFLhT5aymPyBlwoy7mrHowFVS0oD/3c1yPK36om/CvWJ5XXGebmYiaEzk7LcMzCQAzGif0A8gMw/n+rzQD67MB/AcDbCpL1ivao+vdTI4+BsjKmcNTnMQPR4qMAqpze3VSGka+11Sa+nZGtqbeZUAUYfUN695xDReks9AZBv89vrosRmNDxOq4AosariqFisHoTdPvqEQQTyJiBXxliRi2O+SXmBExY2if2D67v7rB+kZFALr0t7o5ng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uq4qKb7WXvg89vfKIzGFgIV7PQQIUdM/9MM04xUCczo=; b=XJdI2SXDzJFr3ZULeNWjtVEbqTbZBszTlxq+li8McxqPyy+JCTIlZ/HmZb+7Ym90uIoWLkPAP5c7cM5hJW16qnQI0e+AB6DB5eb/R6Z5gvj9cOuYKTOm9qhPBkYFMXYDKkr32ZdUB04UWVV08rolBQxNvJj37AbdG2Id7Ix5DZ0= Received: from BYAPR12MB3222.namprd12.prod.outlook.com (2603:10b6:a03:12c::23) by BY5PR12MB4321.namprd12.prod.outlook.com (2603:10b6:a03:204::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Mon, 7 Dec 2020 08:14:30 +0000 Received: from BYAPR12MB3222.namprd12.prod.outlook.com ([fe80::9c89:cf2f:2184:1b16]) by BYAPR12MB3222.namprd12.prod.outlook.com ([fe80::9c89:cf2f:2184:1b16%5]) with mapi id 15.20.3632.021; Mon, 7 Dec 2020 08:14:30 +0000 From: "Zhao, Jiange" To: "Zhao, Jiange" , "amd-gfx@lists.freedesktop.org" Subject: Re: [PATCH] drm/amdgpu/SRIOV: Extend VF reset request wait period Thread-Topic: [PATCH] drm/amdgpu/SRIOV: Extend VF reset request wait period Thread-Index: AQHWwzTBL5mW4YDs30uWVrMjNCey5KnrW3mV Date: Mon, 7 Dec 2020 08:14:30 +0000 Message-ID: References: <20201125141012.301219-1-jianzh@amd.com> In-Reply-To: <20201125141012.301219-1-jianzh@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Enabled=True; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SetDate=2020-12-07T08:14:30.204Z; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Name=Internal Distribution Only; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ContentBits=0; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Method=Standard; authentication-results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; x-originating-ip: [180.167.199.189] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 9959fcc4-9617-444f-a53e-08d89a881f99 x-ms-traffictypediagnostic: BY5PR12MB4321: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3044; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DBaMiU/S2FrgtDwAqwmdnWCU6eDACpo3dOljhKVPl/4f7apwrgmofF+uUiVBf3I2xbga6mcNMfQQ2jNNidM68/IzNQKvA2PQzuGZZfCj8GiO60QvtHtbLG4/XqmktDds0zZ/rE+5QXUbNi8glaOO0eMLtKXbT5P+CfonNrN/u1fzvsREJEwF4IgS5bvYjlE3xL2FTe1rxDux6g+kn7xQZgupMKGVzNUSWILGceNA5/J5CaH5xhMrqpRAfSTAYw2j7mb707QxqsoS/NjE4RjCGEXqnHitiXBgIY6V0vupekcRZjk3NyqUX81H/WcsQSnK x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR12MB3222.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(39860400002)(396003)(136003)(366004)(376002)(8936002)(64756008)(71200400001)(86362001)(8676002)(91956017)(83380400001)(26005)(6506007)(316002)(53546011)(478600001)(110136005)(66446008)(186003)(19627405001)(7696005)(54906003)(33656002)(66556008)(9686003)(66946007)(52536014)(55016002)(2906002)(76116006)(4326008)(66476007)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?47wB6pLmSdw7ntYbecVlOT5H+gyXJnabHIIqyYbLDlnnDegedp9eW9Drfw2y?= =?us-ascii?Q?Zb1HFv43lu3JFF4ROQiuTwoA6kn9IlX4DtdrfMuL5KB3ffrjjw8HH4n8K3hb?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rm5Sf23VAp0=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3222.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9959fcc4-9617-444f-a53e-08d89a881f99 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2020 08:14:30.8458 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sZ79QiJpukp1ZSQgYyY4gC298MS/cLsKRITYaeRPkpruCAuWMXyetnZcPzmKzy77 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4321 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Zhang, Andy" , "Chen, Horace" , "Min, Frank" Content-Type: multipart/mixed; boundary="===============1714241086==" Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" --===============1714241086== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BYAPR12MB3222F97D3A02992B2ED3FC7EE1CE0BYAPR12MB3222namp_" --_000_BYAPR12MB3222F97D3A02992B2ED3FC7EE1CE0BYAPR12MB3222namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - Internal Distribution Only] ping! ________________________________ From: Zhao, Jiange Sent: Wednesday, November 25, 2020 10:10 PM To: amd-gfx@lists.freedesktop.org Cc: Min, Frank ; Chen, Horace ; Zha= ng, Andy ; Zhao, Jiange Subject: [PATCH] drm/amdgpu/SRIOV: Extend VF reset request wait period From: Jiange Zhao In Virtualization case, when one VF is sending too many FLR requests, hypervisor would stop responding to this VF's request for a long period of time. This is called event guard. During this period of cooling time, guest driver should wait instead of doing other things. After this period of time, guest driver would resume reset process and return to normal. Currently, guest driver would wait 12 seconds and return fail if it doesn't get response from host. Solution: extend this waiting time in guest driver and poll response periodically. Signed-off-by: Jiange Zhao --- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 11 ++++++++++- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h | 2 +- drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 11 ++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c b/drivers/gpu/drm/amd/am= dgpu/mxgpu_ai.c index f5ce9a9f4cf5..d8d8c623bb74 100644 --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c @@ -187,7 +187,16 @@ static int xgpu_ai_send_access_requests(struct amdgpu_= device *adev, static int xgpu_ai_request_reset(struct amdgpu_device *adev) { - return xgpu_ai_send_access_requests(adev, IDH_REQ_GPU_RESET_ACCESS)= ; + int ret, i =3D 0; + + while (i < 11) { + ret =3D xgpu_ai_send_access_requests(adev, IDH_REQ_GPU_RESE= T_ACCESS); + if (!ret) + break; + i++; + } + + return ret; } static int xgpu_ai_request_full_gpu_access(struct amdgpu_device *adev, diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h b/drivers/gpu/drm/amd/am= dgpu/mxgpu_ai.h index 83b453f5d717..20ee2142f9ed 100644 --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h @@ -25,7 +25,7 @@ #define __MXGPU_AI_H__ #define AI_MAILBOX_POLL_ACK_TIMEDOUT 500 -#define AI_MAILBOX_POLL_MSG_TIMEDOUT 12000 +#define AI_MAILBOX_POLL_MSG_TIMEDOUT 6000 #define AI_MAILBOX_POLL_FLR_TIMEDOUT 5000 enum idh_request { diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c b/drivers/gpu/drm/amd/am= dgpu/mxgpu_nv.c index 666ed99cc14b..0147dfe21a39 100644 --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c @@ -200,7 +200,16 @@ static int xgpu_nv_send_access_requests(struct amdgpu_= device *adev, static int xgpu_nv_request_reset(struct amdgpu_device *adev) { - return xgpu_nv_send_access_requests(adev, IDH_REQ_GPU_RESET_ACCESS)= ; + int ret, i =3D 0; + + while (i < 11) { + ret =3D xgpu_nv_send_access_requests(adev, IDH_REQ_GPU_RESE= T_ACCESS); + if (!ret) + break; + i++; + } + + return ret; } static int xgpu_nv_request_full_gpu_access(struct amdgpu_device *adev, -- 2.25.1 --_000_BYAPR12MB3222F97D3A02992B2ED3FC7EE1CE0BYAPR12MB3222namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[AMD Official Use Only - Internal Distribution Only]


ping!

From: Zhao, Jiange <jian= zh@amd.com>
Sent: Wednesday, November 25, 2020 10:10 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org&= gt;
Cc: Min, Frank <Frank.Min@amd.com>; Chen, Horace <Horace.Ch= en@amd.com>; Zhang, Andy <Andy.Zhang@amd.com>; Zhao, Jiange <Ji= ange.Zhao@amd.com>
Subject: [PATCH] drm/amdgpu/SRIOV: Extend VF reset request wait peri= od
 
From: Jiange Zhao <Jiange.Zhao@amd.com>

In Virtualization case, when one VF is sending too many
FLR requests, hypervisor would stop responding to this
VF's request for a long period of time. This is called
event guard. During this period of cooling time, guest
driver should wait instead of doing other things. After
this period of time, guest driver would resume reset
process and return to normal.

Currently, guest driver would wait 12 seconds and return fail
if it doesn't get response from host.

Solution: extend this waiting time in guest driver and poll
response periodically.

Signed-off-by: Jiange Zhao <Jiange.Zhao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 11 ++++++++++-
 drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h |  2 +-
 drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 11 ++++++++++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c b/drivers/gpu/drm/amd/am= dgpu/mxgpu_ai.c
index f5ce9a9f4cf5..d8d8c623bb74 100644
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
@@ -187,7 +187,16 @@ static int xgpu_ai_send_access_requests(struct amdgpu_= device *adev,
 
 static int xgpu_ai_request_reset(struct amdgpu_device *adev)
 {
-       return xgpu_ai_send_access_requests(a= dev, IDH_REQ_GPU_RESET_ACCESS);
+       int ret, i =3D 0;
+
+       while (i < 11) {
+            &n= bsp;  ret =3D xgpu_ai_send_access_requests(adev, IDH_REQ_GPU_RESET_ACC= ESS);
+            &n= bsp;  if (!ret)
+            &n= bsp;          break;
+            &n= bsp;  i++;
+       }
+
+       return ret;
 }
 
 static int xgpu_ai_request_full_gpu_access(struct amdgpu_device *adev= ,
diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h b/drivers/gpu/drm/amd/am= dgpu/mxgpu_ai.h
index 83b453f5d717..20ee2142f9ed 100644
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h
@@ -25,7 +25,7 @@
 #define __MXGPU_AI_H__
 
 #define AI_MAILBOX_POLL_ACK_TIMEDOUT    500
-#define AI_MAILBOX_POLL_MSG_TIMEDOUT   12000
+#define AI_MAILBOX_POLL_MSG_TIMEDOUT   6000
 #define AI_MAILBOX_POLL_FLR_TIMEDOUT    5000
 
 enum idh_request {
diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c b/drivers/gpu/drm/amd/am= dgpu/mxgpu_nv.c
index 666ed99cc14b..0147dfe21a39 100644
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
@@ -200,7 +200,16 @@ static int xgpu_nv_send_access_requests(struct amdgpu_= device *adev,
 
 static int xgpu_nv_request_reset(struct amdgpu_device *adev)
 {
-       return xgpu_nv_send_access_requests(a= dev, IDH_REQ_GPU_RESET_ACCESS);
+       int ret, i =3D 0;
+
+       while (i < 11) {
+            &n= bsp;  ret =3D xgpu_nv_send_access_requests(adev, IDH_REQ_GPU_RESET_ACC= ESS);
+            &n= bsp;  if (!ret)
+            &n= bsp;          break;
+            &n= bsp;  i++;
+       }
+
+       return ret;
 }
 
 static int xgpu_nv_request_full_gpu_access(struct amdgpu_device *adev= ,
--
2.25.1

--_000_BYAPR12MB3222F97D3A02992B2ED3FC7EE1CE0BYAPR12MB3222namp_-- --===============1714241086== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx --===============1714241086==--