adding rsockets support into JDK
yingqi.lu at intel.com
Wed Nov 28 08:11:55 UTC 2018
Please find version 20 of the patch available at http://cr.openjdk.java.net/~ylu/8195160.20/
In this version, I did following modifications:
1. Modified factory methods inside RdmaSockets, to specify protocol family for opening RDMA socket and socket channel
2. Modified CSR https://bugs.openjdk.java.net/browse/JDK-8205186 with updated factory methods. I included a link (http://cr.openjdk.java.net/~ylu/rsocket_docs/api/jdk.net/jdk/net/package-summary.html) to the Javadoc inside CSR. I also attached the zip file of the Javadoc as well.
3. Merged changes from version 19, which includes:
a. Instead of using "librdmacm.so", "librdmacm.so.1" is used for the library name.
b. Catch java.lang.ExceptionInInitializerError when rdma library is not installed in the system. A UOE is thrown instead.
c. In the tests, modified RdmaSocketsTest.java to double check UOE on all the platforms when rdma library is not installed.
I tested all the test cases under test/jdk/jdk/net/RdmaSockets/rsocket/ on a Linux system with a RDMA NIC installed and configured. I also tested with local micro workloads on both IPv4 and IPv6 addresses in the same system. All the tests passed.
1. All the test cases under test/jdk/jdk/net/RdmaSockets/rsocket/ are currently only for IPv4 addresses. Will add some IPv6 tests soon.
Please review the patch/CSR and let me know your feedback.
>From: nio-dev [mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of Lu,
>Sent: Saturday, November 24, 2018 10:12 AM
>To: Alan Bateman <Alan.Bateman at oracle.com>; Chris Hegarty
><chris.hegarty at oracle.com>
>Cc: Viswanathan, Sandhya <sandhya.viswanathan at intel.com>; nio-
>dev at openjdk.java.net; Aundhe, Shirish <shirish.aundhe at intel.com>; Kaczmarek,
>Eric <eric.kaczmarek at intel.com>
>Subject: RE: adding rsockets support into JDK
>I believe that Linux-rdma mailing list is the right place to report the issue and I did
>report it early March this year. Details please refer to . I just sent another
>email to the mailing list again with more debugging information.
>At the meantime, I will look into DatagramChannel for the example of using
>ProtocolFamily. I am not familiar with Datagram Sockets/Channel. I will need
>some help here for sure :)
>>From: Alan Bateman [mailto:Alan.Bateman at oracle.com]
>>Sent: Saturday, November 24, 2018 1:12 AM
>>To: Lu, Yingqi <yingqi.lu at intel.com>; Chris Hegarty
>><chris.hegarty at oracle.com>
>>Cc: Viswanathan, Sandhya <sandhya.viswanathan at intel.com>; nio-
>>dev at openjdk.java.net; Aundhe, Shirish <shirish.aundhe at intel.com>;
>>Kaczmarek, Eric <eric.kaczmarek at intel.com>
>>Subject: Re: adding rsockets support into JDK
>>On 23/11/2018 21:38, Lu, Yingqi wrote:
>>> Hi Alan/Chris,
>>> I am not sure when IPv4-mapped addresses will be supported in rsocket.
>>> Based on the suggestions earlier this week, I completed the version
>>> 19 of the patch at http://cr.openjdk.java.net/~ylu/8195160.19
>>> Inside that, I have done:
>>> 1. Totally removed IPv6 support for rsocket, and removed -
>>Djava.net.preferIPv4Stack=true in all the test cases.
>>> 2. Instead of using "librdmacm.so", "librdmacm.so.1" is used for the
>>> 3. Caught java.lang.ExceptionInInitializerError when rdma library is
>>> not installed
>>in the system. A UOE is thrown instead.
>>> 4. In the tests, modified both RsocketTest.java RdmaSocketsTest.java
>>> to double
>>check UOE on all the platforms when rdma library is not installed.
>>> Then, I just saw your emails on IPv6 handling :-) I can see both
>>> advantages and
>>disadvantages of either keeping or removing IPv6 support for rsocket,
>>and totally fine whichever direction you decide. If we want to use
>>protocol family approach, would you please point me to an example so that I
>>I searched the archives of linux-rdma mailing but couldn't find any
>>discussion on this topic. I wonder if we should post something there
>>(assuming it's the right list) to see if this has been explored. We are
>>making decision on a JDK-specific API so it's important to have as much
>>information as possible. If we can't get the information then the
>>initial factory methods will need a ProtocolFamily as Chris points out.
>>The alternative, which is to take a chance that support for IPv4-mapped
>>IPv6 addresses will be added in the future, means we could get stuck
>>with factory methods that create SocketChannel/Sockets that are forever
>>IPv4-only. Adding factory methods that take a protocol family does not
>>preclude you from adding no-arg factory methods in the future of course.
>>The only example of this type of thing in the JDK is DatagramChannel
>>which has a factory method to create a datagram channel to use a specific
>>This method is needed for multicasting as there is no guarantee that a
>>DatagramChannel can join an IPv4 multicast group when IPv6 is enabled.
>>The disadvantage of this API is that multicasting applications need to
>>know at DatagramChannel create time if it will be used to join an IPv4
>>or IPv6 multicast group. If you change the RdmaSockets.openXXX methods
>>to do the same then it would be similar.
>>It may be okay in libraries where the creation, binding, and connecting
>>are the same library but problematic if you want to pass an unbound or
>>not-connected SocketChannel or Socket to a library or other part of a
>>system that expects to bind or connect.
More information about the nio-dev