adding rsockets support into JDK
Lu, Yingqi
yingqi.lu at intel.com
Tue Nov 20 17:08:49 UTC 2018
Hi Chris,
The IPv6 addresses work with rsocket when both server and client use IPv6 addresses. However, the IPv4-mapped addresses does not work. If IPv6 is enabled on RDMA adaptors (which I believe it does in majority of the cases), current JDK uses IPv6 by default. Then -Djava.net.preferIPv4Stack=true is needed if applications use IPv4 addresses.
I think SDP has a similar limitation. https://docs.oracle.com/javase/tutorial/sdp/sockets/issues.html
Please let me know if you have any further questions.
Thanks,
Lucy
>-----Original Message-----
>From: Chris Hegarty [mailto:chris.hegarty at oracle.com]
>Sent: Tuesday, November 20, 2018 4:55 AM
>To: Lu, Yingqi <yingqi.lu at intel.com>
>Cc: Brian Burkhalter <brian.burkhalter at oracle.com>; Alan Bateman
><Alan.Bateman at oracle.com>; Viswanathan, Sandhya
><sandhya.viswanathan at intel.com>; Aundhe, Shirish
><shirish.aundhe at intel.com>; nio-dev at openjdk.java.net; Kaczmarek, Eric
><eric.kaczmarek at intel.com>
>Subject: Re: adding rsockets support into JDK
>
>Lucy,
>
>Thank you for the update. I’m still reviewing, but just on one point below.
>
>> On 20 Nov 2018, at 04:06, Lu, Yingqi <yingqi.lu at intel.com> wrote:
>>
>> Hi Chris,
>>
>> Thank you for your quick feedback. I have uploaded version 18 of the
>> patch at http://cr.openjdk.java.net/~ylu/8195160.18/
>>
>> In this version, I have changed following items according to your suggestions:
>>
>> ...
>> 4. In terms of adding -Djava.net.preferIPv4Stack=true for all the tests, I
>tested couple test cases without the flag and they return error. I think the
>reason is that Java uses IPv6 by default if kernel supports it. However rsocket
>does not support IPv4-mapped addresses. That is the reason why the flag is
>needed. Please let me know if there is anything I miss here though.
>
>Maybe I'm missing something, but if the rsocket implementation on Linux
>does not support IPv6 then why not just set the domain to AF_INET in the
>code. That is one implication of what is being achieved with
>`java.net.preferIPv4Stack `. For example in
>src/jdk.net/linux/native/libextnet/LinuxRdmaSocketImpl.c
>
> JNIEXPORT void JNICALL
>
>Java_jdk_internal_net_rdma_LinuxRdmaSocketImpl_rdmaSocketCreate(JNIE
>nv *env, jobject this,
> jboolean stream, jobject impl) {
> jobject fdObj, ssObj;
> int fd;
> int type = (stream ? SOCK_STREAM : SOCK_DGRAM);
> int domain = ipv6_available() ? AF_INET6 : AF_INET; // <<< HERE
>
> ...
> if ((fd = rs_socket(domain, type, 0)) == -1) {
> ...
> }
>
>Or does IPv6 work ok, just not for IPv4-mapped addresses? I'm trying to
>understand if IP protocol-specific configuration should be exposed in the
>factories for creating IP protocol-specific sockets and channels, similar to
>`DatagramChannel::open(ProtocolFamily)`.
>
>-Chris.
More information about the nio-dev
mailing list