From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: "Hefty, Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "linux-rdma
(linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
Subject: failure to get gid with rdma_bind_addr with >= 3.10 kernels
Date: Sun, 10 Nov 2013 13:10:41 +0200 [thread overview]
Message-ID: <527F69B1.9070701@mellanox.com> (raw)
In-Reply-To: <527F6896.1080802-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2803 bytes --]
Hi Sean,
So somewhere between 3.10 and 3.11 a little bug was introduced in
ucma/cma that when
you bind to IPv4 address the resulted device address returned from the
kernel is all zeros.
You can use the attached program to reproduce, just run it and provide
an IPv4 address of IPoIB NIC
--> with 3.10
$ ./rb 192.168.20.47
event_channel: 0x6093c0
cm_id: 0x602cb0
sgid: fe 80 00 00 00 00 00 00 00 02 c9 03 00 e9 c0 81
--> with 3.12
$ ./rb 192.168.20.17
event_channel: 0x6093c0
cm_id: 0x6034c0
sgid: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
There many commits for the 3.11 AF_IB merge, hope you can dig it out
quickly..
Or.
linux-2.6]# git log --oneline v3.10.. drivers/infiniband/core/cma.c
drivers/infiniband/core/ucma.c
7c049d0 Merge tag 'rdma-for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
27703bb Merge tag 'PTR_RET-for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
24d44a3 RDMA/cma: Add IPv6 support for iWARP
5eb695c RDMA/cma: Only call cma_save_ib_info() for CM REQs
e511d1a RDMA/cma: Fix accessing invalid private data for UD
8fb488d RDMA/cma: Fix gcc warning
8c6ffba PTR_RET is now PTR_ERR_OR_ZERO(): Replace most.
ce117ff RDMA/cma: Export AF_IB statistics
5bc2b7b RDMA/ucma: Allow user space to specify AF_IB when joining multicast
209cf2a RDMA/ucma: Allow user space to pass AF_IB into resolve
eebe4c3 RDMA/ucma: Allow user space to bind to AF_IB
05ad945 RDMA/ucma: Name changes to indicate only IP addresses supported
edaa7a5 RDMA/ucma: Add ability to query GID addresses
cf53936 RDMA/cma: Export cma_get_service_id()
ac53b26 RDMA/ucma: Support querying when IB paths are not reversible
ee7aed4 RDMA/ucma: Support querying for AF_IB addresses
94d0c93 RDMA/cma: Only listen on IB devices when using AF_IB
5c43813 RDMA/cma: Set qkey for AF_IB
e8160e1 RDMA/cma: Expose private data when using AF_IB
fbaa1a6 RDMA/cma: Merge cma_get/save_net_info
01602f1 RDMA/cma: Remove unused SDP related code
496ce3c RDMA/cma: Add support for AF_IB to cma_get_service_id()
f68194c RDMA/cma: Add support for AF_IB to rdma_resolve_route()
f17df3b RDMA/cma: Add support for AF_IB to rdma_resolve_addr()
4ae7152 RDMA/cma: Verify that source and dest sa_family are the same
b0569e4 RDMA/cma: Restrict AF_IB loopback to binding to IB devices only
f475383 RDMA/cma: Add helper functions to return id address information
6a3e362 RDMA/cma: Do not modify sa_family when setting loopback address
680f920 RDMA/cma: Allow user to specify AF_IB when binding
58afdcb RDMA/cma: Update port reservation to support AF_IB
ef56086 IB/addr: Add AF_IB support to ip_addr_size
2e2d190 RDMA/cma: Include AF_IB in loopback and any address checks
c8dea2f9 RDMA/cma: Allow enabling reuseaddr in any state
351638e net: pass info struct via netdevice notifier
[-- Attachment #2: rb.c --]
[-- Type: text/plain, Size: 1348 bytes --]
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <errno.h>
#include <string.h>
#include <rdma/rdma_cma.h>
int main( int argc, char **argv ) {
struct rdma_cm_id * cm_id = NULL;
struct rdma_event_channel * event_channel = NULL;
int i = 0;
struct sockaddr_in sa;
if( argc < 2 ) {
fprintf( stderr, "Specify interface address\n" );
exit(1);
}
if( !inet_aton( argv[1], &sa.sin_addr.s_addr ) ) {
fprintf( stderr, "Address invalid: %s\n", argv[1] );
exit(1);
}
sa.sin_port = 0;
sa.sin_family = AF_INET;
event_channel = rdma_create_event_channel();
if( !event_channel ) {
fprintf( stderr, "rdma_create_event_channel failed" );
exit(1);
}
printf( "event_channel: %p\n", event_channel );
if( rdma_create_id( event_channel, &cm_id, 0, RDMA_PS_IPOIB ) ) {
fprintf( stderr, "rdma_create_id failed (%s)", strerror(errno) );
exit(1);
}
printf( "cm_id: %p\n", cm_id );
if( rdma_bind_addr( cm_id, (void*)&sa ) ) {
fprintf( stderr, "rdma_bind_addr failed (%s)", strerror(errno) );
exit(1);
}
uint8_t * x = (uint8_t*)&cm_id->route.addr.addr.ibaddr.sgid;
size_t sz = sizeof( cm_id->route.addr.addr.ibaddr.sgid );
printf( "sgid: " );
for( i = 0; i < sz; ++i ) {
printf( "%2.2x ", x[i] );
}
printf( "\n" );
return 0;
}
next parent reply other threads:[~2013-11-10 11:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <527F6896.1080802@mellanox.com>
[not found] ` <527F6896.1080802-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-11-10 11:10 ` Or Gerlitz [this message]
[not found] ` <527F69B1.9070701-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-11-10 11:14 ` failure to get gid with rdma_bind_addr with >= 3.10 kernels Or Gerlitz
[not found] ` <527F6A8F.1030506-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-11-11 16:45 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237388CF6F30-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-11-11 17:09 ` Christoph Lameter
2013-11-11 17:40 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237388CF6F78-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-11-11 18:14 ` Christoph Lameter
[not found] ` <00000142485f86e5-c3027528-9892-4d5c-8d72-0ed5f98666c4-000000-p/GC64/jrecnJqMo6gzdpkEOCMrvLtNR@public.gmane.org>
2013-11-11 18:46 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237388CF6FD0-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-11-11 19:41 ` Christoph Lameter
2013-11-12 7:08 ` Or Gerlitz
[not found] ` <5281D3E0.70203-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-11-13 20:15 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237388D02FEC-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-11-13 22:38 ` Or Gerlitz
2014-01-02 9:39 ` Or Gerlitz
[not found] ` <52C533C0.3070103-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-01-02 15:17 ` Yann Droneaud
[not found] ` <1388675827.22995.7.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-01-02 16:33 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237388D0FBFA-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-01-02 16:59 ` Yann Droneaud
2014-01-02 17:04 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237388D0FCD0-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-01-05 7:25 ` Or Gerlitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=527F69B1.9070701@mellanox.com \
--to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox