]> git.openfabrics.org - ~shefty/librdmacm.git/log
~shefty/librdmacm.git
12 years agorsocket: Add sample application to copy files over rsockets
Sean Hefty [Thu, 1 Dec 2011 20:52:28 +0000 (12:52 -0800)]
rsocket: Add sample application to copy files over rsockets

rcopy will copy files from a source system to a specified remote
server.  It's essentially a really dumb FTP type program that can
be used to quickly transfer files between systems, which can be
useful to verify data integrity.

(It was easier to create this program than modify an existing FTP
client and server application, which was my first choice.  Fork
support is difficult.)

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agorsocket: Add example program that uses rsocket
Sean Hefty [Thu, 8 Dec 2011 19:30:12 +0000 (11:30 -0800)]
rsocket: Add example program that uses rsocket

rstream provides an example that uses either rsocket or socket
APIs.  The latter allows rstream to be used to verify rsocket
behavior compared to socket.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Define streaming over RDMA interface (rsockets)
Sean Hefty [Tue, 3 Apr 2012 21:25:04 +0000 (14:25 -0700)]
librdmacm: Define streaming over RDMA interface (rsockets)

Introduces a new set of APIs that support a byte streaming interface
over RDMA devices.  The new interface matches sockets, except that all
function calls are prefixed with an 'r'.

The following functions are defined:

rsocket
rbind, rlisten, raccept, rconnect
rshutdown, rclose
rrecv, rrecvfrom, rrecvmsg, rread, rreadv
rsend, rsendto, rsendmsg, rwrite, rwritev
rpoll, rselect
rgetpeername, rgetsockname
rsetsockopt, rgetsockopt, rfcntl

Functions take the same parameters as that use for sockets.  The
follow capabilities and flags are supported at this time:

PF_INET, PF_INET6, SOCK_STREAM, IPPROTO_TCP
MSG_DONTWAIT, MSG_PEEK
SO_REUSEADDR, TCP_NODELAY, SO_ERROR, SO_SNDBUF, SO_RCVBUF
O_NONBLOCK

The rpoll call supports polling both rsockets and normal fd's.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agoucmatose: Fix segfault on address error
Sagi Grimberg [Wed, 4 Apr 2012 21:36:49 +0000 (14:36 -0700)]
ucmatose: Fix segfault on address error

Client connect_events() shoudl fail if it received some error,
otherwise the program will try to reach a non-existent QP
resource resulting in a segfault.  Return an error from
cma_handler() if we had a connection error.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agoAutomatically detect if ibacm is installed
Sean Hefty [Fri, 2 Mar 2012 01:13:58 +0000 (17:13 -0800)]
Automatically detect if ibacm is installed

If the ibacm header file is available, automatically have the
librdmacm configured to use it.  This removes the --with-ib_acm
configure option.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agoUpdate rdma_disconnect to indicate both sides should call it.
Sean Hefty [Fri, 2 Mar 2012 17:17:48 +0000 (09:17 -0800)]
Update rdma_disconnect to indicate both sides should call it.

rdma_disconnect should be called from both sides to quickly disconnect.
Clarify this in the man page.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmamcm: Check for valid route in ucma_set_ib_route
Sean Hefty [Fri, 30 Sep 2011 21:37:02 +0000 (14:37 -0700)]
librdmamcm: Check for valid route in ucma_set_ib_route

ucma_set_ib_route will call rdma_getaddrinfo to obtain IB path
information.  However, rdma_getaddrinfo will return success,
but not provide routing data if no route can be found (the IB
ACM service is not running).  In this case, we can call
rdma_set_option without a valid route.  Although the kernel
will trap this and fail, we can detect the error in the library.
This will speed up the connection rate if IB ACM is not in use.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Fix warning 'resolve_msg' breaks aliasing rules
Sean Hefty [Fri, 30 Sep 2011 19:02:19 +0000 (12:02 -0700)]
librdmacm: Fix warning 'resolve_msg' breaks aliasing rules

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Return an error if user specifies AF_IB but it is not supported
Sean Hefty [Fri, 30 Sep 2011 16:17:04 +0000 (09:17 -0700)]
librdmacm: Return an error if user specifies AF_IB but it is not supported

If the user specifies an AF_IB address into rdma_bind_addr,
rdma_resolve_addr, rdma_join_multicast, or rdma_leave_multicast,
but the kernel does not support AF_IB return an error.

Note that rdma_getaddrinfo will never return an AF_IB address to the
user unless kernel support is present.  A application would need
to construct and AF_IB address by hand before making one of the
above mentioned calls.  This check prevents overrunning the
command buffer written to the kernel.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agoudaddy: Update udaddy to use rdma_getaddrinfo
Sean Hefty [Thu, 29 Sep 2011 23:57:40 +0000 (16:57 -0700)]
udaddy: Update udaddy to use rdma_getaddrinfo

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agocmatose: Replace use of getaddrinfo with rdma_getaddrinfo
Sean Hefty [Thu, 29 Sep 2011 21:23:47 +0000 (14:23 -0700)]
cmatose: Replace use of getaddrinfo with rdma_getaddrinfo

Now that rdma_getaddrinfo exists, use it rather than getaddrinfo.
This will eventually allow us to specify native IB addresses into
cmatose once AF_IB support is there.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Report AF_IB as second rdma_addrinfo
Sean Hefty [Wed, 28 Sep 2011 21:34:01 +0000 (14:34 -0700)]
librdmacm: Report AF_IB as second rdma_addrinfo

If AF_IB is supported, the librdmacm will attempt to convert
AF_INET or AF_INET6 to AF_IB.  Rather than replacing the
AF_INET/6 rdma_addrinfo, provide the AF_IB addresses as a
second rdma_addrinfo linked from the AF_INET/6 version.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Set errno correctly in ucma_complete
Sean Hefty [Fri, 2 Mar 2012 01:01:41 +0000 (17:01 -0800)]
librdmacm: Set errno correctly in ucma_complete

The status value is negative, convert it to positive before setting errno.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agordma_verbs: Set errno correctly in rdma_get_send/recv_comp
Sean Hefty [Fri, 2 Mar 2012 01:01:39 +0000 (17:01 -0800)]
rdma_verbs: Set errno correctly in rdma_get_send/recv_comp

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agoMerge branch 'sor'
Sean Hefty [Thu, 15 Dec 2011 00:40:52 +0000 (16:40 -0800)]
Merge branch 'sor'

12 years agolibrdmacm: Update web site and email addresses
Sean Hefty [Thu, 15 Dec 2011 00:38:45 +0000 (16:38 -0800)]
librdmacm: Update web site and email addresses

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agoMerge branch 'sor'
Sean Hefty [Mon, 12 Dec 2011 19:28:57 +0000 (11:28 -0800)]
Merge branch 'sor'

12 years agoudaddy/ucmatose: allow easy setting of tos in hex
Or Gerlitz [Mon, 12 Dec 2011 19:23:59 +0000 (11:23 -0800)]
udaddy/ucmatose: allow easy setting of tos in hex

Under IBoE, the 3 MSBits of the TOS map to the SL, hence letting
the user to specify them in hex makes the interface friendlier.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Return ECONNREFUSED from rdma_connect on reject
Sean Hefty [Wed, 23 Nov 2011 01:17:04 +0000 (17:17 -0800)]
librdmacm: Return ECONNREFUSED from rdma_connect on reject

Make the errno return code from rdma_connect constistent with
connect.  The underlying status value is available by reading
the event data.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agordma/cma: minor code refactoring when saving a string content
Dotan Barak [Mon, 31 Oct 2011 15:53:07 +0000 (08:53 -0700)]
rdma/cma: minor code refactoring when saving a string content

In this case, using strdup will provide a cleaner code
(and maybe a little bit faster too).

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm/udaddy: Fix resource leak in case of error
Dotan Barak [Wed, 26 Oct 2011 14:19:25 +0000 (07:19 -0700)]
librdmacm/udaddy: Fix resource leak in case of error

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Verify size of route_len
Sean Hefty [Wed, 28 Sep 2011 06:22:21 +0000 (23:22 -0700)]
librdmacm: Verify size of route_len

If the user specifies route information on input to rdma_getaddrinfo,
verify that the size of the routing data is something that we're
prepared to handle.

The routing data is only useful if IB ACM is enabled and may be
either struct ibv_path_record or struct ibv_path_data on input.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Fix duplicate free of connect
Sean Hefty [Tue, 27 Sep 2011 18:19:36 +0000 (11:19 -0700)]
librdmacm: Fix duplicate free of connect

The connect data stored with the cma_id_private is freed in
rdma_connect, since it is no longer needed.  Avoid duplicating
the free in rdma_destroy_id by checking for connect_len = 0,
rather than connect to be NULL.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agordma/verbs: Fix race polling for completions
Sean Hefty [Fri, 16 Sep 2011 19:06:40 +0000 (12:06 -0700)]
rdma/verbs: Fix race polling for completions

To avoid hanging in rdma_get_send/recv_comp, we need to rearm
the CQ inside of the while loop.  If the CQ is armed,
the HCA will write an entry to the CQ, then generate a CQ
event.  However, a caller could poll the CQ, find the entry,
then attempt to rearm the CQ before the HCA generates the CQ
event.  In this case, the rearm call (ibv_req_notify_cq) will
act as a no-op, since the HCA hasn't finished generating the
event for the previous completion.  At this point, the event
will be queued.

A call to ibv_get_cq_event will find the event, but not
a CQ entry.  The CQ is now not armed, and a call to
ibv_get_cq_event will block waiting for an event that will
never occur.

Problem was found in an rdma_cm example test under development.
The test can ping-pong messages between two applications.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agov1.0.15 v1.0.15
Sean Hefty [Wed, 14 Sep 2011 18:23:46 +0000 (11:23 -0700)]
v1.0.15

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Fix resource in rdma_migrate_id() error flow
Dotan Barak [Tue, 23 Aug 2011 19:20:56 +0000 (12:20 -0700)]
librdmacm: Fix resource in rdma_migrate_id() error flow

Prevent resource leak by destroying the event channel before returning from
function in an error flow.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Fix resource leak when CMA_CREATE_MSG_CMD_RESP fails
Sean Hefty [Mon, 22 Aug 2011 23:31:46 +0000 (16:31 -0700)]
librdmacm: Fix resource leak when CMA_CREATE_MSG_CMD_RESP fails

If resources are allocated before CMA_CREATE_MSG_CMD_RESP or
CMA_CREATE_MSG_CMD are called, and those calls fail, we need
to cleanup the resources before returning.

Fix this by changing the CMA_CREATE_MSG macros to remove the
alloca and calling return.  The request and response structures
are now declared directly on the stack.  To accomplish this,
we merge the abi header definition into each command structure.

Problem reported by: Dotan Barak <dotanb@dev.mellanox.co.il>

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agordma_xserver/client: Add new test apps
Sean Hefty [Mon, 6 Jun 2011 19:25:24 +0000 (12:25 -0700)]
rdma_xserver/client: Add new test apps

Add new versions of the rdma_server and rdma_client tests that
support other types of connections and show how to use more
RDMA features.  We keep the existing rdma_server and rdma_client
tests as simple examples.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Do not wait in rdma_accept for UD QPs
Sean Hefty [Tue, 14 Jun 2011 18:11:58 +0000 (11:11 -0700)]
librdmacm: Do not wait in rdma_accept for UD QPs

There are no additional connection events to process for UD QPs
after calling rdma_accept().  When using synchronous rdma_cm_id's,
simply return to the user after sending the reply.  Do not wait
for additional events.

This fixes a hang on the server side when setting up UD QP
communication.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Specify QP type separately from port space
Sean Hefty [Tue, 14 Jun 2011 17:06:17 +0000 (10:06 -0700)]
librdmacm: Specify QP type separately from port space

We need to know the QP type separately from the port space.  In
order to support XRC, UC, and other QP types, we use RDMA_PS_IB,
which no longer provides a 1:1 mapping between the port space
and QP type.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Abstract ibverbs SRQ creation
Sean Hefty [Mon, 6 Jun 2011 19:32:25 +0000 (12:32 -0700)]
librdmacm: Abstract ibverbs SRQ creation

Support QPs with SRQs.  If a user allocates an SRQ on an
rdma_cm_id, we post receive messages directly to the SRQ.
This also allows us to handle XRC SRQs, which may be associated
with an rdma_cm_id, but without a corresponding QP.

To handle registering memory, we store the PD associated
with an rdma_cm_id directly with the id, rather than finding
the PD using a QP pointer.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Add support for XRC qp types
Sean Hefty [Tue, 7 Jun 2011 21:10:08 +0000 (14:10 -0700)]
librdmacm: Add support for XRC qp types

Support XRC send/receive qp types.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Renumber RDMA_PS_IB to match kernel patch
Sean Hefty [Mon, 6 Jun 2011 23:24:32 +0000 (16:24 -0700)]
librdmacm: Renumber RDMA_PS_IB to match kernel patch

RDMA_PS_IB is only a placeholder and not usable yet.  Update
the assigned value to match that specified for the kernel.

Update rdma_getaddrinfo to use the port space when formatting
responses.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Limit autotools output
Sean Hefty [Mon, 20 Jun 2011 22:59:25 +0000 (15:59 -0700)]
librdmacm: Limit autotools output

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Use union with sockaddr structures
Sean Hefty [Tue, 14 Jun 2011 17:30:51 +0000 (10:30 -0700)]
librdmacm: Use union with sockaddr structures

To avoid strict aliasing compiler warnings, use an unamed union
to store the src and dst addresses.  This eliminates the need
for padding and sockaddr casts.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agolibrdmacm: Fix crash in rdma_connect
Sean Hefty [Tue, 14 Jun 2011 16:36:26 +0000 (09:36 -0700)]
librdmacm: Fix crash in rdma_connect

When using rdma_connect for UD QP lookup, there may not be any
QP associated with the rdma_cm_id.  Plus there may not be any use
for the conn_param parameter.  Allow conn_param to be optional
in this situation.  This fixes a crash exposed by rdma_xclient
sample using XRC QPs.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: Fail ucma_init if ibv_get_device_list is empty
Yann Droneaud [Fri, 27 May 2011 17:59:50 +0000 (10:59 -0700)]
librdmacm: Fail ucma_init if ibv_get_device_list is empty

From the ibv_get_device_list man page:

   ibv_get_device_list() returns the array of available RDMA devices, or
   sets errno and returns NULL if the request fails. If no devices are
   found then num_devices is set to 0, and non-NULL is returned.

The librdmacm handles the failure case, but not the case where no
devices are found.  Handle that case as well.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agordma_server: fix typo in print
Sean Hefty [Mon, 9 May 2011 22:28:53 +0000 (15:28 -0700)]
rdma_server: fix typo in print

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: define REUSEADDR option
Sean Hefty [Fri, 15 Apr 2011 19:28:22 +0000 (12:28 -0700)]
librdmacm: define REUSEADDR option

Support equivalent of SO_REUSEADDR socket option.  When specified
the rdma_cm_id will be bound to a reuseable address.  This will
allow other users to bind to that same address.  This is needed
to support lustre on clusters larger than 1024 nodes.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm/man: Size of private data for accept is 196, not 160
Sean Hefty [Fri, 1 Apr 2011 15:07:11 +0000 (08:07 -0700)]
librdmacm/man: Size of private data for accept is 196, not 160

The rdma cm header is not used on the reply.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agoDocument the fact that errno of EISCONN (Transport endpoint
Or Gerlitz [Tue, 29 Mar 2011 19:22:07 +0000 (12:22 -0700)]
Document the fact that errno of EISCONN (Transport endpoint
is already connected) isn't a failure

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm/doc: Document private data length limitations
Or Gerlitz [Mon, 28 Mar 2011 21:00:05 +0000 (14:00 -0700)]
librdmacm/doc: Document private data length limitations

Document the limitations on the user provided private data length
over Infiniband networks. These limitations are calculated by
subtracting the rdma-cm header size (see IBA Annex A11 "RDMA CM IP
Service") from IB's private data len for the REQ (rdma_connect) and
REP (rdma_accept) messages

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm/man: fixup rdma_accept documentation for responder_resources
Sean Hefty [Mon, 14 Mar 2011 22:20:09 +0000 (15:20 -0700)]
librdmacm/man: fixup rdma_accept documentation for responder_resources

Responder_resources may be greater than that specified in the
connect request, up to the maximum supported by the device.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: Document to set accept_local sysctl for loopback
Sean Hefty [Thu, 10 Mar 2011 22:29:35 +0000 (14:29 -0800)]
librdmacm: Document to set accept_local sysctl for loopback

For loopback connections between ports on a single system to work,
accept_local sysctl must be set to 1.  Add this to the readme.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agoOnly allow a user to allocate a single QP off an rdma_cm_id
Sean Hefty [Sat, 5 Mar 2011 00:13:44 +0000 (16:13 -0800)]
Only allow a user to allocate a single QP off an rdma_cm_id

Add a simple check to rdma_create_qp() to see if a QP has already been
associated with an rdma_cm_id.  Otherwise a user can allocate a
second QP with an ID, with the reference to the first QP replaced
by the second allocation.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agoUpdate rdma_join_multicast documentation to include attaching QP
Sean Hefty [Fri, 4 Mar 2011 00:50:32 +0000 (16:50 -0800)]
Update rdma_join_multicast documentation to include attaching QP

The man pages for rdma_join_multicast are not clear on how the
user can attach the QP to the multicast group.  Clarify this
behavior.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: Add a check for libpthread during librdmacm configure.
Roland Dreier [Wed, 15 Dec 2010 20:29:27 +0000 (12:29 -0800)]
librdmacm: Add a check for libpthread during librdmacm configure.

Add a check for libpthread during librdmacm configure.  This will add
libpthread to the list of libraries that librdmacm is linked to.
Currently librdmacm gets libpthread implicitly through libibverbs, but
this breaks when using a linker that does not implicitly link with such
dependencies; eg the new gold linker is such a linker:

<http://wiki.debian.org/qa.debian.org/FTBFS#A2009-11-
02Packagesfailingbecausebinutils-gold.2BAC8-indirectlinking>

Addresses: http://bugs.debian.org/555380
Addresses: https://bugs.launchpad.net/ubuntu/+source/librdmacm/+bug/687983

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years ago(no commit message)
Sean Hefty [Wed, 15 Dec 2010 20:27:23 +0000 (12:27 -0800)]

13 years agov1.0.14 v1.0.14
Sean Hefty [Mon, 29 Nov 2010 22:59:37 +0000 (14:59 -0800)]
v1.0.14

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: Support RAI_NUMERICHOST and no delay options
Sean Hefty [Mon, 6 Dec 2010 21:17:03 +0000 (13:17 -0800)]
librdmacm: Support RAI_NUMERICHOST and no delay options

Add support similar to getaddrinfo AI_NUMERICHOST.  This
indicates that lengthy address resolution protocols should
not be used.  Also allow a caller of rdma_getaddrinfo to
indicate that lengthy route resolution protocols should not
be used.

Since rdma_getaddrinfo is a synchronous call, this allows a
user to obtain locally available data only without long
delays that may block an application thread.  Callers can then
use the asynchronous librdmacm calls to complete any missing
information.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: support non-default ACM port number
Sean Hefty [Thu, 2 Dec 2010 18:15:11 +0000 (10:15 -0800)]
librdmacm: support non-default ACM port number

By default, ACM uses port 6125.  The actual port number
used is now published in /var/run/ibacm.port.  Attempt to
obtain the correct port number from here, and if that fails
revert to using the default port number of 6125.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm/rping: Make sure CQ event thread exits before destroying the CQ
Sean Hefty [Mon, 1 Nov 2010 18:12:13 +0000 (11:12 -0700)]
librdmacm/rping: Make sure CQ event thread exits before destroying the CQ

It is possible for the CQ event thread to poll the CQ after it has been
destroyed which can result in a seg fault on T3 interfaces.  This patch
waits for the thread to exit before destroying the CQ.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: fix compiler warning of void * arithmetic
Jonathan Rosser [Mon, 1 Nov 2010 16:53:35 +0000 (09:53 -0700)]
librdmacm: fix compiler warning of void * arithmetic

void * pointer arithmetic is non-standard.

Signed-off-by: Jonathan Rosser <jrosser@rd.bbc.co.uk>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: fix make install
Jonathan Rosser [Mon, 1 Nov 2010 16:38:22 +0000 (09:38 -0700)]
librdmacm: fix make install

make install fails if the include files in the install prefix
include/rdma,infiniband already exist. install claims that the <src>
and <destination> file are the same and exits with an error.

This patch modifies Makefile.am so that the rdma and infiniband include
files explicitly reference the source directory rather than the build
directory.

Also, EXTRA_DIST now only lists files that are not referenced anywhere
else in Makefile.am

Signed-off-by: Jonathan Rosser <jrosser@rd.bbc.co.uk>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: Fix autotools to include the necessary M4 files
Jason Gunthorpe [Mon, 1 Nov 2010 16:03:47 +0000 (09:03 -0700)]
librdmacm: Fix autotools to include the necessary M4 files

Otherwise running autogen.sh with a new version of autotools and then
building on a system with an older version tends to explode.
Unfortunately this is sometimes necessary since the new version is
required by the package.

This is how GNU envisions this mess works at least..

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agoRPING: Remove printf for FLUSH completion.
Steve Wise [Wed, 20 Oct 2010 19:34:55 +0000 (12:34 -0700)]
RPING: Remove printf for FLUSH completion.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: do not modify qp_init_attr in rdma_get_request
Sean Hefty [Mon, 18 Oct 2010 16:53:53 +0000 (09:53 -0700)]
librdmacm: do not modify qp_init_attr in rdma_get_request

rdma_create_qp modifies the qp_init_attr structure passed in
by the user to return the actual QP capabilities that were
allocated.  If the qp_init_attr does not specify CQs, the
librdmacm will allocate CQs for the user and return them.

rdma_get_request will allocate a QP off newly connected rdma_cm_id
if the corresponding listen request is associated with a
qp_init_attr structure.  The librdmacm passes in the listen->
qp_init_attr structure into the rdma_create_qp call.
rdma_create_qp ends up modifying the qp_init_attr's associated
with the listen.  The result is that future calls to
rdma_get_request will use the modified qp attributes, rather
than those specified by the user.

Fix this by having rdma_get_request pass in a copy of the
qp_init_attr, rather than modifying those associated with the
listen.  Also update the man page for rdma_create_qp to indicate
that the qp_init_attr structure may be modified on output.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: only allocate qp in rdma_create_ep if qp_attr provided
Sean Hefty [Mon, 4 Oct 2010 23:35:25 +0000 (16:35 -0700)]
librdmacm: only allocate qp in rdma_create_ep if qp_attr provided

The comments and documentation for rdma_create_ep indicate that
it will only allocate a QP if initial QP attributes are provided.
However, the code always attempts to create a QP off an associated
active rdma_cm_id endpoint.

By _not_ allocating the QP, this allows a user to first determine
what RDMA device a rdma_cm_id was associated with.  The user can
then create a QP that references an existing CQ, SRQ, or PD.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: expand support for hints to rdma_getaddrinfo
Sean Hefty [Wed, 18 Aug 2010 19:39:58 +0000 (12:39 -0700)]
librdmacm: expand support for hints to rdma_getaddrinfo

If a user passes in hints into rdma_getaddrinfo, they can
specify resolved source and destination addresses.  In this
case, there's no need for the user to specify the node or
service parameters.  This differs from getaddrinfo, which
indicates that either node or service must be provided, but
is useful if rdma_getaddrinfo is being used to obtain
routing data.

Supporting this option allows the librdmacm to call
rdma_getaddrinfo internally from rdma_resolve_route when IB ACM
is enabled.

In addition to specifying the source and destination addresses
as part of the hints, a user could instead specify partial
routing data and rdma_getaddrinfo can resolve the full route.

This helps to support MPI applications that exchange endpoint
data, such as LIDs, out of band, but require SL data from the
SA to avoid potential deadlock conditions.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: do not pass uninitialized ai_hints into getaddrinfo
Sean Hefty [Thu, 19 Aug 2010 22:00:29 +0000 (15:00 -0700)]
librdmacm: do not pass uninitialized ai_hints into getaddrinfo

If rdma_getaddrinfo is called with hints set to NULL, then an
uninitialized ai_hints structure will be passed into getaddrinfo.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: release 1.0.13 v1.0.13
Sean Hefty [Tue, 10 Aug 2010 20:27:05 +0000 (13:27 -0700)]
librdmacm: release 1.0.13

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: document event status field
Sean Hefty [Thu, 29 Jul 2010 21:05:35 +0000 (14:05 -0700)]
librdmacm: document event status field

Clarify the value returned in the event status field.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm/man: fix typos in man pages
Sean Hefty [Thu, 22 Jul 2010 21:45:41 +0000 (14:45 -0700)]
librdmacm/man: fix typos in man pages

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: specify return value in man pages
Sean Hefty [Tue, 20 Jul 2010 17:03:20 +0000 (10:03 -0700)]
librdmacm: specify return value in man pages

Document the return value of all calls in their respective man pages.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: fix all calls to set errno
Sean Hefty [Tue, 20 Jul 2010 21:07:03 +0000 (14:07 -0700)]
librdmacm: fix all calls to set errno

The librdmacm documentation (rdma_cm.7 man page) specifies that librdmacm
functions return 0 on success and -1 on error, with errno set correctly.
Update places in the code where errno is not set correctly and
cleanup setting the error code.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
13 years agolibrdmacm: convert ibv error values to errno
Sean Hefty [Tue, 20 Jul 2010 22:24:55 +0000 (15:24 -0700)]
librdmacm: convert ibv error values to errno

The librdmacm documentation (rdma_cm.7 man page) specifies that librdmacm
functions return 0 on success and -1 on error, with errno set correctly.
The libibverbs abstractions simply pass the libibverbs return codes
through to the user.  Since libibverbs may return errno directly through
a given call, convert the return status to use errno where appropriate.

This fixes an issue with rdma_get_send_comp and rdma_get_recv_comp, where
a return value of 1 could indicate both success (1 completed request
returned) and failure (EPERM error).

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm/man: add man pages for calls in rdma_verbs.h
Sean Hefty [Mon, 19 Jul 2010 18:45:21 +0000 (11:45 -0700)]
librdmacm/man: add man pages for calls in rdma_verbs.h

rdma_verbs.h define several inline functions that wrap around verb
routines.  Add man pages for these calls.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm/man: add rdma_get_request man page to release
Sean Hefty [Mon, 19 Jul 2010 18:36:09 +0000 (11:36 -0700)]
librdmacm/man: add rdma_get_request man page to release

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: remove 32-bit build warnings
Sean Hefty [Tue, 1 Jun 2010 17:26:49 +0000 (10:26 -0700)]
librdmacm: remove 32-bit build warnings

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: support 2.6.9
Sean Hefty [Tue, 1 Jun 2010 14:44:14 +0000 (07:44 -0700)]
librdmacm: support 2.6.9

Redhat 4.x is based on 2.6.9.  Add support for older kernels.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: release 1.0.12 v1.0.12
Sean Hefty [Mon, 17 May 2010 21:41:59 +0000 (14:41 -0700)]
librdmacm: release 1.0.12

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: fix makefile installation path
Sean Hefty [Mon, 24 May 2010 18:02:09 +0000 (11:02 -0700)]
librdmacm: fix makefile installation path

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm/man: add man pages for new APIs
Sean Hefty [Fri, 21 May 2010 21:29:51 +0000 (14:29 -0700)]
librdmacm/man: add man pages for new APIs

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: define struct ibv_path_record if not defined
Sean Hefty [Mon, 17 May 2010 21:37:30 +0000 (14:37 -0700)]
librdmacm: define struct ibv_path_record if not defined

librdmacm relies on struct ibv_path_record from libibverbs.  However,
to support older versions of libibverbs, define struct ibv_path_record
if it is not already defined.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: disable AF_IB support
Sean Hefty [Tue, 11 May 2010 18:15:47 +0000 (11:15 -0700)]
librdmacm: disable AF_IB support

To avoid potential compatability issues, disable AF_IB support
until it has been queued for inclusion upstream.  We will re-enable
AF_IB support after releasing version 1.0.12 for OFED 1.5.2, which
will include support for IB ACM.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: initialize path_cnt
Sean Hefty [Thu, 6 May 2010 22:52:23 +0000 (15:52 -0700)]
librdmacm: initialize path_cnt

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: use IB ACM to resolve IB path
Sean Hefty [Thu, 6 May 2010 22:51:38 +0000 (15:51 -0700)]
librdmacm: use IB ACM to resolve IB path

Starting with 2.6.33, the kernel supports the ability to
manually specify the path record that a connection should
use.  Allow the librdmacm to contact the IB ACM to acquire
path record data, even if rdma_getaddrinfo is not used and
the kernel does not support AF_IB.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: check if kernel supports AF_IB
Sean Hefty [Thu, 6 May 2010 22:51:35 +0000 (15:51 -0700)]
librdmacm: check if kernel supports AF_IB

Add check during initialization to determine if the kernel
supports AF_IB.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm/mckey: use AF_IB for unmapped multicast addresses
Sean Hefty [Thu, 6 May 2010 22:51:06 +0000 (15:51 -0700)]
librdmacm/mckey: use AF_IB for unmapped multicast addresses

If the user joins an unmapped multicast address, use AF_IB,
rather than AF_INET6, to communicate that information with the
kernel.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: update man pages
Sean Hefty [Thu, 6 May 2010 22:51:01 +0000 (15:51 -0700)]
librdmacm: update man pages

Update man pages to reflect recent changes to the APIs.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm/rdma_server: add new sample server application
Sean Hefty [Thu, 6 May 2010 22:50:57 +0000 (15:50 -0700)]
librdmacm/rdma_server: add new sample server application

Provide a simple server application to demonstrate the minimal
amount of coding needed to accept a connection request from
a client and exchange messages.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm/rdma_client: add new client sample
Sean Hefty [Thu, 6 May 2010 22:50:54 +0000 (15:50 -0700)]
librdmacm/rdma_client: add new client sample

Provide a very simple client application that shows the
minimal coding needed to establish a connection and exchange
messages with a server.  The client makes use of the new
rdma_getaddrinfo and rdma_create_ep calls, plus rdma verbs
abstractions.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: provide abstracted verb calls
Sean Hefty [Thu, 6 May 2010 22:50:50 +0000 (15:50 -0700)]
librdmacm: provide abstracted verb calls

Provide abstractions to the verb calls to simplify the user
interface for more casual verbs consumers.  Users still have
access to the full range of verbs functionality by calling
verbs directly.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: format IB CM private data RDMA CM header
Sean Hefty [Thu, 6 May 2010 22:50:43 +0000 (15:50 -0700)]
librdmacm: format IB CM private data RDMA CM header

When IB ACM is used, the address and route resolution is
done entirely in user space.  Before converting AF_INET or
AF_INET6 addresses to AF_IB, format the connection private
data for IB CM REQ messages.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: use sockaddr_ib addressing if IB ACM is in use
Sean Hefty [Thu, 6 May 2010 22:49:55 +0000 (15:49 -0700)]
librdmacm: use sockaddr_ib addressing if IB ACM is in use

If IB ACM route resolution succeeds, provide the user with
AF_IB addresses, rather than AF_INET or AF_INET6 addressing.
AF_IB identifies the local and remote devices directly,
eliminating the need to perform address resolution a second
time via rdma_resolve_addr.

AF_IB addresses are returned using sockaddr_ib as part of
rdma_getaddrinfo.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: define RDMA_PS_IB
Sean Hefty [Thu, 6 May 2010 22:49:04 +0000 (15:49 -0700)]
librdmacm: define RDMA_PS_IB

AF_IB uses the IB port space.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: add support for IB ACM service
Sean Hefty [Thu, 6 May 2010 22:48:53 +0000 (15:48 -0700)]
librdmacm: add support for IB ACM service

Allow the librdmacm to contact a service via sockets to obtain
address mapping and path record data.  The use of the service
is controlled through a build option (with-ib_acm).  If the
library fails to contact the service, it falls back to using
the kernel services to resolve address and routing data.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: set src_addr in rdma_getaddrinfo
Sean Hefty [Thu, 6 May 2010 22:48:03 +0000 (15:48 -0700)]
librdmacm: set src_addr in rdma_getaddrinfo

If the user provides a source address as a hint, copy
the address to rdma_addrinfo ai_src_addr.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: auto create QPs in rdma_get_request
Sean Hefty [Thu, 6 May 2010 22:47:58 +0000 (15:47 -0700)]
librdmacm: auto create QPs in rdma_get_request

If the user passed initial QP attributes into rdma_create_ep,
allocate a QP for the user as part of rdma_get_request.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: add support for passive side in rdma_create_ep
Sean Hefty [Thu, 6 May 2010 22:47:52 +0000 (15:47 -0700)]
librdmacm: add support for passive side in rdma_create_ep

Allow calling rdma_create_ep for a listening rdma_cm_id.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: add rdma_destoy_ep
Sean Hefty [Thu, 6 May 2010 22:47:33 +0000 (15:47 -0700)]
librdmacm: add rdma_destoy_ep

Provide counterpart call to rdma_create_ep.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: add new call to create id
Sean Hefty [Thu, 6 May 2010 22:47:27 +0000 (15:47 -0700)]
librdmacm: add new call to create id

Provide a simple call to create an rdma_id, with optional QP.  The
id is created using synchronous operation, using the output of
rdma_getaddrinfo.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: specify qp_type when creating id
Sean Hefty [Thu, 6 May 2010 22:47:23 +0000 (15:47 -0700)]
librdmacm: specify qp_type when creating id

To support AF_IB / PS_IB, we need to specify the qp type when
creating the rdma_cm_id.  The kernel requires this in order
to select the correct type of operation to perform (e.g. SIDR
versus REQ).

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: define options to set IB route directly
Sean Hefty [Thu, 6 May 2010 22:47:14 +0000 (15:47 -0700)]
librdmacm: define options to set IB route directly

Add the definitions needed to set IB path record data using set_option.
This will be used by rdma_create_ep().

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: add rdma_get_request
Sean Hefty [Thu, 6 May 2010 22:46:37 +0000 (15:46 -0700)]
librdmacm: add rdma_get_request

To simplify passive side operation and better support synchronous
operations, add rdma_get_request().  This function is called on the
listening side to retrieve a connection request event.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: add rdma_getaddrinfo
Sean Hefty [Thu, 6 May 2010 22:46:32 +0000 (15:46 -0700)]
librdmacm: add rdma_getaddrinfo

Provide a call similar to getaddrinfo for RDMA devices and
connections.  rdma_get_addrinfo is modeled after getaddrinfo, with
the following modifications:

A source address is returned as part of the call to allow the
user to allocate the necessary resources for connections.

Optional routing information may be returned to support
Infiniband fabrics.  IB routing information includes necessary
path record data.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: expose ucma_init to other internal modules
Sean Hefty [Thu, 6 May 2010 22:45:13 +0000 (15:45 -0700)]
librdmacm: expose ucma_init to other internal modules

Remove static property from ucma_init and expose its
definition in cma.h.  The address resolution module will
need access to this function.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: allow conn_param to be optional
Sean Hefty [Thu, 6 May 2010 22:45:09 +0000 (15:45 -0700)]
librdmacm: allow conn_param to be optional

If conn_param is not provided to rdma_connect or rdma_accept,
then default values are used to establish the connection.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: allow user to specify max RDMA resouces
Sean Hefty [Thu, 6 May 2010 22:45:05 +0000 (15:45 -0700)]
librdmacm: allow user to specify max RDMA resouces

Allow the user to indicate that the library should select the
maximum RDMA read values available should be used when
establishing a connection.  The library selects the maximum
based on local hardware limitations and connection request
data.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
14 years agolibrdmacm: make CQs optional for rdma_create_qp
Sean Hefty [Thu, 6 May 2010 22:44:57 +0000 (15:44 -0700)]
librdmacm: make CQs optional for rdma_create_qp

Allow the user to specify NULL for the send and receive CQs when
creating a QP through rdma_create_qp.  The librdmacm will automatically
create CQs for the user, along with completion channel.

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