-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get Memory info from ZOCL using xgq for Built in ps kernel #7564
Get Memory info from ZOCL using xgq for Built in ps kernel #7564
Conversation
Signed-off-by: Saif <saifuddi@amd.com>
Signed-off-by: Saifuddin <saifuddi@xilinx.com>
Signed-off-by: Saifuddin <saifuddi@xilinx.com>
Signed-off-by: Saifuddin <saifuddi@xilinx.com>
Build failed :( |
retest this please. |
Build failed :( |
retest this please |
Build failed :( |
retest this please. |
Build failed :( |
retest this please. |
Build failed :( |
Build Passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some question and minor changes.
r->h_mem_info = (u32)((zdev->host_mem & 0xFFFFFFFF00000000LL) >> 32); | ||
break; | ||
|
||
case XGQ_CMD_QUERY_MEM_SIZE: | ||
r->l_mem_info = (u32)zdev->host_mem_len; | ||
r->h_mem_info = (u32)((zdev->host_mem_len & 0xFFFFFFFF00000000LL) >> 32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value "0xFFFFFFFF00000000LL" shows up twice, right? Can we define it as a macro?
drm_p->cma_bank_idx = -1; | ||
/* Memory manager initialization is done in two phase. | ||
* Phase 1 is done based on platform and Phase 2 is done | ||
* based on XCLBIN. We have done phase 1 here. | ||
*/ | ||
drm_p->xocl_drm_mm_done = true; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why this code can be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have sent a mail with the details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, looks like drm_p->xocl_drm_mm_done is not used anymore. Can we delete it in xocl_drm.h?
{ | ||
int err = 0; | ||
int i = 0; | ||
uint64_t mm_end_addr = 0xffffFFFFffffFFFF; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Linux, you can use macro "U64_MAX"
|
||
xocl_info(drm_p->ddev->dev, "drm_mm_init called for the available memory range" | ||
" <%llx - %llx>", mm_start_addr, mm_end_addr); | ||
xocl_info(drm_p->ddev->dev, "drm_mm_init called for the maximum memory range possible"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why deleted <%llx - %llx>?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are initializing the max range of memory. Hence, not specifically define any range
@@ -1107,6 +1070,7 @@ static int xocl_cleanup_memory_manager(struct xocl_drm *drm_p) | |||
return 0; | |||
} | |||
|
|||
#if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code dead? Why comment it out but not delete it?
|
||
ret = xocl_kds_xgq_query_mem(xdev, &XOCL_DRM(xdev)->ps_mem_data); | ||
if (ret) | ||
userpf_info(xdev, "WARN ! Device doesn't configure for PS Kernel memory\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation?
Hi @saifuddin-xilinx , is there any change in the mem topology section of xclbin? |
Signed-off-by: Saifuddin <saifuddi@xilinx.com>
Build failed :( |
retest this please |
Signed-off-by: Saifuddin <saifuddi@xilinx.com>
…/XRT into built_in_ps_kernel_support
Build failed :( |
retest this please. |
@@ -112,6 +112,7 @@ enum xgq_cmd_opcode { | |||
XGQ_CMD_OP_DATA_INTEGRITY = 0x10e, | |||
XGQ_CMD_OP_EXIT = 0x10f, | |||
XGQ_CMD_OP_UNCFG_CU = 0x110, | |||
XGQ_CMD_OP_QUERY_MEM = 0x111, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remember to update XGQ command spec page with this new command.
https://confluence.xilinx.com/pages/viewpage.action?pageId=302345261
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
Thanks
Build failed :( |
retest this please. |
Signed-off-by: Saifuddin <saifuddi@xilinx.com>
Build failed :( |
Signed-off-by: Saifuddin <saifuddi@xilinx.com>
Build failed :( |
retest this please |
Build failed :( |
retest this please |
Build failed :( |
Signed-off-by: Saifuddin <saifuddi@xilinx.com>
Build Passed! |
* Fixed xgq assignment issue for multislot Signed-off-by: Saif <saifuddi@amd.com> * Fixed allignment issues Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Cleanup memory manager for built in ps kernel support Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Get the ps kernel mem info from zocl through xgq * Fix issue to Get the ps kernel mem info from zocl through xgq Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Not to fail the driver is PS kernel memory is not configured * Fixed review comments Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Added memory management changes to this branch Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Delete unused variable Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Fixed one issue Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Remove the multislot fix from PS memory fix branch Signed-off-by: Saifuddin <saifuddi@xilinx.com> --------- Signed-off-by: Saif <saifuddi@amd.com> Signed-off-by: Saifuddin <saifuddi@xilinx.com> Co-authored-by: Saif <saifuddi@amd.com> (cherry picked from commit 47b38ea)
…7596) * Fixed xgq assignment issue for multislot Signed-off-by: Saif <saifuddi@amd.com> * Fixed allignment issues Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Cleanup memory manager for built in ps kernel support Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Get the ps kernel mem info from zocl through xgq * Fix issue to Get the ps kernel mem info from zocl through xgq Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Not to fail the driver is PS kernel memory is not configured * Fixed review comments Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Added memory management changes to this branch Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Delete unused variable Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Fixed one issue Signed-off-by: Saifuddin <saifuddi@xilinx.com> * Remove the multislot fix from PS memory fix branch Signed-off-by: Saifuddin <saifuddi@xilinx.com> --------- Signed-off-by: Saif <saifuddi@amd.com> Signed-off-by: Saifuddin <saifuddi@xilinx.com> Co-authored-by: Saif <saifuddi@amd.com> (cherry picked from commit 47b38ea) Co-authored-by: Saifuddin Kaijar <54270703+saifuddin-xilinx@users.noreply.github.com>
Problem solved by the commit
-- Updated the memory manager logic. Now DRM memory manager is initialized with 0 to MAX(uint64).
-- Memory manager will be initialized once with drm init and live till the driver active.
-- Memory allocation will be done based on the BANK information
-- Added a support to communicate the ZOCL memory range using XGQ configuration
-- Added a new query_mem command to exchange the memory info between ZOCL and XOCL
-- For PS kernel memory will be allocated with the configured range
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
-- N/A
How problem was solved, alternative solutions (if any) and why they were rejected
N/A
Risks (if any) associated the changes in the commit
N/A
What has been tested and how, request additional testing if necessary
Documentation impact (if any)