prov/psm: Rename PFX to avoid conflict with fi.h

Both the framework and psm provider defines PFX.  Rename the PSM
define to avoid a conflict.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Move fabric definition into provider

The fabric definition needs to be part of the provider
code and not the framework.  Otherwise the framework
would need full knowledge of all possible fabrics - IB,
iWarp, vendor specific (e.g. Cray or IBM), etc.  There
is no standard mechanism defined for how a provider
discovers devices or communicates with drivers, which
makes fabric support difficult except at the provider
level.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
prov/sock: Implement open fabric call

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
prov/psm: Add fabric interface support

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
prov/ibv: Move fabric implementation into ibv provider

Move the fabric implementation from the framework code into
the ibverbs provider code.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Remove provider open domain call

Open domain can now be reached directly from an opened
fabric object.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Reference ep_attr and domain_attr from struct fi_info

Create a link from struct fi_info to struct fi_domain_attr,
similar to fi_ep_attr.  Applications can use the domain attributes
to restrict access to a domain with specific capabilities.

Move domain specific attributes from fi_info into the domain_attr
structure.  Move endpoint specific attributes from fi_info into
ep_attr.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Remove size parameter from query domain call

The size is determined by the version of the data structures
passed into fi_getinfo by the application.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Modify open domain to take domain attributes

Open domain only needs to take domain attributes as input, versus
the fi_info structure.  This simplifies the interface for the user
by more clearly indicating that the specified attributes will be
associated with the newly opened domain.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Eliminate fi_attr structure

The fi_query and struct fi_attr are somewhat confusing and unnecessary.
The fi_query call requires an fi_info structure as input, which
restricts when it can be used.  The prov_version field is a better fit
with a fabric attribute, and the hw_version and oui are better matches
with domain attributes.  I.e. a provider may support multiple types and
versions of hardware, including supporting hardware from multiple
vendors (e.g. verbs provider).

Rename fi_query to return only the base library version.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Merge pull request #74 from shefty/master

Expand endpoint and domain attributes
prov/psm: set funcptr to NULL for unsupported optional functions

This is required by the FI_CHECK_OP macro. Non-optional functions
continue to use the return value -ENOSYS to indicate unsupported
status.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: decouple domain creation from ep_cap

Some domain features are optional. Their settings depend on the
capabilities of the endpoints being opened. This patch allows
these optional features be turned on incrementallys, at the
time of endpoint opening.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: prevent the creation of EPs with resource confliction

Due to the limitation of PSM, all EPs share a single PSM endpoint
and PSM message queue. Two EPs exposing the same communication
interface would have confliction when accessing the shared PSM
resource. For example, we can't prevent a tagged message meant
to sent to one EP from being received by another instead.

To ensure correctness, we allow multiple EPs only if they don't
expose overlapping communication interface. For example, it is
allowed to have one EP for tagged messaging, another EP for
regular message queue, and yet another EP for RMA and atomics.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: remove the global psmx_ep_cap that is no longer used

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>