Debian Codegraph @

ibacm/man/ibacm_prov.7.in

raw
1 .\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md
2 .TH "IBACM_PROV" 7 "2014-06-16" "IBACM_PROV" "IB ACM Provider Guide" IBACM_PROV
3 .SH NAME
4 ibacm_prov \- InfiniBand communication management assistant provider interface
5 .SH SYNOPSIS
6 .B "#include <infiniband/acm_prov.h>"
7 .SH "DESCRIPTION"
8 The ibacm provider interface provides a plugin interface that allows a vendor
9 to implement proprietary solutions to support scalable address and route
10 resolution services over InfiniBand.
11 .P
12 To add a provider to the ibacm core service, the provider must
13 .TP
14 1. be implemented as a shared library;
15 .TP
16 2. be installed under a configured directory, eg., @ACM_PROVIDER_DIR@;
17 .TP
18 3 export a function provider_query() that returns a pointer to its provider info
19 and version info.
20 .P
21 The prototype of provider_query function is defined below:
22 .P
23 .nf
24 int provider_query(struct acm_provider **info, uint32_t *version);
25 .fi
26 .P
27 This function should return a pointer to its provider structure:
28 .P
29 .nf
30 struct acm_provider {
31 size_t size;
32 uint32_t version;
33 char *name;
34 int (*open_device)(const struct acm_device *device,
35 void **dev_context);
36 void (*close_device)(void *dev_context);
37 int (*open_port)(const struct acm_port *port,
38 void *dev_context, void **port_context);
39 void (*close_port)(void *port_context);
40 int (*open_endpoint)(const struct acm_endpoint *endpoint,
41 void *port_context, void **ep_context);
42 void (*close_endpoint)(void *ep_context);
43 int (*add_address)(const struct acm_address *addr, void *ep_context,
44 void **addr_context);
45 void (*remove_address)(void *addr_context);
46 int (*resolve)(void *addr_context, struct acm_msg *msg, uint64_t id);
47 int (*query)(void *addr_context, struct acm_msg *msg, uint64_t id);
48 int (*handle_event)(void *port_context, enum ibv_event_type type);
49 void (*query_perf)(void *ep_context, uint64_t *values, uint8_t *cnt);
50 };
51 .fi
52 .P
53 The size and version fields provide a way to detect version compatibility.
54 When a port is assigned to the provider, the ibacm core will call the
55 open/add_address functions; Similarly, when a port is down or re-assigned to
56 another provider, the close/remove_address functions will be invoked to release
57 resources. The ibacm core will centralize the management of events for each device
58 and events not handled by the ibacm core will be forwarded to the relevant port
59 through the handle_event() function. The resolve() function will be called to
60 resolve a destination name into a path record. The performance of the provider
61 for each endpoint can be queried by calling perf_query().
62 .P
63 To share a configuration file, the path for the ibacm configuration file is
64 exported through the variable opts_file. Each loaded provider can open this
65 configuration file and parse the contents related to its own operation.
66 Non-related sections should be ignored.
67 .P
68 Some helper functions are also exported by the ibacm core. For example, the
69 acm_log define (or the acm_write() function) can be used to log messages into
70 ibacm's log file (default @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/ibacm.log). For details, refer to
71 the acm_prov.h file.
72 .SH "NOTES"
73 A provider should always set the version in its provider info structure as the
74 value of the define ACM_PROV_VERSION at the time the provider is implemented. Never
75 set the version to ACM_PROV_VERSION itself as the define may be changed over time
76 when the provider interface is changed, unless the provider itself is placed in
77 ibacm source tree. This is to avoid the version problem when the old provider
78 implementation is built against a new acm_prov.h file. The ibacm will always
79 check the version of the provider at loading time.
80 .SH "SEE ALSO"
81 ib_acme(1), ibacm(7), ibacm(8)