~shefty/ibacm.git
8 years agoibacm: Remove umask(0)
Sean Hefty [Tue, 9 Oct 2012 18:33:27 +0000 (11:33 -0700)]
ibacm: Remove umask(0)

This causes ibacm files to be created as world writable.

Problem reported by Florian Weimer <fweimer@redhat.com>

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoibacm: Timeout address and route data
Sean Hefty [Tue, 9 Oct 2012 00:00:14 +0000 (17:00 -0700)]
ibacm: Timeout address and route data

Add an option that allows address and route data to
time out.  Once data has timed out, it needs to be
resolved again.  This helps handle cases where the
remote data has changed.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agov1.0.7 v1.0.7
Sean Hefty [Fri, 29 Jun 2012 23:12:58 +0000 (16:12 -0700)]
v1.0.7

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoConfigure init script based on target OS
Sean Hefty [Wed, 6 Jun 2012 23:10:22 +0000 (16:10 -0700)]
Configure init script based on target OS

The init script either needs to depend on 'rdma' or 'openibd'
scripts being started.  The actual script depends on the target
operating system.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoibacm: Automatically select local port if not specified by path record
Sean Hefty [Mon, 4 Jun 2012 18:38:54 +0000 (11:38 -0700)]
ibacm: Automatically select local port if not specified by path record

If the user specifies a DLID or DGID as part of a path record lookup,
automatically select a local port.  This allows a user to query an SA
without needing to specify the local SLID or SGID.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoibacm/acme: Eliminate segfault when SLID/SGID not given
Sean Hefty [Thu, 31 May 2012 23:48:32 +0000 (16:48 -0700)]
ibacm/acme: Eliminate segfault when SLID/SGID not given

Problem and cause reported by Hal Rosenstock <hal@mellanox.com>

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Tested-by: Hal Rosenstock <hal@mellanox.com>
8 years agoibacm: Avoid negative shift for subnet timeout
Hal Rosenstock [Thu, 31 May 2012 22:35:41 +0000 (15:35 -0700)]
ibacm: Avoid negative shift for subnet timeout

Otherwise resulting port subnet timeout may be too large.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoibacm: security fix replace sprintf with snprintf
Dotan Barak [Mon, 23 Apr 2012 16:09:44 +0000 (09:09 -0700)]
ibacm: security fix replace sprintf with snprintf

Replace sprintf with snprintf to protects from buffer overflow.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoibacm: Fix rmpbuild issues
Sean Hefty [Wed, 30 May 2012 00:10:10 +0000 (17:10 -0700)]
ibacm: Fix rmpbuild issues

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agov1.0.6 v1.0.6
Sean Hefty [Fri, 30 Mar 2012 22:46:39 +0000 (15:46 -0700)]
v1.0.6

8 years agoibacm: Fixes to ACM package to support distros
Sean Hefty [Fri, 30 Mar 2012 23:31:08 +0000 (16:31 -0700)]
ibacm: Fixes to ACM package to support distros

Set of changes to fixup the ibacm package for inclusion into RedHat 6.
Changes are based on feedback from Doug Ledford <dledford@redhat.com>.
These are primarily changes to the build files, along with name changes
to the man pages and sample configuration files.

Rename the ib_acm service to match the package name, ibacm.

Rename the ibacm configuration files to use the prefix 'ibacm' instead
of 'acm'.  The new sample files are 'ibacm_addr.cfg' and 'ibacm_opts.cfg'.

Move location of ACM lock and configuration files and ibacm.pid
files.  They are currently in non-standard locations.

Modify ibacm and ib_acme to use $sysconfdir, $bindir, and rdmadir
configure values.  The ibacm_addr.cfg and ibacm_opt.cfg files will now be
read/written to $sysconfdir/$rdmadir by default, with rdmadir defaulting
to 'rdma' if not specified..  And ibacm will execute
$bindir/ib_acme if it needs to create the ibacm_addr.cfg file.  Without
$bindir, the ibacm service can fail to launch ib_acme when started
from an init script.

Add init script as part of install.  The init script is installed
into $sysconfdir/init.d.  The init script is processed by configure,
so that it executes the correct ibacm service that was installed.

Fixup man pages based on changes.

Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoibacm: Set default route resolution to SA
Sean Hefty [Fri, 6 Apr 2012 15:12:02 +0000 (08:12 -0700)]
ibacm: Set default route resolution to SA

SA resolution works in more environments than the ACM protocol.
SA is the default protocol for the ibacm_opts.cfg file, but if
that file is not available, the ibacm service defaults to ACM.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoibacm: Display LID using unsigned decimal
Hal Rosenstock [Fri, 6 Apr 2012 14:58:55 +0000 (07:58 -0700)]
ibacm: Display LID using unsigned decimal

So that all LIDs diplay as positive numbers

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoib_acme: Better error handling in resolve_gid
Hal Rosenstock [Thu, 5 Apr 2012 23:29:52 +0000 (16:29 -0700)]
ib_acme: Better error handling in resolve_gid

A return of 0 is an error for inet_pton but if 0 is returned
from resolve_gid, show_path is mistakenly called so if
0 is returned from inet_pton, return -1 instead (which is
what is done elsewhere in acme).

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoib_acme: Use IPv4 rather than IPv6 when connecting to ACM server
Hal Rosenstock [Thu, 5 Apr 2012 23:24:09 +0000 (16:24 -0700)]
ib_acme: Use IPv4 rather than IPv6 when connecting to ACM server

When both IPv4 and IPv6 are running, getaddrinfo indicates IPv6
rather than IPv4 and that currently causes a failure to connect to
the ACM server.  Fix is to set the address family in the hint to
getaddrinfo to IPv4.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoib_acme: Fix typo
Hal Rosenstock [Thu, 5 Apr 2012 23:20:44 +0000 (16:20 -0700)]
ib_acme: Fix typo

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoibacm: Allow user to specify LIDs and/or GIDs when using PR lookups
Sean Hefty [Mon, 3 Oct 2011 19:40:16 +0000 (12:40 -0700)]
ibacm: Allow user to specify LIDs and/or GIDs when using PR lookups

Currently, we only allow a user to lookup data with path records
if the LIDs are provided.  Handle the case where the GIDs may be
provided instead.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agoFix refcnt for multicast destination
sean.hefty@intel.com [Wed, 4 Apr 2012 00:20:35 +0000 (17:20 -0700)]
Fix refcnt for multicast destination

mc_dest has a default refcnt of 0.  When a multicast destination is
released, an attempt is made to free it, which can result in the
ibacm service crashing.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoAfter allocation of dynamic memory blocks, check that the allocation
Dotan Barak [Mon, 28 Nov 2011 20:21:37 +0000 (12:21 -0800)]
After allocation of dynamic memory blocks, check that the allocation
succeeded, if it failed handle it gracefully.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Erez Shitrit <erezsh@mellanox.co.il>
9 years agov1.0.5
Sean Hefty [Thu, 19 May 2011 20:15:20 +0000 (13:15 -0700)]
v1.0.5

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoib_acme: Add missing carriage return in usage statements
Sean Hefty [Mon, 29 Aug 2011 23:14:50 +0000 (16:14 -0700)]
ib_acme: Add missing carriage return in usage statements

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoibacm: Add performance counters
Sean Hefty [Mon, 27 Jun 2011 17:29:36 +0000 (10:29 -0700)]
ibacm: Add performance counters

Add performance counters to track service usage.  Counters are exposed
via a new perf query request.  Update ib_acme to retrieve counters from
a specified endpoint.

Counters that are currently defined are:

- Address and route resolution errors
- Resolution requests
- Requests not satisfied as a result of no data available
- Requests requiring an address lookup
- Requests that found address information in the cache
- Requests requiring a route lookup (i.e. path record query)
- Requests that found route information in the cache

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoFix strict-aliasing rules warning
Sean Hefty [Thu, 30 Jun 2011 00:28:57 +0000 (17:28 -0700)]
Fix strict-aliasing rules warning

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoReduce build output
Sean Hefty [Thu, 30 Jun 2011 17:06:36 +0000 (10:06 -0700)]
Reduce build output

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoFixup starting curly brace alignment
Sean Hefty [Mon, 27 Jun 2011 19:08:16 +0000 (12:08 -0700)]
Fixup starting curly brace alignment

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoibacm: Run as daemon by default
Sean Hefty [Mon, 27 Jun 2011 17:19:57 +0000 (10:19 -0700)]
ibacm: Run as daemon by default

Start ibacm as a daemon by default, with an optional non-daemon mode.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoibacm: Allocate address handles dynamically when needed
Sean Hefty [Fri, 1 Apr 2011 23:03:40 +0000 (16:03 -0700)]
ibacm: Allocate address handles dynamically when needed

ibacm allocates an address handle for every remote destination
that it tracks.  However, under normal operation, the handle
is used infrequently - typically only once by the target
service to send a response and not at all on the initiator
service.  Avoid the overhead of having 1 address handle per
destination by allocating them dynamically only when they are needed.

The exceptions to this are the address handles allocated to
communicate with the SA and the primary multicast group.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoibacm: Join only the base multicast group if using SA path resolution
Sean Hefty [Fri, 1 Apr 2011 22:58:19 +0000 (15:58 -0700)]
ibacm: Join only the base multicast group if using SA path resolution

If the ACM service is configured to use the SA to resolve path
record data, then only join the base multicast group.  We only
need to join other groups if we're creating path records based
on multicast data, using the acm route protocol.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoibacm: Reduce overhead on multicast groups not used
Sean Hefty [Fri, 1 Apr 2011 21:46:34 +0000 (14:46 -0700)]
ibacm: Reduce overhead on multicast groups not used

ACM may join several multicast groups when using the multicast
group protocol.  No data is ever sent on those groups.  They exist
simply to see if a port *could* send data across those groups, for
example, to validate the mtu or rate between two endpoints.  Since
we don't send data on them, there's no need to create an address
handle for them or attach the ACM UD QP to it.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoHandle port down events
Sean Hefty [Wed, 23 Feb 2011 22:41:48 +0000 (14:41 -0800)]
Handle port down events

Process port down or error events.  While a port is down, the
ibacm service will fail all requests to endpoints on that port.
Cached data is not invalidated however, under the assumption
that the port state is temporary.  (A future enhancement can
optimize the cleanup.)

Since a port can now transition between up and down, we need
to fixup a couple of places to avoid initializing structures
multiple times.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoHandle port up events
Sean Hefty [Tue, 22 Feb 2011 18:26:01 +0000 (10:26 -0800)]
Handle port up events

Handle port up events.  The IB ACM service only checks once
during initialization for active ports to use.  If a port later
becomes available, the service will not be able to use it.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoAdd log message when incrementing SM destination reference count
Sean Hefty [Thu, 10 Feb 2011 20:31:44 +0000 (12:31 -0800)]
Add log message when incrementing SM destination reference count

The reference count for the SM destination structure is manually
incremented, but acm_put_dest is used to release it.  This results
in an unmatched put message in the ibacm log file.  Provide a matching
'get dest' log message when incrementing the SM destination.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoSet SM LID address in network byte order
Sean Hefty [Thu, 10 Feb 2011 20:06:46 +0000 (12:06 -0800)]
Set SM LID address in network byte order

acm_set_dest_addr expects LIDs to be in network order.
Convert the sm_lid retrieved from the port attributes into
network order.  This formats the LID value correctly
when entered into the ibacm log.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoMove endpoint activation to another thread
Sean Hefty [Fri, 21 Jan 2011 01:06:28 +0000 (17:06 -0800)]
Move endpoint activation to another thread

To support dynamic changes, move endpoint activation from
the main thread into a dedicated thread that will also
process asynchronous events (to be added separately).  The
main thread will still initialize the device and port
list, but activation code will be handled by the new thread,
so that endpoints can be deferred until their associated
ports are activated.

This also means that multicast joins are deferred, and
additional state checking is needed to prevent the main
thread (which processes client requests) from accessing
endpoints which are not yet fully active.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoTrack inactive devices and ports
Sean Hefty [Thu, 20 Jan 2011 21:26:26 +0000 (13:26 -0800)]
Track inactive devices and ports

When obtaining a list of devices and ports, store all that are
available in the local device list, including those that are not
active.  This will allow the ib_acm service to handle dynamic
changes, like port up/down events.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
9 years agoDelay opening address file until assigning addresses
Sean Hefty [Thu, 20 Jan 2011 19:46:44 +0000 (11:46 -0800)]
Delay opening address file until assigning addresses

In order to handle ports that are down, we need to add
new endpoints only when they are brought online or assigned
new partitions (pkeys).  This is easier to handle if we
delay the opening of the address configuration file until
it is needed to assign addresses.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: restructure path query code
Sean Hefty [Fri, 17 Dec 2010 20:53:43 +0000 (12:53 -0800)]
ibacm: restructure path query code

Merge acm_svr_query_sa() with acm_svr_query().

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Convert LID name to host order
Sean Hefty [Fri, 17 Dec 2010 20:10:14 +0000 (12:10 -0800)]
ibacm: Convert LID name to host order

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acme: Support range of DLIDs for lookups
Sean Hefty [Fri, 17 Dec 2010 20:06:05 +0000 (12:06 -0800)]
ib_acme: Support range of DLIDs for lookups

Allow the user to specify multiple DLIDs as part of
querying.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acme: support querying by gids
Sean Hefty [Fri, 17 Dec 2010 18:20:05 +0000 (10:20 -0800)]
ib_acme: support querying by gids

Allow the user to specify gids when querying path data.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: add support for path lookup by LID/GID
Sean Hefty [Mon, 13 Dec 2010 18:35:40 +0000 (10:35 -0800)]
ibacm: add support for path lookup by LID/GID

Support path record lookup based on DLID or DGID.  This allows
ibacm to be used purely for path record caching, with address
resolution being done by a user.  This is needed to support
clients that exchange LID/GID information out of band before
connecting, or that make use of ipoib for address resolution.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: fix lmc usage
Sean Hefty [Thu, 16 Dec 2010 01:23:26 +0000 (17:23 -0800)]
ibacm: fix lmc usage

Convert lmc to actual mask for use in slid comparisons.  All SA
queries are initiated from the base lid, so set the src_path_bits
to 0.  It is currently set incorrectly based on using the lmc as
a mask against the base lid.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agov1.0.4 v1.0.4
Sean Hefty [Mon, 29 Nov 2010 23:02:45 +0000 (15:02 -0800)]
v1.0.4

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: check destination type when selecting source
Sean Hefty [Thu, 9 Dec 2010 17:09:24 +0000 (09:09 -0800)]
ibacm: check destination type when selecting source

Add an explicit check for destination type in all cases
when selecting the source.  Fail requests if the source
is not IPv4 or v6.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: remove unused acm_msg.h file
Sean Hefty [Thu, 9 Dec 2010 16:49:46 +0000 (08:49 -0800)]
ibacm: remove unused acm_msg.h file

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acm: change default log file
Sean Hefty [Wed, 8 Dec 2010 19:34:36 +0000 (11:34 -0800)]
ib_acm: change default log file

Change the default logging file from stdout to
/var/log/ibacm.log, so we create a usable log file if
ib_acm is run without the user first having run ib_acme -O.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acm: merge acm_notes.txt into ib_acm man page
Sean Hefty [Wed, 8 Dec 2010 19:05:34 +0000 (11:05 -0800)]
ib_acm: merge acm_notes.txt into ib_acm man page

Remove the acm_notes.txt file included with the source
and integrate the contents with the ib_acm man page.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acme: add an 'unspecified' address format
Sean Hefty [Tue, 7 Dec 2010 21:44:44 +0000 (13:44 -0800)]
ib_acme: add an 'unspecified' address format

Support an 'unspecified' address format.  If no address
format is given, ib_acme will use getaddrinfo to try to
resolve the destination address.

This simplifies the user interface, plus allows the user
to specify a hostname for input, but allow getaddrinfo
to resolve the hostname into an IP address before contacting
the ACM service.  The latter can provide a benefit of
being able to specify hostnames on a large cluster, but
allow ib_acme to populate ib_acm caches with IP address
data instead.  This benefits MPI applications which may
exchange IP addresses out of band for communications, but
rely on hostnames for job distribution.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acme: Allow user to specify multiple destinations
Sean Hefty [Tue, 7 Dec 2010 17:39:52 +0000 (09:39 -0800)]
ib_acme: Allow user to specify multiple destinations

In order to test the ACM service on large clusters and
force population of cached data, allow a user to indicate
that ib_acme should resolve information for multiple
destinations.

Multiple destinations can be specified by using bracket
syntax, such as [1-10,12,15-20], at the end of the
destination name.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acme: convert error to readable string
Sean Hefty [Tue, 7 Dec 2010 15:58:54 +0000 (07:58 -0800)]
ib_acme: convert error to readable string

Display readable string for errors, rather than showing
error number.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acme: allow source to be optional parameter
Sean Hefty [Tue, 7 Dec 2010 00:13:22 +0000 (16:13 -0800)]
ib_acme: allow source to be optional parameter

A source address is currently a required argument.  Allow it to
be optional.  An appropriate source will be selected based on the
destination.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: support no delay options
Sean Hefty [Mon, 6 Dec 2010 21:07:41 +0000 (13:07 -0800)]
ibacm: support no delay options

Allow a user to specify that address and/or route resolution
protocols should be suppressed, and that only locally cached
data should be returned.

This helps support rdma_getaddrinfo options RAI_NUMERICHOST
and RAI_NOROUTE.  If data for a request is available, it is
immediately returned.  Otherwise, the client request is
failed, but the lookup is still initiated.  This avoids
blocking a client for an extended period of time while
resolution completes, but allows future calls to find cached
data.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: write port to /var/run/ibacm.port
Sean Hefty [Mon, 6 Dec 2010 19:51:38 +0000 (11:51 -0800)]
ibacm: write port to /var/run/ibacm.port

Write used port data to /var/run/ibacm.port.  This will allow
librdmacm and other libraries and applications to find the
ibacm service when it has been moved from its default port.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: automatically generate addresses if missing acm_addr.cfg
Sean Hefty [Mon, 6 Dec 2010 19:06:47 +0000 (11:06 -0800)]
ibacm: automatically generate addresses if missing acm_addr.cfg

If the acm_addr.cfg file is missing, automatically attempt to
generate the file.  If no addresses can be assigned to any
endpoints because of a missing file, log an error and exit
the service.  This avoids running a service that is basically
useless.

This change allows the ib_acm service to execute using defaults
without requireing that a user first run 'ib_acme -A -O' or
otherwise creating the acm configuration files.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: modify logging output
Sean Hefty [Mon, 6 Dec 2010 16:42:43 +0000 (08:42 -0800)]
ibacm: modify logging output

Move some level 2 debug output to level 1, some level 0 to 1,
and mark output with 'notice' or 'ERROR' where needed.  This
will help debug scaling problems on large clusters without needing to
parse through volumes of data.  The original messages were guesses
anyway.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acme: Hide output for -A -O options unless verbose
Sean Hefty [Fri, 3 Dec 2010 20:52:49 +0000 (12:52 -0800)]
ib_acme: Hide output for -A -O options unless verbose

Do not display the contents of generated config files by
default.  Add a verbose option to ib_acme and only display
the contents if verbose is enabled.  This reduces the amount
of noise using ib_acme to configuring address information
across a large cluster.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Add lock to prevent multiple daemons from running
Sean Hefty [Thu, 2 Dec 2010 22:12:56 +0000 (14:12 -0800)]
ibacm: Add lock to prevent multiple daemons from running

Use a lock file to prevent multiple daemons from running
simultaneously.

Without this lock, a second instance of ib_acm eventually
fails to bind to the server's TCP port and exits, but not
before it overwrites a portion of the log file.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: decrease default retries
Sean Hefty [Wed, 1 Dec 2010 03:38:15 +0000 (19:38 -0800)]
ibacm: decrease default retries

With 15 retries, 2 seconds per timeout, the total timeout ends
up being too long when running on large clusters, where a node
can drop off at anytime.  Decrease the default number of retries
to 2.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: add cfg files to distribution
Sean Hefty [Wed, 1 Dec 2010 03:31:04 +0000 (19:31 -0800)]
ibacm: add cfg files to distribution

acm_opts.cfg file is useful with the distribution to copy across
a cluster.  Update the option file with missing settings.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: fixup white space in text
Sean Hefty [Wed, 1 Dec 2010 03:29:15 +0000 (19:29 -0800)]
ibacm: fixup white space in text

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Introduce loopback resolution 'protocol'
Sean Hefty [Tue, 16 Nov 2010 18:39:24 +0000 (10:39 -0800)]
ibacm: Introduce loopback resolution 'protocol'

OFED 1.5.2 introduced a kernel patch that disables looping
back multicast messages to the sending QP.  This capability
was enabled by default.  The current ACM address resolution
protocol depends on this feature of multicast.  To handle
the case where multicast loopback has been disabled, add an
option to ACM to resolve loopback addresses using local data
only.  This option is enabled by default.

When loopback resolution is set to 'local', ACM will automatically
insert a loopback destination into each endpoint.  Requests
to resolve a loopback address will find this destination
and use it to respond to client requests.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: fix issuing SA query after recording address
Sean Hefty [Mon, 15 Nov 2010 20:08:46 +0000 (12:08 -0800)]
ibacm: fix issuing SA query after recording address

ACM has two ways that it can complete address resolution.  The
first is to receive a response to an address resolution query.
The second is to receive a multicast message carrying an address
resolution request.  In the second case, the address request
may be between two other nodes.

When this occurs, ACM will record the address information of
the source of the multicast message.  However, it's possible
for ACM to be in the process of trying to resolve that address.
After it records the address, it must see if there's an
outstanding request against that address, so that it can kick
off route resolution.

This fixes an issue where ACM will hang resolving addresses
found during scale-up testing.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: enhance debug messages
Sean Hefty [Wed, 17 Nov 2010 00:05:28 +0000 (16:05 -0800)]
ibacm: enhance debug messages

Prefix all log messages with time stamp information.  This
provides useful debugging information regarding the timing of
various operations.

To help match up various operations with each other, improve
and simplify logging of endpoint and destination names.  We
save printable names with all destinations.  The
function to display address information is removed in favor
of using the normal logging function, a call to format address
data, and per thread logging data.

Finally, we add ability to handle LID/GID addresses in acm_log_addr.
This is required to display SA and multicast destination addresses
in the acm log file.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: version 1.0.3 v1.0.3
Sean Hefty [Thu, 26 Aug 2010 17:27:49 +0000 (10:27 -0700)]
ibacm: version 1.0.3

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: support distros with older versions of gcc
Sean Hefty [Wed, 25 Aug 2010 17:26:22 +0000 (10:26 -0700)]
ibacm: support distros with older versions of gcc

ibacm implements atomics using gcc intrinsics that were introduced
in gcc 4.1.2.  If an older version of gcc is used to compile the
code, an error results.  Check that the required atomic calls are
supported, and if not, provide our own implementation.

This fixes a build issue on RH 5.x.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: release 1.0.2 v1.0.2
Sean Hefty [Tue, 10 Aug 2010 20:59:38 +0000 (13:59 -0700)]
ibacm: release 1.0.2

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: move default location of log file
Sean Hefty [Wed, 28 Jul 2010 23:35:30 +0000 (16:35 -0700)]
ibacm: move default location of log file

Make /var/log the default location of the acm log file.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: change location of default configuration file
Sean Hefty [Sat, 24 Jul 2010 00:12:24 +0000 (17:12 -0700)]
ibacm: change location of default configuration file

Move the default location of the configuration files from the
current directory to /etc/ibacm.  Change ib_acme to create the
files in this location, and modify ibacm to use the files here
by default.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: daemonize ib_acm service
Sean Hefty [Fri, 23 Jul 2010 19:12:45 +0000 (12:12 -0700)]
ibacm: daemonize ib_acm service

Allow ib_acm to run as a daemon instead of just a process.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: release 1.0.1
Sean Hefty [Mon, 21 Jun 2010 16:13:20 +0000 (09:13 -0700)]
ibacm: release 1.0.1

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: install ib_acm into sbin instead of bin directory
Sean Hefty [Fri, 2 Jul 2010 17:58:57 +0000 (10:58 -0700)]
ibacm: install ib_acm into sbin instead of bin directory

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm/acme: set default route protocol to SA queries
Sean Hefty [Fri, 2 Jul 2010 18:55:25 +0000 (11:55 -0700)]
ibacm/acme: set default route protocol to SA queries

Change the default routing lookup to use SA queries.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: fixup package name and installation for inclusion into OFED
Sean Hefty [Mon, 21 Jun 2010 16:08:39 +0000 (09:08 -0700)]
ibacm: fixup package name and installation for inclusion into OFED

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm/notes: update release notes
Sean Hefty [Tue, 8 Jun 2010 18:27:37 +0000 (11:27 -0700)]
acm/notes: update release notes

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: release 1.0.0 v1.0.0
Sean Hefty [Mon, 10 May 2010 19:58:29 +0000 (12:58 -0700)]
ibacm: release 1.0.0

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: add missing file to repository
Sean Hefty [Fri, 21 May 2010 22:39:11 +0000 (15:39 -0700)]
ibacm: add missing file to repository

acm_msg.h was not added to repository

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: wait for SA query to finish before sending reply
Sean Hefty [Sat, 8 May 2010 21:53:25 +0000 (14:53 -0700)]
ibacm: wait for SA query to finish before sending reply

When using the SA for route resolution, we need to delay sending
back the client response until SA resolution is complete.  If
we cache an ACM address for resolution, but we are not the target
of the resolution, do not respond to queued client requests.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: remove unused state
Sean Hefty [Fri, 7 May 2010 17:41:54 +0000 (10:41 -0700)]
ibacm: remove unused state

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: rename ib_path* to ibv_path*
Sean Hefty [Thu, 6 May 2010 23:01:48 +0000 (16:01 -0700)]
ibacm: rename ib_path* to ibv_path*

ib_path_record was renamed to ibv_path_record when merging into
libibverbs.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: fix log file usage
Sean Hefty [Wed, 5 May 2010 18:38:39 +0000 (11:38 -0700)]
ibacm: fix log file usage

The ibacm service inserts a space into the log file name.  Remove it.
Flush log file entries to disk, since the file is never closed, to avoid
losing entries.  Finally, set the default to write the log file to disk,
rather than the stdout.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: add missing files to distribution
Sean Hefty [Tue, 4 May 2010 23:27:20 +0000 (16:27 -0700)]
ibacm: add missing files to distribution

Include needed header files into 'make dist'.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: fix building warnings
Sean Hefty [Tue, 4 May 2010 23:18:26 +0000 (16:18 -0700)]
ibacm: fix building warnings

Fix build warnings compiling on 2.6.18-164.el5

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: remove old man pages
Sean Hefty [Mon, 3 May 2010 22:48:37 +0000 (15:48 -0700)]
ibacm: remove old man pages

The libibacm library was removed from the IB ACM package.  Remove the
man pages associated with the library interface.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib_acme: fix reference in man page
Sean Hefty [Mon, 3 May 2010 22:46:32 +0000 (15:46 -0700)]
ib_acme: fix reference in man page

Man page reference ib_acm, rather than ib_acme.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib/acm: supporting querying the SA for routing data
Sean Hefty [Mon, 3 May 2010 21:21:10 +0000 (14:21 -0700)]
ib/acm: supporting querying the SA for routing data

To support complex routing topologies, we add the ability to
query the SA for path record data when resolving IB routing data.
Address resolution still relies on the ACM protocol, but route
resolution can select between the ACM protocol and SA queries.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoib/acm: add state tracking
Sean Hefty [Thu, 22 Apr 2010 17:16:04 +0000 (10:16 -0700)]
ib/acm: add state tracking

To support alternate address and route resolution protocols,
add state tracking to destinations.  This will allow for the
completion of address resolution separate from route
resolution.

As part of this change, we add locking to destinations,
rather than relying on the endpoint locking.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: resolve source address if not given
Sean Hefty [Fri, 9 Apr 2010 18:48:10 +0000 (11:48 -0700)]
ibacm: resolve source address if not given

Allow the user to only provide the destination address into
ACM.  If a source address is not given, resolve a usable
source address, and return it to the user.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: major rework to align with linux AF_IB changes
Sean Hefty [Thu, 1 Apr 2010 18:13:38 +0000 (10:13 -0800)]
ibacm: major rework to align with linux AF_IB changes

Simplified service's socket interface, and updated code to share
data structure definitions from libibverbs.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoib/acm: remove i686 architecture requirement from make file
Sean Hefty [Tue, 17 Nov 2009 19:44:16 +0000 (11:44 -0800)]
ib/acm: remove i686 architecture requirement from make file

This causes build failure on x86_64 debian 5.0.3 system.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoibacm: rework socket interface messages
Sean Hefty [Thu, 29 Oct 2009 21:02:22 +0000 (13:02 -0800)]
ibacm: rework socket interface messages

Rather than indicating the src/dst address type in the acm message
header, indicate the type in the acm_ep_addr structure directly.
This adds more flexibility and will permit additional acm_ep_addr
structures to be carried in a single message request or response.

Allow multiple addresses in a request or response message.  This
is needed to support a wider range of fabric topologies, where the
inbound and outbound paths may differ, plus support failover.

Add path records to the resolve message, rather than as a separate
operation.  Return path records directly from the lookup.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agolibacm: open devices once
Sean Hefty [Fri, 2 Oct 2009 19:48:47 +0000 (12:48 -0700)]
libacm: open devices once

Instead of opening IB devices on every call to ib_acm_convert_to_path,
open all devices during initialization and store the necessary data.
This optimizes multiple calls to ib_acm_convert_to_path to improve
connection setup times.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoib_acm/acme: declare main as cdecl
Sean Hefty [Fri, 2 Oct 2009 18:54:55 +0000 (11:54 -0700)]
ib_acm/acme: declare main as cdecl

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoib_acm: fix indentation in linux osd header
Sean Hefty [Fri, 2 Oct 2009 18:53:43 +0000 (11:53 -0700)]
ib_acm: fix indentation in linux osd header

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoib_acm: move zalloc to osd header file for common use
Sean Hefty [Fri, 2 Oct 2009 18:51:07 +0000 (11:51 -0700)]
ib_acm: move zalloc to osd header file for common use

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoibacm: initial git repo
Sean Hefty [Wed, 16 Sep 2009 22:02:40 +0000 (15:02 -0700)]
ibacm: initial git repo

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