drm/amdgpu/SRIOV: Extend VF reset request wait period
Subsystems (2)
PATCH 1/1 drm/amdgpu/SRIOV: Extend VF reset request wait period
From: Jiange Zhao <[email protected]>
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.
--- 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(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +10 -1
@@ -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 =0 ; + +while (i <11 ) { + ret =xgpu_ai_send_access_requests (adev,IDH_REQ_GPU_RESET_ACCESS ); +if (!ret) +break ; + i++; + } + +return ret; } static int xgpu_ai_request_full_gpu_access(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h +1 -1
@@ -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 5000enum idh_request {
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +10 -1
@@ -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 =0 ; + +while (i <11 ) { + ret =xgpu_nv_send_access_requests (adev,IDH_REQ_GPU_RESET_ACCESS ); +if (!ret) +break ; + i++; + } + +return ret; } static int xgpu_nv_request_full_gpu_access(struct amdgpu_device *adev,
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
ping!
________________________________
From: Zhao, Jiange <[email protected]>
Sent: Wednesday, November 25, 2020 10:10 PM
To: [email protected] <[email protected]>
Cc: Min, Frank <[email protected]>; Chen, Horace <[email protected]>; Zhang, Andy <[email protected]>; Zhao, Jiange <[email protected]>
Subject: [PATCH] drm/amdgpu/SRIOV: Extend VF reset request wait period
From: Jiange Zhao <[email protected]>
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.
--- 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(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +10 -1
@@ -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 =0 ; + +while (i <11 ) { + ret =xgpu_ai_send_access_requests (adev,IDH_REQ_GPU_RESET_ACCESS ); +if (!ret) +break ; + i++; + } + +return ret; } static int xgpu_ai_request_full_gpu_access(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h +1 -1
@@ -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 5000enum idh_request {
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +10 -1
@@ -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 =0 ; + +while (i <11 ) { + ret =xgpu_nv_send_access_requests (adev,IDH_REQ_GPU_RESET_ACCESS ); +if (!ret) +break ; + i++; + } + +return ret; } static int xgpu_nv_request_full_gpu_access(struct amdgpu_device *adev,
--
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Public Use]
+ while (i < 11)
Please use macro to replace the magic number. No one want to play with the code which need some sort of guess to figure out hack setting or experimental ones.
Regards,
Hawking
From: amd-gfx <[email protected]> On Behalf Of Zhao, Jiange
Sent: Monday, December 7, 2020 16:15
To: Zhao, Jiange <[email protected]>; [email protected]
Cc: Zhang, Andy <[email protected]>; Chen, Horace <[email protected]>; Min, Frank <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/SRIOV: Extend VF reset request wait period
[AMD Official Use Only - Internal Distribution Only]
[AMD Official Use Only - Internal Distribution Only]
ping!
________________________________
From: Zhao, Jiange <[email protected]<mailto:[email protected]>>
Sent: Wednesday, November 25, 2020 10:10 PM
To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: Min, Frank <[email protected]<mailto:[email protected]>>; Chen, Horace <[email protected]<mailto:[email protected]>>; Zhang, Andy <[email protected]<mailto:[email protected]>>; Zhao, Jiange <[email protected]<mailto:[email protected]>>
Subject: [PATCH] drm/amdgpu/SRIOV: Extend VF reset request wait period
From: Jiange Zhao <[email protected]<mailto:[email protected]>>
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.
--- 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(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +10 -1
@@ -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 =0 ; + +while (i <11 ) { + ret =xgpu_ai_send_access_requests (adev,IDH_REQ_GPU_RESET_ACCESS ); +if (!ret) +break ; + i++; + } + +return ret; } static int xgpu_ai_request_full_gpu_access(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h +1 -1
@@ -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 5000enum idh_request {
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +10 -1
@@ -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 =0 ; + +while (i <11 ) { + ret =xgpu_nv_send_access_requests (adev,IDH_REQ_GPU_RESET_ACCESS ); +if (!ret) +break ; + i++; + } + +return ret; } static int xgpu_nv_request_full_gpu_access(struct amdgpu_device *adev,
--
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx