linux/net/rds
Sean Hefty 6f8372b69c RDMA/cm: fix loopback address support
The RDMA CM is intended to support the use of a loopback address
when establishing a connection; however, the behavior of the CM
when loopback addresses are used is confusing and does not always
work, depending on whether loopback was specified by the server,
the client, or both.

The defined behavior of rdma_bind_addr is to associate an RDMA
device with an rdma_cm_id, as long as the user specified a non-
zero address.  (ie they weren't just trying to reserve a port)
Currently, if the loopback address is passed to rdam_bind_addr,
no device is associated with the rdma_cm_id.  Fix this.

If a loopback address is specified by the client as the destination
address for a connection, it will fail to establish a connection.
This is true even if the server is listing across all addresses or
on the loopback address itself.  The issue is that the server tries
to translate the IP address carried in the REQ message to a local
net_device address, which fails.  The translation is not needed in
this case, since the REQ carries the actual HW address that should
be used.

Finally, cleanup loopback support to be more transport neutral.
Replace separate calls to get/set the sgid and dgid from the
device address to a single call that behaves correctly depending
on the format of the device address.  And support both IPv4 and
IPv6 address formats.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>

[ Fixed RDS build by s/ib_addr_get/rdma_addr_get/  - Roland ]

Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-11-19 13:26:06 -08:00
..
af_rds.c net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
bind.c RDS: Add a debug message suggesting to load transport modules 2009-08-23 19:13:14 -07:00
cong.c RDS: Export symbols from core RDS 2009-08-23 19:13:07 -07:00
connection.c RDS: Export symbols from core RDS 2009-08-23 19:13:07 -07:00
ib_cm.c RDS/IB: Drop connection when a fatal QP event is received 2009-07-20 08:03:11 -07:00
ib_rdma.c RDS/IB: Always use PAGE_SIZE for FMR page size 2009-07-20 08:03:13 -07:00
ib_recv.c RDS/IB: Rename byte_len to data_len to enhance readability 2009-07-20 08:03:07 -07:00
ib_ring.c RDS/IW+IB: Set recv ring low water mark to 1/2 full. 2009-04-09 17:21:14 -07:00
ib_send.c RDS/IW+IB: Allow max credit advertise window. 2009-04-09 17:21:17 -07:00
ib_stats.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-09-15 09:39:44 -07:00
ib_sysctl.c RDS/IB: Disable flow control in sysctl and explain why 2009-07-20 08:03:10 -07:00
ib.c RDMA/cm: fix loopback address support 2009-11-19 13:26:06 -08:00
ib.h RDS/IB: Always use PAGE_SIZE for FMR page size 2009-07-20 08:03:13 -07:00
info.c RDS: Export symbols from core RDS 2009-08-23 19:13:07 -07:00
info.h RDS: Info and stats 2009-02-26 23:39:25 -08:00
iw_cm.c RDS: Use spinlock to protect 64b value update on 32b archs 2009-04-02 00:52:22 -07:00
iw_rdma.c RDS/IW: Remove page_shift variable from iwarp transport 2009-07-20 08:03:14 -07:00
iw_recv.c RDS/IW+IB: Allow max credit advertise window. 2009-04-09 17:21:17 -07:00
iw_ring.c RDS/IW+IB: Set recv ring low water mark to 1/2 full. 2009-04-09 17:21:14 -07:00
iw_send.c RDS/IW: Remove page_shift variable from iwarp transport 2009-07-20 08:03:14 -07:00
iw_stats.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-09-15 09:39:44 -07:00
iw_sysctl.c RDS: Add iWARP support 2009-02-26 23:39:33 -08:00
iw.c RDMA/cm: fix loopback address support 2009-11-19 13:26:06 -08:00
iw.h RDS/IW: Remove page_shift variable from iwarp transport 2009-07-20 08:03:14 -07:00
Kconfig RDS: Modularize RDMA and TCP transports 2009-08-23 19:13:09 -07:00
loop.c RDS: loopback 2009-02-26 23:39:26 -08:00
loop.h RDS: loopback 2009-02-26 23:39:26 -08:00
Makefile RDS: Modularize RDMA and TCP transports 2009-08-23 19:13:09 -07:00
message.c RDS: Export symbols from core RDS 2009-08-23 19:13:07 -07:00
page.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-09-15 09:39:44 -07:00
rdma_transport.c RDS: Modularize RDMA and TCP transports 2009-08-23 19:13:09 -07:00
rdma_transport.h RDS: Common RDMA transport code 2009-02-26 23:39:33 -08:00
rdma.c RDS: use get_user_pages_fast() 2009-04-09 17:21:20 -07:00
rdma.h RDS: RDMA support 2009-02-26 23:39:29 -08:00
rds.h RDS: Track transports via an array, not a list 2009-08-23 19:13:12 -07:00
recv.c RDS: Export symbols from core RDS 2009-08-23 19:13:07 -07:00
send.c RDS: Export symbols from core RDS 2009-08-23 19:13:07 -07:00
stats.c RDS: Export symbols from core RDS 2009-08-23 19:13:07 -07:00
sysctl.c RDS: sysctls 2009-02-26 23:39:26 -08:00
tcp_connect.c RDS: Add TCP transport to RDS 2009-08-23 19:13:02 -07:00
tcp_listen.c RDS: Add TCP transport to RDS 2009-08-23 19:13:02 -07:00
tcp_recv.c RDS: Add TCP transport to RDS 2009-08-23 19:13:02 -07:00
tcp_send.c RDS: Add TCP transport to RDS 2009-08-23 19:13:02 -07:00
tcp_stats.c RDS: Add TCP transport to RDS 2009-08-23 19:13:02 -07:00
tcp.c RDS: Track transports via an array, not a list 2009-08-23 19:13:12 -07:00
tcp.h RDS: Add TCP transport to RDS 2009-08-23 19:13:02 -07:00
threads.c RDS: Export symbols from core RDS 2009-08-23 19:13:07 -07:00
transport.c RDS: Track transports via an array, not a list 2009-08-23 19:13:12 -07:00