Sean Hefty [Fri, 21 Mar 2014 06:23:06 +0000 (23:23 -0700)]
ibacm: Reset endpoint state on error
An endpoint will be set to the ACM_READY state after
joining its multicast group. If we later receive a
reregister event or port down followed by port up and
try to join the group again but fail, we will leave the
endpoint state as READY, rather than reset it back to INIT.
To fix, always set the mc_dest state to ACM_INIT on
any failure.
Sean Hefty [Fri, 21 Mar 2014 03:59:58 +0000 (20:59 -0700)]
ibacm: Change base endpoint name
Endpoints are given a string identifer (base name) that matches
the first address assigned to the endpoint. Store the endpoint
string identifier separately from the address name, and identify
the endpoint using the device name, port, and pkey.
The endpoint identifier is only used for logging purposes.
Sean Hefty [Wed, 19 Mar 2014 22:45:48 +0000 (15:45 -0700)]
ibacm: Record index for source and destination addresses
When processing a resolve route message, record what
index the source and destination addresses were located
at directly into the message. This replaces returning
pointers to the source and destination address that must
then be passed around.
When provider plug-in support is added in subsequent
patches, this will avoid pointer exchanges between the
core and provider code.
Fix a minor issue where the src_out field may be
uninitialized (value read from client message). Src_out
now becomes a boolean value, rather than an index. The
actual location for the output is specified as an index.
This change cleanups the call to acm_svr_select_src,
which selects a source address. It is only called when
a source is needed, which is explicitly determined by
seeing if src_out is set, rather than relying on a zero
src type field.
Sean Hefty [Thu, 20 Mar 2014 05:14:31 +0000 (22:14 -0700)]
ibacm: Relocate client refcnt
Adjust when we take a reference on the client connection.
Increment the client reference when we begin processing
the client's request, and release it when the response
has been sent.
The client reference will no longer be associated with the
lifetime of any underlying acm_request structure. This change
will allow the acm core to control the client reference
count when we move to a provider plug-in model in subsequent
patches.
Ira Weiny [Tue, 25 Mar 2014 03:17:37 +0000 (23:17 -0400)]
ibacm: Move calling of helper functions out of get_devaddr
Again this is in prep for sharing this code with ibacm and ib_acme
get_devaddr uses globals which are specific to ib_acme. Move toward this
function being ib_acme specific while the code in get_addr_ip becomes generic.
Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Hal Rosenstock [Thu, 1 Aug 2013 21:10:00 +0000 (14:10 -0700)]
acm: Save endpoint pkey in host order
acm_ep stores and uses a pkey value, assuming that it is in
host order. However, ibv_query_pkey returns the pkey in network
order. We need to byte swap the pkey when saving it.
Signed-off-by: Hal Rosenstock <hal@mellanox.com> Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Hal Rosenstock [Thu, 27 Jun 2013 18:48:11 +0000 (21:48 +0300)]
Add support for preloading IPv4 and IPv6 ACM caches
A hosts file (ibacm_hosts.cfg) is configured with tuples of
IP addresses (either IPv4 or IPv6) and IB GID. This information
in conjunction with the path record preloading allows
for the IPv4 and IPv6 ACM caches to be preloaded.
IPv4 was tested with both rping and ucmatose as well as
acme. IPv6 was tested with ucmatose and acme.
The remaining ACM cache to be preloaded is the name cache.
This will be added in subsequent patch.
Signed-off-by: Hal Rosenstock <hal@mellanox.com> Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Hal Rosenstock [Thu, 27 Jun 2013 13:48:24 +0000 (16:48 +0300)]
Add the ability to preload the destination GID and LID caches
Preloading of these caches is supported via a file which is
produced by OpenSM by the dump_pr plugin which contains
sufficient SA PathRecord information. Details on this
file format and configuring OpenSM for this are found in
dump_pr_notes.txt in dump_pr.
File format is specified in ibacm_opts.cfg as follows:
path_rec_fmt full_opensm_v1
File format defaults to none which means no preload of ACM cache.
Signed-off-by: Hal Rosenstock <hal@mellanox.com> Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Hal Rosenstock [Fri, 28 Jun 2013 01:08:27 +0000 (18:08 -0700)]
ib_acme: Enhance documention in generated ibacm_opt.cfg
Improve the description of the send_depth value in the generated
ibacm_opt.cfg file. Fixup a couple of other areas. Patch derived from
patches submitted by Hal.
Signed-off-by: Hal Rosenstock <hal@mellanox.com>. Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Sean Hefty [Fri, 28 Jun 2013 01:04:39 +0000 (18:04 -0700)]
Remove sample ibacm_*.cfg files
Configuration files can be automatically generated using ib_acme. Remove
the files from the source tree, versus maintaining them and ensuring that
they remain in sync with the files generated by ib_acme.
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.
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.
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>
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.
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>
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>
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.
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
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.
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.
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.
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.
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.
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.
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.
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.