adding rsockets support into JDK

Lu, Yingqi yingqi.lu at intel.com
Wed Nov 14 00:50:09 UTC 2018


Hi All,

Here is the version 16 of the patch: http://cr.openjdk.java.net/~ylu/8195160.16. This version of the patch has already incorporated the changes from both JDK-8213210 and JDK-8213418. Please review it and let us know your feedback.

In this version, following changes are done:


1.      Separated 5 RDMA related factory methods out from jdk.net.Sockets to jdk.net.RdmaSockets. Inside jdk.net.RdmaSockets, I added getOption and setOption for RDMA based socket and server socket.

2.      Added two static subtype classes RdmaClientSocketImpl and RdmaServerSocketImpl (both are subclasses to RdmaSocketeImpl) inside RdmaSocketProvider to remove the dependency of setSocket/setServerSocket. With this change, the previous reflection methods and shared secret method are completed removed from SocketImpl and RdmaSocketImpl.

3.      Removed the inheritance from jdk.internal.net.rdma.RdmaNet to sun.nio.ch.Net.

4.      Specified the value range for all three RDMA specific socket options.

5.      Dropped “The rsocket implementaiton is Linux only" in the class description of jdk.net.RdmaSocketOptions.

6.      Added a guard to function loadRdmaFuncs inside Rsocket.c to make sure it only being invoked once.

7.      All the related JTreg testing passed without errors or failures.

Previous, there was a question asking ipv6 support inside rsocket. Here is the answer:
rsocket does not currently support IPv4-mapped address. Since Java uses IPv6 as default whenever it is available, -Djava.net.preferIPv4Stack=true is needed for using IPv4 addresses.

In this version, jdk.net.RdmaSocketOptions is still kept as an individual class. This way, it is similar to java.net.StandardOptions and jdk.net.ExtendedSocketOptions. However, I can certainly change it if there is a better placement for it. Please let me know!

Thanks,
Lucy


From: nio-dev [mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of Lu, Yingqi
Sent: Friday, November 2, 2018 6:03 PM
To: Alan Bateman <Alan.Bateman at oracle.com>; Brian Burkhalter <brian.burkhalter at oracle.com>
Cc: nio-dev at openjdk.java.net; Viswanathan, Sandhya <sandhya.viswanathan at intel.com>; Aundhe, Shirish <shirish.aundhe at intel.com>; Kaczmarek, Eric <eric.kaczmarek at intel.com>
Subject: RE: adding rsockets support into JDK

Hi Alan,

I updated the patch version 15. In the update, I addressed your following comments first as they are part of the APIs. Brain helped generate a specdiff and attached it to the CSR at https://bugs.openjdk.java.net/browse/JDK-8205186. The CSR is updated to “proposed” status. In addition, Brain helped trunk the change for “Add protected constructor java.net.ServerSocket(SocketImpl)” (https://bugs.openjdk.java.net/browse/JDK-8213217). This was a blocking issue for this work.

The RdmaSocketOptions API mostly looks okay. The only thing that seems to be missed is some hints as to the valid ranges for the RMDA send/receive queue size. Does setOption(RMDA_RQSIZE, 0) or setOption(RMDA_RQSIZE, -1) make sense for example. It's okay to specify the upper limit as implementation specific, it's the 0 and negative values that aren't clear.

In RdmaSocketOptions class description then I assume "The rsocket implementaiton is Linux only" can be dropped or converted to an API note.

I am working on the rest of your comments and will post version 16 of patch early next week.

Thanks,
Lucy

From: Alan Bateman [mailto:Alan.Bateman at oracle.com]
Sent: Sunday, October 28, 2018 2:10 AM
To: Lu, Yingqi <yingqi.lu at intel.com<mailto:yingqi.lu at intel.com>>; Brian Burkhalter <brian.burkhalter at oracle.com<mailto:brian.burkhalter at oracle.com>>
Cc: nio-dev at openjdk.java.net<mailto:nio-dev at openjdk.java.net>; Viswanathan, Sandhya <sandhya.viswanathan at intel.com<mailto:sandhya.viswanathan at intel.com>>; Aundhe, Shirish <shirish.aundhe at intel.com<mailto:shirish.aundhe at intel.com>>; Kaczmarek, Eric <eric.kaczmarek at intel.com<mailto:eric.kaczmarek at intel.com>>
Subject: Re: adding rsockets support into JDK


On 26/10/2018 22:48, Lu, Yingqi wrote:
Hi Brian,

Here is the version 15 of the patch: http://cr.openjdk.java.net/~ylu/8195160.15<http://cr.openjdk.java.net/%7Eylu/8195160.15>

I went through the current patch.

One thing that isn't quite right is that Socket/ServerSocket have been updated so that the supportedOptions API returns the RDMA options. This is something that been pushed down to the implementation of the SocketImpl. When supportedOptions is invoked it will delegate to the socket impl and that should add the RDMA socket options.

I also see that SocketImpl setSocket/setServerSocket have been updated to special case the RDMA SocketImp. This shouldn't be needed so I think we need to understand the setSocket/setServerSocket usage to see how this can be restructured. If we can fix that then the RDMA SocketImpl should be just an implementation and the need for the shared secrets mechanism should go away.

sun.net.ch.Net defines static methods, it should be final. RdmaNet work the same way, it doesn't need to extend Net.

The RdmaSocketOptions API mostly looks okay. The only thing that seems to be missed is some hints as to the valid ranges for the RMDA send/receive queue size. Does setOption(RMDA_RQSIZE, 0) or setOption(RMDA_RQSIZE, -1) make sense for example. It's okay to specify the upper limit as implementation specific, it's the 0 and negative values that aren't clear.

In RdmaSocketOptions class description then I assume "The rsocket implementaiton is Linux only" can be dropped or converted to an API note.

One implementation nit is that it looks like loadRdmaFuncs will be called multiple times. I assume this should have a guard so that it only executes once.

We touched on IPv6 addresses in some of the early discussions here - can you summarize what the support is?

That's all I have for now.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20181114/a3004881/attachment-0001.html>


More information about the nio-dev mailing list