-
Notifications
You must be signed in to change notification settings - Fork 68
Support for RDMA Atomics + Support for user-defined initiator and responder resources on connect/accept #51
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
Open
TaranovK
wants to merge
7
commits into
zrlio:master
Choose a base branch
from
TaranovK:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
14ee342
Added support for user-defined responder and initiator resources on c…
TaranovK 0e7f403
added support for atomics and made a simple test
TaranovK 402d8a5
added support for atomics and made a simple test
TaranovK f96a00c
added fully functioning query device
TaranovK 759e282
added setting max connparams for various endpoints
TaranovK 09a75a0
bug in old disni connect/accept.
642ed59
bumped the version
TaranovK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -430,6 +430,41 @@ JNIEXPORT void JNICALL Java_com_ibm_disni_verbs_impl_NativeDispatcher__1connect( | |
| } | ||
| } | ||
|
|
||
| /* | ||
| * Class: com_ibm_disni_verbs_impl_NativeDispatcher | ||
| * Method: _connectV2 | ||
| * Signature: (JJ)V | ||
| */ | ||
| JNIEXPORT void JNICALL Java_com_ibm_disni_verbs_impl_NativeDispatcher__1connectV2( | ||
| JNIEnv *env, jobject obj, jlong id, jlong param) { | ||
| struct rdma_cm_id *cm_listen_id = NULL; | ||
| struct rdma_conn_param *conn_param = NULL; | ||
|
|
||
| cm_listen_id = (struct rdma_cm_id *)id; | ||
| conn_param = (struct rdma_conn_param *)param; | ||
|
|
||
| if (cm_listen_id != NULL && conn_param!=NULL) { | ||
| int ret = rdma_connect(cm_listen_id, conn_param); | ||
| if (ret == 0) { | ||
| log("j2c::connect: ret %i, guid %" PRIu64 "\n", ret, | ||
| ibv_get_device_guid(cm_listen_id->verbs->device)); | ||
| } else { | ||
| log("j2c::connect: rdma_connect failed\n"); | ||
| JNU_ThrowIOExceptionWithLastError(env, | ||
| "j2c::connect: rdma_connect failed"); | ||
| } | ||
| } else { | ||
| if(cm_listen_id == NULL){ | ||
| log("j2c:connect: cm_listen_id null\n"); | ||
| JNU_ThrowIOException(env, "j2c:connect: cm_listen_id null\n"); | ||
| } else { | ||
| log("j2c:connect: conn_param null\n"); | ||
| JNU_ThrowIOException(env, "j2c:connect: conn_param null\n"); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| /* | ||
| * Class: com_ibm_disni_verbs_impl_NativeDispatcher | ||
| * Method: _accept | ||
|
|
@@ -463,6 +498,40 @@ JNIEXPORT void JNICALL Java_com_ibm_disni_verbs_impl_NativeDispatcher__1accept( | |
| } | ||
| } | ||
|
|
||
| /* | ||
| * Class: com_ibm_disni_verbs_impl_NativeDispatcher | ||
| * Method: _acceptV2 | ||
| * Signature: (JJ)V | ||
| */ | ||
| JNIEXPORT void JNICALL Java_com_ibm_disni_verbs_impl_NativeDispatcher__1acceptV2( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment to connectV2 |
||
| JNIEnv *env, jobject obj, jlong id, jlong param) { | ||
| struct rdma_cm_id *cm_listen_id = NULL; | ||
| struct rdma_conn_param *conn_param = NULL; | ||
|
|
||
| cm_listen_id = (struct rdma_cm_id *)id; | ||
| conn_param = (struct rdma_conn_param *)param; | ||
|
|
||
| if (cm_listen_id != NULL && conn_param!=NULL) { | ||
| int ret = rdma_accept(cm_listen_id, conn_param); | ||
| if (ret == 0) { | ||
| log("j2c::connect: ret %i, guid %" PRIu64 "\n", ret, | ||
| ibv_get_device_guid(cm_listen_id->verbs->device)); | ||
| } else { | ||
| log("j2c::connect: rdma_connect failed\n"); | ||
| JNU_ThrowIOExceptionWithLastError(env, | ||
| "j2c::connect: rdma_connect failed"); | ||
| } | ||
| } else { | ||
| if(cm_listen_id == NULL){ | ||
| log("j2c:connect: cm_listen_id null\n"); | ||
| JNU_ThrowIOException(env, "j2c:connect: cm_listen_id null\n"); | ||
| } else { | ||
| log("j2c:connect: conn_param null\n"); | ||
| JNU_ThrowIOException(env, "j2c:connect: conn_param null\n"); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /* | ||
| * Class: com_ibm_disni_verbs_impl_NativeDispatcher | ||
| * Method: _ackCmEvent | ||
|
|
@@ -823,6 +892,32 @@ Java_com_ibm_disni_verbs_impl_NativeDispatcher__1queryOdpSupport(JNIEnv *env, | |
| return ret; | ||
| } | ||
|
|
||
| /* | ||
| * Class: com_ibm_disni_verbs_impl_NativeDispatcher | ||
| * Method: _queryDevice | ||
| * Signature: (JJ)I | ||
| */ | ||
| JNIEXPORT jint JNICALL | ||
| Java_com_ibm_disni_verbs_impl_NativeDispatcher__1queryDevice(JNIEnv *env, | ||
| jobject obj, | ||
| jlong id, | ||
| jlong addr) { | ||
| jint ret = -1; | ||
| struct ibv_context *context = (struct ibv_context *)id; | ||
|
|
||
| struct ibv_device_attr *dev_attr = (struct ibv_device_attr *)addr; | ||
| ret = ibv_query_device(context, dev_attr); | ||
|
|
||
| if(ret != 0) { | ||
| log("j2c::queryDevice: ibv_query_device failed, error %s\n", | ||
| strerror(ret)); | ||
| ret = -1; | ||
| JNU_ThrowIOExceptionWithLastError(env, "j2c::queryDevice: ibv_query_device failed"); | ||
| } | ||
| return ret; | ||
| } | ||
|
|
||
|
|
||
| /* | ||
| * Class: com_ibm_disni_verbs_impl_NativeDispatcher | ||
| * Method: _expPrefetchMr | ||
|
|
||
29 changes: 29 additions & 0 deletions
29
libdisni/src/verbs/com_ibm_disni_verbs_impl_NativeDispatcher.h
100755 → 100644
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't like the idea of multiple connect implementations. Why not only keep V2 and expose query_device to Java. This solves multiple problems at once: 1) setting initiator/responder resource without knowing what the max are 2) two implementations of the same 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.
Makes sense. However, since the libdisni is shipped separately, it may force some developers to recompile their java code which uses the library.
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.
That should be ok. Developers can always choose to use an old version of the library if needed.