Skip to contentSkip to conversation

rping is not resolving ipv6 addresses

ewg Or Gerlitz 5 participants 9 messages Oct 9, 2009 – Oct 12, 2009 10 messages not in the archive InfiniBand

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Or Gerlitz

author
#4 lore raw
Quoted 1 line · David J. Wilder

I added an option to rping to specify a source address and supply it to

patch?

Quoted 5 lines

rdma_resolve_addr(), but now it is failing rdma_resolve_route().

$ ./rping -d  -c -v -a fe80::202:c903:1:1925 -i fe80::202:c903:1:28ed
cma_event type RDMA_CM_EVENT_ADDR_RESOLVED cma_id 0x100213d0 (parent)
cma_event type RDMA_CM_EVENT_ROUTE_ERROR cma_id 0x100213d0 (parent)
cma event RDMA_CM_EVENT_ROUTE_ERROR, error -22

what does the neighbour info (ip neigh show | grep 1925) shows after running rping?
can you do ipoib ping and ping6 to the fe80::202:c903:1:1925 host?

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 15ddcffd0910091353w51bddc60w8452ca107de296fb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw
Quoted 5 lines · Or Gerlitz
Quoted 1 line · David J. Wilder

I added an option to rping to specify a source address and supply it to

patch?

Quoted 8 lines
Quoted 5 lines

rdma_resolve_addr(), but now it is failing rdma_resolve_route().

$ ./rping -d  -c -v -a fe80::202:c903:1:1925 -i fe80::202:c903:1:28ed
cma_event type RDMA_CM_EVENT_ADDR_RESOLVED cma_id 0x100213d0 (parent)
cma_event type RDMA_CM_EVENT_ROUTE_ERROR cma_id 0x100213d0 (parent)
cma event RDMA_CM_EVENT_ROUTE_ERROR, error -22

what does the neighbour info (ip neigh show | grep 1925) shows after running rping?

If I run rping without my rping change to add the source address to rdma_resolve_address(), ip neigh show gives:
fe80::202:c903:1:1925 dev eth1 FAILED

Notice that interface is incorrect, it should be ib0. tcpdump showed the neighbor-discovery sent out the eth0 interface.

Running with my rping change to specify the local-link address of my ib0 interface "ip neigh show" never shows any entry for fe80::202:c903:1:1925

Quoted 3 lines

can you do ipoib ping and ping6 to the fe80::202:c903:1:1925 host?

Or.

Yes ping6 will work but I must specify the interface to use:
ping6 fe80::202:c903:1:1925%ib0

Here is the patch to rping to allow the source address to be specified. I am not sure this is the correct approach to fix this.

rping.c renamed from rping.c.orig +6 -2
@@ -144,6 +144,7 @@ struct rping_cb {
 	sem_t sem;
 
 	struct sockaddr_storage sin;
+	struct sockaddr_storage src;
 	uint16_t port;			/* dst port in NBO */
 	int verbose;			/* verbose logging */
 	int count;			/* ping count */
@@ -1003,7 +1004,7 @@ static int rping_bind_client(struct rpin
 
 	DEBUG_LOG("rping_bind_client: about to call rdma_resolve_addr\n");
 
-	ret = rdma_resolve_addr(cb->cm_id, NULL, (struct sockaddr *) &cb->sin, 2000);
+	ret = rdma_resolve_addr(cb->cm_id, &cb->src, (struct sockaddr *) &cb->sin, 2000);
 	if (ret) {
 		fprintf(stderr, "rdma_resolve_addr error %d\n", ret);
 		return ret;
@@ -1131,11 +1132,14 @@ int main(int argc, char *argv[])
 	sem_init(&cb->sem, 0, 0);
 
 	opterr = 0;
-	while ((op=getopt(argc, argv, "a:Pp:C:S:t:scvVd")) != -1) {
+	while ((op=getopt(argc, argv, "a:i:Pp:C:S:t:scvVd")) != -1) {
 		switch (op) {
 		case 'a':
 			ret = get_addr(optarg, (struct sockaddr *) &cb->sin);
 			break;
+		case 'i':
+			ret = get_addr(optarg, (struct sockaddr *) &cb->src);
+			break;
 		case 'P':
 			persistent_server = 1;
 			break;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#8 lore raw
Quoted 4 lines · David J. Wilder

If I run rping without my rping change to add the source address to rdma_resolve_address(),  ip neigh show gives:  fe80::202:c903:1:1925 dev eth1  FAILED Notice that interface is incorrect, it should be ib0. tcpdump showed the neighbor-discovery sent out the eth0 interface.

yes, this is as of what Roland explained.

Quoted 2 lines

Running with my rping change to specify the local-link address of my ib0 interface "ip neigh show" never shows any entry for fe80::202:c903:1:1925

mmm... weird, run your rping with tcp dump in another screen and see if ND takes place

Quoted 1 line

ping6 will work but I must specify the interface to use: ping6 fe80::202:c903:1:1925%ib0

after the tcpdump experiment, run ping6 and immediatly following that or in parallel on another window run rping
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
In reply to a message not in the archive
Quoted 5 lines · David J. Wilder

Yes ping6 will work but I must specify the interface to use:
ping6 fe80::202:c903:1:1925%ib0

Here is the patch to rping to allow the source address to be specified. I am not sure this is the correct approach to fix this.

It is not, IPv6 link local addresses must be scoped. rping is parsing the address with getaddrinfo, that does correctly set the sin6_scope_id value in the sockaddr.

rdma_resolve_addr (and likely the underlying kernel component) must respect this when dealing with link local scope addresses.

rmda_resolve_addr should fail if a link local IPv6 address is provided without scope, like the normal IP stack:

connect(3, {sa_family=AF_INET6, sin6_port=htons(1025), inet_pton(AF_INET6, "fe80::202:c903:1:1925", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EINVAL (Invalid argument)

So this is two bugs in the rdma cm, rping is correct as is..

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20091009224604.GG5191-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org

#11 lore raw
Quoted 5 lines

rdma_resolve_addr (and likely the underlying kernel component) must respect this when dealing with link local scope addresses.

rmda_resolve_addr should fail if a link local IPv6 address is provided without scope, like the normal IP stack:

The rdma cm was never fully coded or tested for ipv6 support.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 0AA9B9870A0545E6BCCF3A5EF4BAB34E-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org

#13 lore raw
Quoted 1 line · Sean Hefty

The rdma cm was never fully coded or tested for ipv6 support.

Sean, even if not fully coded/tested, some work has been done, e.g commits 38617c64 "RDMA/addr: Add support for translating IPv6 addresses" and 1f5175ad "RDMA/cma: Add IPv6 support". I suggest we'll try to see what does it take to make this better or even fully support ipv6.

Jason, can you restate what are the two problems you saw from David's reports? the 1st was related to scope in link-local addresses, and what's the 2nd?

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4AD18944.1040404-hKgKHo2Ms0FWk0Htik3J/[email protected]

#15 lore raw
Quoted 8 lines · Or Gerlitz
Quoted 1 line · Sean Hefty

The rdma cm was never fully coded or tested for ipv6 support.

Sean, even if not fully coded/tested, some work has been done, e.g commits 38617c64 "RDMA/addr: Add support for translating IPv6 addresses" and 1f5175ad "RDMA/cma: Add IPv6 support". I suggest we'll try to see what does it take to make this better or even fully support ipv6.

Or is right, these are kernel bugs, if nobody is able to work on them then I think we all have to accept that these parts of the OFA stack are unfinished and unmaintained - and see if that can be delt with.

Quoted 3 lines

Jason, can you restate what are the two problems you saw from David's reports? the 1st was related to scope in link-local addresses, and what's the 2nd?

The kernel must not accept a link local address with 0 scope id

When using link local addresses the kernel must bind to the interface index in the scope id.

The scope is ignored for other addresses scopes.

The rules will be more complex if a source and dest are specified, in that case the scopes must match.

This is the same basic problem as the other issues regarding ND and route resolution, the RDMA CM does not follow the same procedures as TCP does, and the variations produce bugs.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#16 lore raw
In reply to a message not in the archive
Quoted 11 lines · Jason Gunthorpe
Quoted 5 lines · David J. Wilder

Yes ping6 will work but I must specify the interface to use:
ping6 fe80::202:c903:1:1925%ib0

Here is the patch to rping to allow the source address to be specified. I am not sure this is the correct approach to fix this.

It is not, IPv6 link local addresses must be scoped. rping is parsing the address with getaddrinfo, that does correctly set the sin6_scope_id value in the sockaddr.

ping6 is scoping the address (setting sin6_scope_id) by hand. So rping should do the same thing.

Quoted 10 lines

rdma_resolve_addr (and likely the underlying kernel component) must respect this when dealing with link local scope addresses.

rmda_resolve_addr should fail if a link local IPv6 address is provided without scope, like the normal IP stack:

connect(3, {sa_family=AF_INET6, sin6_port=htons(1025), inet_pton(AF_INET6, "fe80::202:c903:1:1925", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EINVAL (Invalid argument)

So this is two bugs in the rdma cm, rping is correct as is..

It may be correct, but not functional with link-local address.

Quoted 2 lines

Jason

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#18 lore raw
Quoted 6 lines · David J. Wilder
Quoted 3 lines

It is not, IPv6 link local addresses must be scoped. rping is parsing the address with getaddrinfo, that does correctly set the sin6_scope_id value in the sockaddr.

ping6 is scoping the address (setting sin6_scope_id) by hand. So rping should do the same thing.

getaddrinfo already sets sin6_scope_id. Newish iputils ping6 also uses getaddrinfo and doesn't touch the sin6_scope_id except in some specialized cases.

Quoted 3 lines
Quoted 1 line

So this is two bugs in the rdma cm, rping is correct as is..

It may be correct, but not functional with link-local address.

Like I said, the RDMA CM kernel component has the bugs, not rping..

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html