-
Notifications
You must be signed in to change notification settings - Fork 423
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
UCP: Add prot parameter to UCP API. #5309
Conversation
@yosefe Fixed according to our last talk. |
/azp run |
Commenter does not have sufficient privileges for PR 5309 in repo openucx/ucx |
src/ucp/api/ucp.h
Outdated
* ucp_mem_map() function. | ||
*/ | ||
enum { | ||
UCP_MEM_MAP_WRITE = UCS_BIT(1), /**< Enable write access. */ |
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.
UCP_MEM_MAP_PROT_READ = UCS_BIT(0)
UCP_MEM_MAP_PROT_WRITE = UCS_BIT(1)
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.
@yosefe Done
src/uct/api/uct.h
Outdated
@@ -699,15 +699,21 @@ enum uct_md_mem_flags { | |||
UCT_MD_MEM_ACCESS_REMOTE_PUT = UCS_BIT(5), /**< enable remote put access */ | |||
UCT_MD_MEM_ACCESS_REMOTE_GET = UCS_BIT(6), /**< enable remote get access */ | |||
UCT_MD_MEM_ACCESS_REMOTE_ATOMIC = UCS_BIT(7), /**< enable remote atomic access */ | |||
UCT_MD_MEM_ACCESS_LOCAL_WRITE = UCS_BIT(8), /**< enable local write access */ |
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.
pls remove UCT part from this PR (add in another PR)
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
src/ucp/api/ucp.h
Outdated
* | ||
* The enumeration list describes the memory mapping protections supported by @ref | ||
* ucp_mem_map() function. | ||
*/ | ||
enum { | ||
UCP_MEM_MAP_WRITE = UCS_BIT(1), /**< Enable write access. */ | ||
UCP_MEM_MAP_READ = UCS_BIT(2) /**< Enable read access. */ | ||
UCP_MEM_MAP_PROT_READ = UCS_BIT(0), /**< Enable read access. */ |
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.
pls remove space after 'read'
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.
Done. Thanks!
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
|
||
/* always acquire context lock */ | ||
UCP_THREAD_CS_ENTER(&context->mt_lock); | ||
|
||
mem_params = *params; | ||
status = ucp_mem_map_check_and_adjust_params(&mem_params); |
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.
shall we delete ucp_mem_map_check_and_adjust_params() function?
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.
@yosefe Deleted. Thanks!
src/ucp/core/ucp_mm.c
Outdated
goto out; | ||
} | ||
|
||
if (((params->field_mask & UCP_MEM_MAP_PARAM_FIELD_FLAGS) && |
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.
unsigned flags;
...
flags = UCP_PARAM_VALUE(MEM_MAP, params, flags, FLAGS, 0);
then, can use 'flags' local var without checking the field every time
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.
@yosefe Fixed.
src/ucp/core/ucp_mm.c
Outdated
if (!(params->field_mask & UCP_MEM_MAP_PARAM_FIELD_ADDRESS)) { | ||
address = NULL; | ||
} else { | ||
address = params->address; | ||
} |
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.
use UCP_PARAM_VALUE macro
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.
Fixed.
retest with bot:pipe:retest |
bot:pipe:retest |
3 similar comments
bot:pipe:retest |
bot:pipe:retest |
bot:pipe:retest |
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.
@evgeny-leksikov can you pls take a look as well?
* | result | err if | alloc/reg | err | reg | err | alloc/reg | err | alloc/reg | | ||
* | | len >0 | | | | | (hint) | | (fixed) | | ||
* |--------------------------------------------------------------------------------| | ||
*/ |
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.
👍 for keeping the documentation
@shamisp @tonycurtis can you pls take a look? |
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.
ucp.h:447 would add "the" after "by"
otherwise fine.
👍 |
squash please |
src/ucp/api/ucp.h
Outdated
* ucp_mem_map() function. | ||
*/ | ||
enum { | ||
UCP_MEM_MAP_PROT_READ = UCS_BIT(0), /**< Enable read access. */ |
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 would like to withdraw my approval based on UCT patch review :) Let's add LOCAL to both - enum name and description. @yosefe Maybe you want to use this opportunity to add remote read/write ?
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.
UCT patch #5348
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.
@shamisp do you mean the flags we need are: UCP_MAM_MAP_PROT_[LOCAL|REMOTE]_[READ|WRITE] ?
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 think so. Even if you want to define only local
for now, I would explicitly name it _local_
.
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.
Also, to some extend this might be a hint, since some transports may not have permissions for read/write, etc.
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.
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.
@yosefe I don't understand what is the value of pre-defined UCP_MEM_MAP_PROT_READ = UCP_MEM_MAP_PROT_LOCAL_READ| UCP_MEM_MAP_PROT_REMOTE_READ
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.
syntax sugar
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.
IMHO, it looks completely out of place in UCP.H. Extra enum to document and manage with no additional value.
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.
Fixed. Thanks! |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@leibin2014 can you pls squash? |
@yosefe It was squashed before the last /azp run. Thanks! |
@leibin2014 there are 6 commits in the PR, it should be 1 only |
OK, thought it didn't matter having "Merge pull request #8 from openucx/master" this kind of commits. Done now. Thanks! |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
6a8edc2
to
ec8da5b
Compare
bot:pipe:retest |
bot:pipe:retest |
What
Add prot READ/WRITE to prot parameters of UCP API.
Why ?
Currently prot READ|WRITE is hard code in UCX, we need configure them through UCP API.
How ?
Add prot READ/WRITE relative macros in the prot parameter of UCP API.