adding rsockets support into JDK
Chris Hegarty
chris.hegarty at oracle.com
Tue Nov 20 12:54:58 UTC 2018
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(JNIEnv *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