]> git.openfabrics.org - ~shefty/ibacm.git/log
~shefty/ibacm.git
10 years agoibacm/prov: add add_address and remove_address functions.
Sean Hefty [Thu, 15 May 2014 18:43:48 +0000 (11:43 -0700)]
ibacm/prov: add add_address and remove_address functions.

The full set of provider device/port/endpoint/address init/shutdown paths is
now separate from that of the core.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Separate device/port/ep init/shutdown paths for core and provider.
Kaike Wan [Wed, 14 May 2014 00:21:46 +0000 (17:21 -0700)]
ibacm: Separate device/port/ep init/shutdown paths for core and provider.

The provider device and port will not be opened until the core port is up.
When a core ep is added, a corresponding provider ep will be opened.
Name/address addition/deletion should be addressed next.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Rename acm_client as acmc_client
Kaike Wan [Wed, 14 May 2014 00:20:57 +0000 (17:20 -0700)]
ibacm: Rename acm_client as acmc_client

This change is consistent with the ibacm core naming convention.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Rename acm_addr as acmc_addr
Kaike Wan [Wed, 14 May 2014 00:20:28 +0000 (17:20 -0700)]
ibacm: Rename acm_addr as acmc_addr

This change is consistent with the ibacm core naming convention.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Rename acm_ep as acmc_ep
Kaike Wan [Wed, 14 May 2014 00:19:53 +0000 (17:19 -0700)]
ibacm: Rename acm_ep as acmc_ep

This change is consistent with other core structure naming convention.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Rename acm_port as acmc_port
Kaike Wan [Wed, 14 May 2014 00:19:07 +0000 (17:19 -0700)]
ibacm: Rename acm_port as acmc_port

This name change reserves struct acm_port for use by the provider interface.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Rename acm_device as acmc_device
Kaike Wan [Wed, 14 May 2014 00:18:30 +0000 (17:18 -0700)]
ibacm: Rename acm_device as acmc_device

This intends to reserve the struct acm_device for use by the provider interface
only.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: port/ep cleanup after shutdown
Kaike Wan [Wed, 14 May 2014 00:12:49 +0000 (17:12 -0700)]
ibacm: port/ep cleanup after shutdown

This patch adds functions to close provider port and endpoint after the core
port and endpoint are closed. The default provider resources are not freed to
avoid synchronization issues with the provider completion thread and the retry
handler.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm/prov: acquire sa_dest lock before accessing SA
Kaike Wan [Wed, 14 May 2014 00:00:55 +0000 (17:00 -0700)]
ibacm/prov: acquire sa_dest lock before accessing SA

Instead of acquiring port lock, any access to SA should acquire the port's
sa_dest lock to avoid nested locking scheme.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Open a provider ep only if an address is assigned to the core ep.
Kaike Wan [Tue, 13 May 2014 23:50:45 +0000 (16:50 -0700)]
ibacm: Open a provider ep only if an address is assigned to the core ep.

The function acm_assign_ep_names() should not return 0 when there is no valid
address assigned to the core ep. In this case, the provider's
ep should not be up (or acmp_ep_up() should not be called). However, when
there is at least one address assigned, 0 should be returned so that the
core endpoint and the provider endpoint should be created.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm/prov: Re-initialize the multicast dest before joining the multicast group
Kaike Wan [Mon, 5 May 2014 18:43:20 +0000 (11:43 -0700)]
ibacm/prov: Re-initialize the multicast dest before joining the multicast group

If the provider has already registered for a multicast group, it should free
the address handle before reregistering again.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoIbacm/prov: Rename provider related option defines and functions.
Kaike Wan [Wed, 16 Apr 2014 06:38:52 +0000 (23:38 -0700)]
Ibacm/prov: Rename provider related option defines and functions.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Fix the incorrect return type of acm_convert_addr_preload.
Kaike Wan [Wed, 16 Apr 2014 06:37:10 +0000 (23:37 -0700)]
ibacm: Fix the incorrect return type of acm_convert_addr_preload.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm/prov: Rename provider specific structures and variables
Kaike Wan [Wed, 16 Apr 2014 06:35:23 +0000 (23:35 -0700)]
ibacm/prov: Rename provider specific structures and variables

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm/prov: Rename some provider related functions
Kaike Wan [Wed, 16 Apr 2014 06:09:13 +0000 (23:09 -0700)]
ibacm/prov: Rename some provider related functions

Help identify functions that pertain to the default ACM
provider, rather than the core by using the acmp name
prefix.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm/prov: Separate provider config options from those of core
Kaike Wan [Wed, 16 Apr 2014 06:04:39 +0000 (23:04 -0700)]
ibacm/prov: Separate provider config options from those of core

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Rename acm_dest as acmp_dest
Kaike Wan [Wed, 16 Apr 2014 05:54:36 +0000 (22:54 -0700)]
ibacm: Rename acm_dest as acmp_dest

The 'destination' structure is only used by the ACM
provider, not the ACM core.  The rename helps
identify its usage.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Eliminate device event handler thread.
Kaike Wan [Wed, 16 Apr 2014 05:18:53 +0000 (22:18 -0700)]
ibacm: Eliminate device event handler thread.

The event handler thread creates synchronization issues
with the client request, especially when address/endpoint/port
is removed or shut down. This patch moves the device event
handling code into acm_server() so that event and client
reqest are serialized to avoid any potential synchronization
issues.  We also lose the overhead of an additional thread.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Define separate structures for acm devices
Kaike Wan [Tue, 15 Apr 2014 23:44:26 +0000 (16:44 -0700)]
ibacm: Define separate structures for acm devices

This is part of the preparation for adding provider
support.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Eliminate compiling warning "ignoring return value"
Kaike Wan [Tue, 15 Apr 2014 23:27:10 +0000 (16:27 -0700)]
ibacm: Eliminate compiling warning "ignoring return value"

Those warnings are produced when building rpm with
"rpmbuild -ta ibacm-1.0.8.tar.gz" after creating the
tar file with "make dist".

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Provide correct addr_len for IPv6
Sean Hefty [Tue, 15 Apr 2014 22:25:12 +0000 (15:25 -0700)]
ibacm: Provide correct addr_len for IPv6

When reading in addresses from the address file, the
address string is converted into either an IPv4, IPv6,
or hostname 'address'.  In the case of IPv6, the length
of the address is set to the maximum supported value.
This can result in extra bytes being set beyond the
actual IPv6 address, which are then copied into the
endpoint address.  Fix this by setting the size
of the IPv6 correctly.  When the address is copied into
the endpoint address, the extra bytes are then ignored.

Problem reported by: Kaike Wan <kaike.wan@intel.com>

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Define separate structures for acm ports
Sean Hefty [Fri, 21 Mar 2014 08:21:01 +0000 (01:21 -0700)]
ibacm: Define separate structures for acm ports

Define a port structure for use by the ibacm core layer.
The core endpoints will be linked to this port structure.

Link struct acm_ep off struct acm_port and struct acmp_ep
off struct acmp_port.  Separate the code accessing the
port structures into core or provider specific sections,
and have the functions reference the correct port
structure.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Convert ibacm server code to use acm_ep
Sean Hefty [Fri, 21 Mar 2014 07:33:14 +0000 (00:33 -0700)]
ibacm: Convert ibacm server code to use acm_ep

The acm server code is part of the acm core.  It should
only use the core struct acm_ep and not the provider
acmp_ep.  This removes most uses of the provider ep
structure from the core server processing.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Convert acm_addr_index call to return address
Sean Hefty [Sat, 22 Mar 2014 07:07:40 +0000 (00:07 -0700)]
ibacm: Convert acm_addr_index call to return address

Rename acm_addr_index to acm_addr_lookup and have it
return the acm_address that matches the source address,
rather than the index that the address is located.
The index is an internal limitation of the acm core
and the acm_address is usable by the providers.

Change acm_addr_lookup to take the endpoint as input
in place of the provider ep.  acm_addr_lookup is
intended to be exported by the acm core.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Divide struct acmp_ep into two structures
Sean Hefty [Fri, 21 Mar 2014 06:08:14 +0000 (23:08 -0700)]
ibacm: Divide struct acmp_ep into two structures

Struct acmp_ep contains data that is intended for both
the core and provider.  Split out the core data from
the structure into its own sub-structure.

The core structure will own the acm_endpoint allocation
and addressing.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Move ep state check
Sean Hefty [Fri, 21 Mar 2014 06:32:09 +0000 (23:32 -0700)]
ibacm: Move ep state check

acm_get_port_ep() checks that the state of the endpoint
is ready.  If not, it is skipped in the search for a
matching address.

The state of the endpoint is a property that belongs to
the provider, not the acm core.  Move the state check
into the provider specific code.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Define struct acm_address
Sean Hefty [Fri, 21 Mar 2014 03:39:45 +0000 (20:39 -0700)]
ibacm: Define struct acm_address

Endpoint addressing information will be shared between the
core and provider layers.  Separate out the addressing
data into its own structure.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Add basic provider framework
Sean Hefty [Mon, 24 Mar 2014 05:27:28 +0000 (22:27 -0700)]
ibacm: Add basic provider framework

Define the provider interface for handling path record query
and route resolution requests.  This will define the boundary
between the provider and the core layer.

Update the core functions to invoke the provider interfaces
used for processing client requests.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Define provider endpoint identifier
Sean Hefty [Mon, 24 Mar 2014 06:24:54 +0000 (23:24 -0700)]
ibacm: Define provider endpoint identifier

Introduce a header file that will be included by providers that
will define the interface between the ibacm core layer and the
providers.

Define an endpoint identifier that is associated with a set of
addresses.  Providers will be given this structure in requests.
The endpoint is defined as a <device, port, pkey> tuple, though
it may be used with "any" values in order to identify any
port on a device and/or any pkey on a port.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Change client parameter to req id in resp calls
Sean Hefty [Mon, 24 Mar 2014 05:11:58 +0000 (22:11 -0700)]
ibacm: Change client parameter to req id in resp calls

The ibacm core will manage the client connection.  Providers
should not interact with clients directly.  Instead, the core
will give providers a request id with each request that will be
returned to the core layer when the request has completed.

Change the client field in struct acm_request to an id field,
and update the provider identified functions to use the id
in place of accesing the client directly.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Rename data structures
Sean Hefty [Mon, 24 Mar 2014 04:49:13 +0000 (21:49 -0700)]
ibacm: Rename data structures

Provider support will require separate definitions for the
device, port, and endpoint structures between the acm
core and the existing provider.  The current struct
acm_port and struct acm_ep contain fields that are
mainly used by what will become the provider.  Rename
these structures to have an acmp prefix to indicate
that the provider will own their use.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Function renames
Sean Hefty [Mon, 24 Mar 2014 01:19:29 +0000 (18:19 -0700)]
ibacm: Function renames

Supporting providers will require existing functionality
to become part of the acm core function or a provider
operation.

Any functionality that will migrate into the provider code
is renamed with the 'acmp' prefix.  A couple of core
functions are also renamed to indicate that they will
become callback handlers and exposed directly to the
providers.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Fix invalid memory dereference in acm_process_join_resp
Sean Hefty [Wed, 9 Apr 2014 19:04:19 +0000 (12:04 -0700)]
ibacm: Fix invalid memory dereference in acm_process_join_resp

If a join request fails, the dest pointer may not be initialized.
This can result in the ibacm daemon crashing.  Fix the crash and
ensure that the multicast state is set correctly in case the
join fails by initializing the state to ACM_INIT before sending
the join request.

Problem reported by: Kaike Wan <kaike.wan@intel.com>

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Restructure acm_port_join
Sean Hefty [Sat, 22 Mar 2014 07:42:54 +0000 (00:42 -0700)]
ibacm: Restructure acm_port_join

Create a subroutine to process joining a single
endpoint that can be called directly in place of
joining all endpoints on a port.

This will make it easier to handle future changes that
affect a single endpoint, such as a pkey change.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Store the base GID with acm_port
Sean Hefty [Sat, 22 Mar 2014 07:37:19 +0000 (00:37 -0700)]
ibacm: Store the base GID with acm_port

Record the base GID of a port with acm_port.  This avoids
needing to query again for it later.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Reset endpoint state on error
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.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Change base endpoint name
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.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Record index for source and destination addresses
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.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Relocate client refcnt
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.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Eliminate strict aliasing compiler warnings
Sean Hefty [Sat, 22 Mar 2014 03:30:17 +0000 (20:30 -0700)]
ibacm: Eliminate strict aliasing compiler warnings

Use local variables and memcpy to defeat the
compiler warning: dereferencing type-punned
pointer will break strict-aliasing rules

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Rename client array
Sean Hefty [Thu, 20 Mar 2014 04:45:42 +0000 (21:45 -0700)]
ibacm: Rename client array

Rename the client array to client_array, to make it easier
to distinguish between the array and local variables, which
are also named client.

And, hey, this found the bug in the previous patch.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Release the refcnt on the correct client
Sean Hefty [Thu, 20 Mar 2014 06:00:56 +0000 (23:00 -0700)]
ibacm: Release the refcnt on the correct client

Release the reference on the client that we're referencing,
and not the one at the front of the array.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoMerge branch 'ira-name-res3'
Sean Hefty [Tue, 8 Apr 2014 21:29:34 +0000 (14:29 -0700)]
Merge branch 'ira-name-res3'

10 years agoibacm: by default remove processing of IP's from ibacm_addr.cfg
Ira Weiny [Fri, 4 Apr 2014 00:15:05 +0000 (20:15 -0400)]
ibacm: by default remove processing of IP's from ibacm_addr.cfg

support_ips_in_addr_cfg option in config file can turn this back on if wanted.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: ib_acme remove IP addresses from ibacm_addr.cfg file generation
Ira Weiny [Wed, 26 Mar 2014 00:40:37 +0000 (20:40 -0400)]
ibacm: ib_acme remove IP addresses from ibacm_addr.cfg file generation

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Fix handling of aliased IPoIB devices
Ira Weiny [Tue, 25 Mar 2014 23:21:46 +0000 (19:21 -0400)]
ibacm: Fix handling of aliased IPoIB devices

ibX:Y devices don't have sysfs files directly.  They use the "base" interface
of ibX.  The ioctl calls however include the full aliased name.

Netlink does not have this problem as the interface name is reported as it
appears in sysfs.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Add/remove addr's in EP's when added/removed from the system.
Ira Weiny [Fri, 21 Mar 2014 20:26:05 +0000 (16:26 -0400)]
ibacm: Add/remove addr's in EP's when added/removed from the system.

This builds on the previous patch by reacting to the IP address changes
monitored there.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Add Netlink socket to monitor IP address changes
Ira Weiny [Fri, 21 Mar 2014 18:39:34 +0000 (14:39 -0400)]
ibacm: Add Netlink socket to monitor IP address changes

Currently only reports events to the log.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: read system IP's into endpoints at startup
Ira Weiny [Sat, 22 Mar 2014 01:22:14 +0000 (21:22 -0400)]
ibacm: read system IP's into endpoints at startup

ibacm_addr.cfg is read after system is read which can add endpoints which are
not active at start up.

ibacm_addr.cfg can still specify names for end points

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: add separate acm_ep_insert_addr function
Ira Weiny [Sat, 22 Mar 2014 00:13:01 +0000 (20:13 -0400)]
ibacm: add separate acm_ep_insert_addr function

This is in preparation for netlink support which will do this dynamically.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: convert logging in acm_util.c to acm_log
Ira Weiny [Tue, 25 Mar 2014 07:07:35 +0000 (03:07 -0400)]
ibacm: convert logging in acm_util.c to acm_log

ib_acme build defines ACME_PRINTS which overrides acm_log to printf

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: move acm_if_iter_sys to acm_util.c
Ira Weiny [Tue, 25 Mar 2014 06:52:04 +0000 (02:52 -0400)]
ibacm: move acm_if_iter_sys to acm_util.c

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Move calling of helper functions out of get_devaddr
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>
10 years agoibacm: move sysfs helper functions to acm_util 'module'
Ira Weiny [Tue, 25 Mar 2014 02:11:10 +0000 (22:11 -0400)]
ibacm: move sysfs helper functions to acm_util 'module'

This is in preparation for these functions to be included in both ibacm and
ib_acme build.

Also rename to more global appropriate name acm_if_*

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: use sysfs (in acm_if_is_ib) rather than ioctl(... SIOCGIFHWADDR ...) to read...
Ira Weiny [Tue, 25 Mar 2014 01:30:00 +0000 (21:30 -0400)]
ibacm: use sysfs (in acm_if_is_ib) rather than ioctl(... SIOCGIFHWADDR ...) to read interface type

Getting an interface type from sysfs is easier than using an ioctl when an
interface name is readily available (as is the case with netlink.)

In preparation for netlink support create a function which uses sysfs and use
it instead of ioctls.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: pass interface name rather than 'struct ifreq' to get_devaddr, get_sgid, and...
Ira Weiny [Mon, 24 Mar 2014 23:11:33 +0000 (19:11 -0400)]
ibacm: pass interface name rather than 'struct ifreq' to get_devaddr, get_sgid, and get_pkey

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: get_devaddr remove unused variable from signature
Ira Weiny [Mon, 24 Mar 2014 22:59:56 +0000 (18:59 -0400)]
ibacm: get_devaddr remove unused variable from signature

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: properly check return from ibv_open_device
Ira Weiny [Fri, 21 Mar 2014 14:07:03 +0000 (10:07 -0400)]
ibacm: properly check return from ibv_open_device

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
10 years agoibacm: properly check return from ibv_open_device
Ira Weiny [Fri, 21 Mar 2014 14:07:03 +0000 (10:07 -0400)]
ibacm: properly check return from ibv_open_device

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm.init.in: Fix typo
Hal Rosenstock [Thu, 13 Feb 2014 19:49:30 +0000 (11:49 -0800)]
ibacm.init.in: Fix typo

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agobuild: Fix daemon script to work with SuSE
Sean Hefty [Tue, 4 Feb 2014 23:47:22 +0000 (15:47 -0800)]
build: Fix daemon script to work with SuSE

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm: Remove whitespace
Hal Rosenstock [Fri, 16 Aug 2013 14:57:15 +0000 (07:57 -0700)]
acm: Remove whitespace

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm.c: In acm_join_group, no need to set qkey in umad addr to send to SA
Hal Rosenstock [Tue, 6 Aug 2013 11:45:43 +0000 (07:45 -0400)]
acm.c: In acm_join_group, no need to set qkey in umad addr to send to SA

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm.c: Fix endian of qkey in MCMemberRecord in acm_init_join
Hal Rosenstock [Tue, 6 Aug 2013 11:45:40 +0000 (07:45 -0400)]
acm.c: Fix endian of qkey in MCMemberRecord in acm_init_join

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm.c: Send multicast joins to SA on default partition
Hal Rosenstock [Tue, 6 Aug 2013 11:45:37 +0000 (07:45 -0400)]
acm.c: Send multicast joins to SA on default partition

rather than on EP partition

Prefer full default partition in case both full and limited
pkeys for default partition are in pkey table.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm.c: Make sure MGID has full member pkey bit on
Hal Rosenstock [Tue, 6 Aug 2013 11:45:31 +0000 (07:45 -0400)]
acm.c: Make sure MGID has full member pkey bit on

even when limited member of partition

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm.c: Fix endian of transaction ID
Hal Rosenstock [Tue, 6 Aug 2013 11:45:28 +0000 (07:45 -0400)]
acm.c: Fix endian of transaction ID

It should be in network rather than host endian.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm.c: Invalid pkey has low order 15 bits 0
Hal Rosenstock [Tue, 6 Aug 2013 11:45:22 +0000 (07:45 -0400)]
acm.c: Invalid pkey has low order 15 bits 0

so add in handling for pkey 0x8000 as well as 0 for invalid

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm.c: In acm_port_up, handle noncontiguous pkeys
Hal Rosenstock [Tue, 6 Aug 2013 11:45:17 +0000 (07:45 -0400)]
acm.c: In acm_port_up, handle noncontiguous pkeys

There can be "holes" in pkey table although this is not usually the case
but since IBA spec allows for this, it should be handled.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agolibacm.c: Remove unneeded structures
Hal Rosenstock [Tue, 6 Aug 2013 11:45:14 +0000 (07:45 -0400)]
libacm.c: Remove unneeded structures

acm_port and acm_device are not used/needed

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm.c: Handle client reregister local event
Hal Rosenstock [Fri, 2 Aug 2013 12:00:37 +0000 (08:00 -0400)]
acm.c: Handle client reregister local event

When client reregister is requested, ACM should rejoin/recreate
ACM multicast groups.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoacm: Save endpoint pkey in host order
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>
10 years agoacm: Add pkey to error message
Hal Rosenstock [Thu, 1 Aug 2013 21:01:11 +0000 (14:01 -0700)]
acm: Add pkey to error message

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoibacm: Release 1.0.8 v1.0.8
Sean Hefty [Thu, 25 Jul 2013 22:31:06 +0000 (15:31 -0700)]
ibacm: Release 1.0.8

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoMakefile.am: Fix name of ibacm_hosts.cfg file to *.data
Sean Hefty [Fri, 26 Jul 2013 04:29:43 +0000 (21:29 -0700)]
Makefile.am: Fix name of ibacm_hosts.cfg file to *.data

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoconfigure: Use subdir-objects option
Sean Hefty [Thu, 25 Jul 2013 20:38:12 +0000 (13:38 -0700)]
configure: Use subdir-objects option

Reduce clobbering the build directory.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoconfigure.ac: Minor updates based on autoupdate suggestions
Sean Hefty [Thu, 25 Jul 2013 19:50:45 +0000 (12:50 -0700)]
configure.ac: Minor updates based on autoupdate suggestions

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoautogen.sh: Use autoreconf
Sean Hefty [Thu, 25 Jul 2013 19:48:21 +0000 (12:48 -0700)]
autogen.sh: Use autoreconf

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoMakefile.am: Replace INCLUDES with AM_CPPFLAGS
Sean Hefty [Thu, 25 Jul 2013 19:46:56 +0000 (12:46 -0700)]
Makefile.am: Replace INCLUDES with AM_CPPFLAGS

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoUse foreign option with AM_INIT_AUTOMAKE
Sean Hefty [Thu, 25 Jul 2013 19:45:46 +0000 (12:45 -0700)]
Use foreign option with AM_INIT_AUTOMAKE

Update AM_INIT_AUTOMAKE usage, which makes it possible to
use autoreconf with the ibacm package.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years agoChange configure.in to configure.ac
Sean Hefty [Thu, 25 Jul 2013 19:42:40 +0000 (12:42 -0700)]
Change configure.in to configure.ac

Update autotools support.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
10 years ago[ibacm] Add support for name cache
Hal Rosenstock [Fri, 19 Jul 2013 18:30:04 +0000 (14:30 -0400)]
[ibacm] Add support for name cache

Similar to IPv4 and IPv6 preload, (host)name cache preload is
now supported in addr_preload_file when acm_hosts is specified
for addr_preload setting.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years ago[ibacm] Update documentation for the "new" preload option names
Hal Rosenstock [Fri, 19 Jul 2013 18:00:02 +0000 (14:00 -0400)]
[ibacm] Update documentation for the "new" preload option names

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoibacm: Rename hosts file from .cfg to .data
Sean Hefty [Fri, 19 Jul 2013 16:29:39 +0000 (09:29 -0700)]
ibacm: Rename hosts file from .cfg to .data

The git tree names the hosts file with a .cfg extension, but the
code defaults to .data.  Rename the sample hosts file with .data
to match the code.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoAllow user to preload address data without route data
Sean Hefty [Fri, 28 Jun 2013 17:55:36 +0000 (10:55 -0700)]
Allow user to preload address data without route data

ACM must load routing data (path records) before it can
preload address information.  Remove this order requirement.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoAdd option to allow for ACM cache lookup performance measurement
Hal Rosenstock [Fri, 21 Jun 2013 00:29:03 +0000 (03:29 +0300)]
Add option to allow for ACM cache lookup performance measurement

-C option is added for resolution repetition count

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoAdd support for preloading IPv4 and IPv6 ACM caches
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>
11 years agoConvert linux header files from DOS to unix format
Hal Rosenstock [Thu, 27 Jun 2013 17:08:50 +0000 (20:08 +0300)]
Convert linux header files from DOS to unix format

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoib_acme.c: Support IPv6 addressing in resolve_ip
Hal Rosenstock [Wed, 19 Jun 2013 21:18:23 +0000 (00:18 +0300)]
ib_acme.c: Support IPv6 addressing in resolve_ip

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoIncrease buffer space for inet_ntop from 32 to INET6_ADDRSTRLEN
Hal Rosenstock [Wed, 19 Jun 2013 17:08:20 +0000 (20:08 +0300)]
Increase buffer space for inet_ntop from 32 to INET6_ADDRSTRLEN

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoAdd description of preloading GID and LID destination caches to acm_notes.txt
Hal Rosenstock [Thu, 27 Jun 2013 16:56:18 +0000 (19:56 +0300)]
Add description of preloading GID and LID destination caches to acm_notes.txt

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoAdd the ability to preload the destination GID and LID caches
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>
11 years agoUpdate ib_acme.1 and ibacm.1 man pages
Hal Rosenstock [Sun, 16 Jun 2013 12:26:36 +0000 (15:26 +0300)]
Update ib_acme.1 and ibacm.1 man pages

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoman: Change DOS formatting to unix formatting
Hal Rosenstock [Sat, 15 Jun 2013 14:24:24 +0000 (17:24 +0300)]
man: Change DOS formatting to unix formatting

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoib_acme: Enhance documention in generated ibacm_opt.cfg
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>
11 years agoacm_notes.txt: Change DOS formatting to unix formatting
Hal Rosenstock [Wed, 12 Jun 2013 18:37:37 +0000 (21:37 +0300)]
acm_notes.txt: Change DOS formatting to unix formatting

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoRemove sample ibacm_*.cfg files
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.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoUpdate build notes for the librdmacm
Sean Hefty [Thu, 9 May 2013 14:55:53 +0000 (07:55 -0700)]
Update build notes for the librdmacm

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoIncrease size of available file name
Sean Hefty [Mon, 25 Mar 2013 21:04:57 +0000 (14:04 -0700)]
Increase size of available file name

ibacm limits the path to the log and lock file to 32 characters.
This is too small for some users.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
11 years agoib_acme: Add option to display output in more readable format
Sean Hefty [Tue, 9 Oct 2012 18:39:15 +0000 (11:39 -0700)]
ib_acme: Add option to display output in more readable format

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