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>
Merge pull request #75 from j-xiong/master

prov/psm: cleanup after the domain attr change; multiple EPs; FI_CHECK_OP support
fabric: Add fi_addr_t datatype for mapped addresses

Introduce a new datatype for addresses that have been mapped
by an AV.  fi_addr_t is a 64-bit address, which is returned by
an AV insert or map call.  Update all unconnected data transfer
calls to accept this address type as input.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
man: Update man pages to reflect changes to fi_addr_t

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Modify EQ readfrom to return fi_addr_t

Update EQ completions to return source addressing data in
the form of fi_addr_t.  This allows the source address to be
used in a response.

To support this change, define that connectionless EPs must
be bound to an AV.  Also allow the app to specify is source
addressing data is required, or if the provider can indicate
if it exists.

The EQ readfrom call is no longer listed as optional, however,
whether source data is available is now endpoint dependent.  When
an event is read from an EQ and no source data is available, the
EQ will return FI_ADDR_UNSPEC.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Merge fi_info addr format fields

Now that we have fi_addr_t defined for data transfers and event
completions, we can eliminate the addr_format field from fi_info.
"Rename" info_addr_format to just addr_format.  And allow a single
address format to be used for all calls which specify an address:
connect, join, getname, getpeer, AV insert, etc.

We still support opaque protocol specific address formats for
applications that communicate addressing data out of band.

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