Arlin Davis [Tue, 16 Mar 2010 17:12:11 +0000 (09:12 -0800)]
common: dat_ep_connect should not set timer UD endpoints
connect for UD type is simply AH resolution and doesn't
need timed. The common code is not designed to handle
multiple timed events on connect requests so just ignore
timing UD AH requests.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Mon, 8 Mar 2010 20:53:45 +0000 (12:53 -0800)]
ibal: changes for EP to CM linking and synchronization.
Windows IBAL changes to allocate and manage CM objects
and to link them to the EP. This will insure the CM
IBAL objects and cm_id's are not destroy before EP.
Remove windows only ibal_cm_handle in EP structure.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Wed, 24 Feb 2010 18:03:57 +0000 (10:03 -0800)]
common: add CM-EP linking to support mutiple CM's and proper protection during destruction
Add linking for CM to EP, including reference counting, to insure syncronization
during creation and destruction. A cm_list_head has been added to the EP object to
support multiple CM objects (UD) per EP. If the CM object is linked to an EP it
cannot be destroyed.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Thu, 4 Feb 2010 00:21:30 +0000 (16:21 -0800)]
destroy verbs completion channels created via ia_open or ep_create.
Completion channels are created with ia_open for CNO events and
with ep_create in cases where DAT allows EP(qp) to be created with
no EVD(cq) and IB doesn't. These completion channels need to be
destroyed at close along with a CQ for the EP without CQ case.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Tue, 2 Feb 2010 22:43:03 +0000 (14:43 -0800)]
When copying private_data out of rdma_cm events, use the
reported private_data_len for the size, and not IB maximums.
This fixes a bug running over the librdmacm on windows, where
DAPL accessed invalid memory.
Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Sean Hefty [Thu, 28 Jan 2010 18:19:20 +0000 (10:19 -0800)]
dapl/cma: fix referencing freed address
DAPL uses a pointer to reference the local and remote addresses
of an endpoint. It expects that those addresses are located
in memory that is always accessible. Typically, for the local
address, the pointer references the address stored with the DAPL
HCA device. However, for the cma provider, it changes this pointer
to reference the address stored with the rdma_cm_id.
This causes a problem when that endpoint is connected on the
passive side of a connection. When connect requests are given
to DAPL, a new rdma_cm_id is associated with the request. The
DAPL code replaces the current rdma_cm_id associated with a
user's endpoint with the new rdma_cm_id. The old rdma_cm_id is
then deleted. But the endpoint's local address pointer still
references the address stored with the old rdma_cm_id. The
result is that any reference to the address will access freed
memory.
Fix this by keeping the local address pointer always pointing
to the address associated with the DAPL HCA device. This is about
the best that can be done given the DAPL interface design.
Arlin Davis [Tue, 22 Dec 2009 22:00:33 +0000 (14:00 -0800)]
openib_common: add check for both gid and global routing in RTR
check for valid gid pointer along with global route setting
during transition to RTR. Add more GID information to
debug print statement in qp modify call.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Fri, 4 Dec 2009 20:25:30 +0000 (12:25 -0800)]
ucm, scm: DAPL_GLOBAL_ROUTING enabled causes segv
socket cm and ud cm providers support QP modify with is_global
set and GRH. New v2 providers didn't pass GID information
in modify_qp RTR call and incorrectly byte swapped the already
network order GID. Add debug print of GID during global modify.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Colliding with RDS port of 18634. rdma_cm can return
either EADDRINUSE or EADDRNOTAVAIL if the bind fails.
Add check for either and return proper DAT_CONN_QUAL_IN_USE.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Wed, 18 Nov 2009 17:43:38 +0000 (09:43 -0800)]
common: seg fault in dapl_evd_wait with multi-thread application using CNO's.
If we are dealing with event streams besides a CQ event stream,
be conservative and set producer side locking. Otherwise, no.
Check for CNO is missing, CNO is not considered CQ event stream.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Wed, 18 Nov 2009 17:37:48 +0000 (09:37 -0800)]
ucm: inbound DREQ/DREP handshake should transition QP.
During release, when receiving a disconnect request from remote peer
instead of a disconnect call from the client, the QP didn't get properly
set in ERR state and didn't flush the queue during disconnect processing.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Fri, 16 Oct 2009 15:52:21 +0000 (08:52 -0700)]
ucm: using UD type QP's, ucm reports wrong reject event when user rejects AH resolution request.
During rejects, both usr and ucm internal, the qp_type does not get initialized
so the check for UD type QP messages fail on active side and the wrong
event gets generated. Initialize saddr.ib information before sending reject
back to active side.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Fri, 16 Oct 2009 14:57:25 +0000 (07:57 -0700)]
ucm, scm, cma: Fix CNO support on DTO type EVD's
EVD wait_object should be used for CNO processing
and not the direct CQ event channels. Add proper
checking for DTO type EVD's with CNO at wait
and wakeup.
UCM missing support for collective EVD's under a
CNO. Add support to create common channel for
collective EVD's during device open. Add support
in cm_thread to check this channel. Also,
during disconnect, move QP to error to properly
flush queue instead of moving to reset and init.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Sean Hefty [Wed, 14 Oct 2009 16:34:18 +0000 (09:34 -0700)]
The HCA should not be closed until all resources have been released.
This results in a hang on windows, since closing the device frees
the event processing thread.
Arlin Davis [Thu, 8 Oct 2009 23:02:52 +0000 (16:02 -0700)]
ucm: add timer/retry CM logic to the ucm provider
add reply, rtu and retry count options via
environment variables. Times in msecs.
DAPL_UCM_RETRY 10
DAPL_UCM_REP_TIME 400
DAPL_UCM_RTU_TIME 200
Add RTU_PENDING and DISC_RECV states
Add check timer code to the cm_thread
and the option to the select abstaction
to take timeout values in msecs.
DREQ, REQ, and REPLY will all be timed
and retried.
Split out reply code and disconnect_final
code to better facilitate retry timers.
Add checking for duplicate messages.
Added new UD extension events for errors.
DAT_IB_UD_CONNECTION_REJECT_EVENT
DAT_IB_UD_CONNECTION_ERROR_EVENT
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Fri, 2 Oct 2009 21:48:15 +0000 (14:48 -0700)]
cma: cannot reuse the cm_id and qp for new connection, must reallocate a new one.
When merging common code base the dapls_ib_reinit_ep mistakely
modified QP to reset then init for all providers. Will
not work for rdma_cm (cma provider) since the cm_id cannot
be reused. Add build check for _OPENIB_CMA_ to pull in correct
free and reallocate method for reinit_ep.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Fri, 2 Oct 2009 20:50:12 +0000 (13:50 -0700)]
scm, cma: update DAPL cm protocol revision with latest address/port changes
CM protocol changed, roll revision to 6.
The socket cm could be competing with address space if
application is using sockets above to exchange information
like dapltest, and MPI consumers. Adjust port on listen
and connect to reduce the chance of port collision with
application above.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Fri, 2 Oct 2009 19:47:37 +0000 (12:47 -0700)]
ucm: modify IB address format to align better with sockaddr_in6
Restructure the dcm_addr union to map the IB side
closer to sockaddr6 and initialize family to
AF_INET6 to insure callee allocates enough memory
for ucm dat_ia_address type. Put qpn in flowinfo
and gid in sin6_addr. Change the test suites
to print address information based on AF_INET
or AF_INET6 instead of using specific IB address
union from the provider.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Sean Hefty [Wed, 30 Sep 2009 21:27:50 +0000 (14:27 -0700)]
The completion manager was updated to provide an abstraction that
better mimicked how fd's were used. Update dapl to use this
abstraction, rather than the older completion manager api.
This helps minimize changes between linux and windows.
Arlin Davis [Mon, 28 Sep 2009 17:59:36 +0000 (10:59 -0700)]
scm: tighten up socket options to insure similiar behavior on Windows and Linux.
Add IPPROTO_TCP to create socket. Specify device IP address
when binding instead of INADDR_ANY and remove setsocketopt
REUSEADDR on the listen socket to avoid any issues with
portability. Don't want duplicate port bindings.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Mon, 28 Sep 2009 17:46:26 +0000 (10:46 -0700)]
cma: improve serialization of destroy and event processing
WinOF testing with slightly different scheduler and verbs
showed some issues with cleanup. Add better protection around
destroy and event processing thread.
Remove destroy flag and add refs counting to conn objects
to block destroy until all references are cleared. Add
locking aroung ref counting and passive and active
event processing.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Mon, 28 Sep 2009 17:42:52 +0000 (10:42 -0700)]
scm: improve serialization of destroy and state changes
WinOF testing with slightly different scheduler and verbs
showed some issues with cleanup. Add better protection around
destroy and move state change before socket send to insure
correct state in multi-thread environment targeting the same
device on send and recv.
Change DCM_RTU_PENDING to DCM_REP_PENDING and
and add static definition to local routines for better
readability.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Thu, 17 Sep 2009 15:56:06 +0000 (08:56 -0700)]
common: no cleanup/release code for timer thread
dapl_set_timer() creates a thread to process timers for dat_ep_connect
but provides no mechanism to destroy/exit during dapl library unload.
Timers are initialized in library init code and should be released
in the fini code. Add a dapl_timer_release call to the dapl_fini
function to check state of timer thread and destroy before exiting.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Thu, 17 Sep 2009 15:53:29 +0000 (08:53 -0700)]
scm, cma: dapli_thread doesn't always get teminated on library close.
DAPL doesn't actually wait for the async processing thread to exit before
allowing the library to close. It will wait up to 10 seconds, which under
heavy load isn't enough time. Since the thread is created by an application
level thread, it will continue to run as long as the application runs. But
if the application closes the library, then all library data and code is
invalid, which can result in the thread running something that's not
library code and accessing freed memory.
With this change, I was able to run mpi ping-pong, 16 ranks on a single
system (scm provider) without crashes 1300 times.
Arlin Davis [Wed, 9 Sep 2009 16:44:03 +0000 (09:44 -0700)]
ucm: For UD type QP's, return CR p_data with CONN_EST event on passive side.
Intel MPI uses the p_data provided with CONN_EST as a reference to the
UD pair and remote rank. The ucm provider was overwriting the CR p_data
with the ACCEPT p_data. Change to save CR p_data but also provide
storage for user provided ACCEPT p_data in case the REPLY is lost
and needs retransmitted.
p_data size was provided to event processing in network order
instead of host order.
For new QP's create new address handles and do not use
existing AH's created for the CM. Different PD's are
associated with each.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Wed, 2 Sep 2009 21:01:51 +0000 (14:01 -0700)]
dtest, dtestx: modifications for UD QP testing with ucm provider.
remote_addr is wrong for IP remote address.
The dtestx requires the server connect back to the client
for the UD test. With the ucm provider you need to provide
the QPN and the LID which you cannot get until the dtest
client starts. So, for now, don't support UD testing
on UCM providers.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Wed, 2 Sep 2009 20:54:59 +0000 (13:54 -0700)]
scm, ucm: UD QP support was broken when porting to common openib code base.
create remote_ah was moved out of modify_qp_state function but not
included in the RTU and ACCEPT code for UD QP's. qp type check
should be on daddr not saddr in ucm cm code.
QP number must be converted to host order before supplying remote_ah,
and qp number to consumer.
Modify QP state to RTR for UD QP mask setting incorrect.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Tue, 1 Sep 2009 19:36:31 +0000 (12:36 -0700)]
cma: remove debug message after rdma_disconnect failure
DAPL automatically calls rdma_disconnect() when a disconnect request is
received. If the user also calls disconnect, that calls rdma_disconnect() as
well, but the connection has already been disconnected by DAPL and is no longer
valid. The result is that the user's call to rdma_disconnect() will fail. Do
not display an error message if this occurs.
Locking could be added to prevent calling rdma_disconnect() multiple times, but
since the librdmacm provides synchronization to trap this, we might as well take
advantage of it.
Intel MPI checks the uDAPL error code when calling dat_psp_create() to see if
the port number that it provides is in use or not. Convert winsock error codes
to unix errno values.
This fixes the following error reported by Intel MPI:
'DAPL provider is not found and fallback device is not enabled'
Arlin Davis [Tue, 18 Aug 2009 17:15:15 +0000 (10:15 -0700)]
ucm: Add new provider using a DAPL based IB-UD cm mechanism for MPI implementations.
New provider uses it's own CM protocol on top of IB-UD queue pairs.
During device open, this provider creates a UD queue pair and
returns local address information via dat_ia_query. This 24 byte
opaque address must be exchange out-of-band before connecting to a
server via dat_ep_connect. This provider is targeted for MPI
implementations that already exchange address information
during mpi_init phase.
Future release may provide some ARP mechanism via multicast.
dtest, dtestx, and dtestcm was modified to report the lid and qpn
information on the server side so you can provide appropriate
destination address information for the client test suite.
dapltest will not work with this provider.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Wed, 5 Aug 2009 03:49:09 +0000 (20:49 -0700)]
scm: Fix disconnect. QP's need to move to ERROR state in
order to flush work requests and notify consumer. Moving to
RESET removed all requests but did not notify consumer.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Wed, 5 Aug 2009 03:48:03 +0000 (20:48 -0700)]
modify dtest.c to cleanup CNO wait code and consolidate into
collect_event() call. After waking up from CNO wait the
consumer must check all EVD's. The EVD's under the CNO
could be dropped if already triggered or could come in any order.
DT_RetToString changed to DT_RetToStr and DT_EventToSTr
changed to DT_EventToStr for consistency.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Wed, 5 Aug 2009 03:47:17 +0000 (20:47 -0700)]
CNO events, once triggered will not be returned during the cno wait.
Check for triggered state before going to sleep in cno_wait. Reset
triggered EVD reference after reporting.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Sun, 2 Aug 2009 21:21:09 +0000 (14:21 -0700)]
CNO support broken in both CMA and SCM providers.
CQ thread/callback mechanism was removed by mistake. Still
need indirect DTO callbacks when CNO is attached to EVD's.
Add CQ event channel to cma provider's thread and add
to select for rdma_cm and async channels.
For scm provider there is not easy way to add this channel
to the select across sockets on windows. So, for portablity
reasons 2 thread is started to process the ASYNC and
CQ channels for events.
Must disable EVD (evd_endabled=FALSE) during destroy
to prevent EVD events firing for CNOs and re-arming CQ while
CQ is being destroyed.
Change dtest to check EVD after CNO timesout.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Sean Hefty [Mon, 27 Jul 2009 22:07:33 +0000 (15:07 -0700)]
DAPL introduced the concept of directly waiting on the CQ for
events by adding a compile time flag and special handling in the common
code. Rather than using the compile time flag and modifying the
common code, let the provider implement the best way to wait for
CQ events.
This simplifies the code and allows the common openib providers to
optimize for Linux and Windows platforms independently, rather than
assuming a specific implementation for signaling events.
Arlin Davis [Thu, 16 Jul 2009 19:41:22 +0000 (12:41 -0700)]
dapltest: Implement a malloc() threshold for the completion reaping.
change byte vector allocation to stack in functions:
DT_handle_send_op, DT_handle_rdma_op & DT_handle_recv_op.
When allocation size is under the threshold, use a stack local
allocation instead of malloc/free. Move redundant bzero() to
be called only in the case of using local stack allocation as
DT_Mdep_malloc() already does a bzero(). Consolidate error handling
return and free()check to a single point by using goto.
Arlin Davis [Thu, 16 Jul 2009 19:32:09 +0000 (12:32 -0700)]
scm: handle connected state when freeing CM objects
The QP could be freed before being disconnected
so the provider needs process disconnect before freeing
the CM object. The disconnect clean will finish
the destroy process during the disc callback.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Arlin Davis [Thu, 2 Jul 2009 21:11:20 +0000 (14:11 -0700)]
dtestcm: add UD type QP option to test
Add -u for UD type QP's during connection setup.
Will setup UD QPs and provide remote AH
in connect establishment event. Measures
setup/exchange rates.
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>