1ibv_attach_counters_pointL_ifbliobwv(e3r)bs Programmer’isbvM_aantutaalch_counters_point_flow(3)
2
3
4
6 ibv_attach_counters_point_flow - attach individual counter definition
7 to a flow object
8
10 #include <infiniband/verbs.h>
11
12 int ibv_attach_counters_point_flow(struct ibv_counters *counters,
13 struct ibv_counter_attach_attr *counter_attach_attr,
14 struct ibv_flow *flow);
15
17 Attach counters point are a family of APIs to attach individual counter
18 description definition to a verb object at a specific index location.
19
20 Counters object will start collecting values after it is bound to the
21 verb object resource.
22
23 A static attach can be created when NULL is provided instead of the
24 reference to the verbs object (e.g.: in case of flow providing NULL in‐
25 stead of flow). In this case, this counters object will only start
26 collecting values after it is bound to the verbs resource, for flow
27 this is when referencing the counters handle when creating a flow with
28 ibv_create_flow().
29
30 Once an ibv_counters is bound statically to a verbs resource, no addi‐
31 tional attach is allowed till the counter object is not bound to any
32 verb object.
33
34 The argument counter_desc specifies which counter value should be col‐
35 lected. It is defined in verbs.h as one of the enum ibv_counter_de‐
36 scription options.
37
38 Supported capabilities of specific counter_desc values per verbs object
39 can be tested by checking the return value for success or ENOTSUP er‐
40 rno.
41
42 Attaching a counters handle to multiple objects of the same type will
43 accumulate the values into a single index. e.g.: creating several
44 ibv_flow(s) with the same ibv_counters handle will collect the values
45 from all relevant flows into the relevant index location when reading
46 the values from ibv_read_counters(), setting the index more than once
47 with different or same counter_desc will aggregate the values from all
48 relevant counters into the relevant index location.
49
50 The runtime values of counters can be read from the hardware by calling
51 ibv_read_counters().
52
54 counters
55 Existing counters to attach new counter point on.
56
57 counter_attach_attr
58 An ibv_counter_attach_attr struct, as defined in verbs.h.
59
60 flow Existing flow to attach a new counters point on (in static mode
61 it must be NULL).
62
63 counter_attach_attr Argument
64 struct ibv_counter_attach_attr {
65 enum ibv_counter_description counter_desc;
66 uint32_t index;
67 uint32_t comp_mask;
68 };
69
70 counter_desc Argument
71 enum ibv_counter_description {
72 IBV_COUNTER_PACKETS,
73 IBV_COUNTER_BYTES,
74 };
75
76 index Desired location of the specific counter at the counters object.
77
78 comp_mask
79 Bitmask specifying what fields in the structure are valid.
80
82 ibv_attach_counters_point_flow() returns 0 on success, or the value of
83 errno on failure (which indicates the failure reason)
84
86 EINVAL invalid argument(s) passed
87
88 ENOTSUP
89 counter_desc is not supported on the requested object
90
91 EBUSY the counter object is already bound to a flow, additional attach
92 calls is not allowed (valid for static attach only)
93
94 ENOMEM not enough memory
95
97 Counter values in each index location are cleared upon creation when
98 calling ibv_create_counters(). Attaching counters points will only in‐
99 crease these values accordingly.
100
102 An example of use of ibv_attach_counters_point_flow() is shown in
103 ibv_read_counters
104
106 ibv_create_counters, ibv_destroy_counters, ibv_read_counters, ibv_cre‐
107 ate_flow
108
110 Raed Salem <raeds@mellanox.com>
111
112 Alex Rosenbaum <alexr@mellanox.com>
113
114
115
116libibverbs 2018-04-02 ibv_attach_counters_point_flow(3)