adding rsockets support into JDK

Alan Bateman Alan.Bateman at oracle.com
Wed Aug 29 12:27:31 UTC 2018


On 20/08/2018 05:50, Lu, Yingqi wrote:
> Hi Alan,
>
> Here is the version 09 of the patch: http://cr.openjdk.java.net/~ylu/8195160.09/
>
> In this version, I have following changes made:
>
> 1. The setSocket and setServerSocket in SocketImpl are set to "protected" so that they can be overridden in RdmaSocketImpl from jdk.net. In this version, I still keep them the same way. If you have suggestions on a different approach, please let me know.
>
> 2. Remove the unnecessary check for RDMA impl on supportedOptions from Socket and ServerSocket.
>
> 3. In RdmaSocketOptions.java, I added the texts saying the three options can only be set before connect or bind.
>
> At the same time, I was thinking on an issue you mentioned before. If librdmacm is not pre-installed on the machine, how do we handle it? Do we need to have a version of librdmacm.so included, or the build process tries to download/install it, or it simply provides a warning? What do you suggest?
>
In addition to librdmacm then I assume the JNI code won't compile when 
the package with rmda/rsocket.h is not installed. Not the Linux distro 
model but the JDK has a history of building binaries that can be used on 
several distributions. This has meant using dlopen/dlsym to link 
optional library dynamically and locate the symbols for the functions 
that are needed. You may have to resort to this approach here as I think 
you are looking for the JDK builds to be capable of using RDMA sockets 
when the builds are used on a system that has the packages installed.

On the API changes then I see that two protected setXXXX methods have 
been added to SocketImpl. I think we should try to avoid that, even if 
it means using the shared secrets mechanism.

I've skimmed through the implementation changes in the latest webrev and 
it looks reasonable. The implementation is currently in the rdma.ch tree 
and I assume you'll move that to a jdk.internal package at some point. 
Also it might be simpler to a simple "throws UOE" implementation in the 
shared directory - by this I mean the RmdaPollSelectorProvider and 
RdmaSocketImpl can be in the linux tree so that we aren't compiling all 
that code on other platforms. In passing, I don't think RdmaNet should 
extend sun.nio.ch.Net. The Net class is a utility class with static 
methods and should really be final.

That's all I have for now.

-Alan



More information about the nio-dev mailing list