.\" Automatically generated by Pandoc 3.6.1 .\" .TH "ibv_create_counters" "3" "2018\-04\-02" "libibverbs" "Libibverbs Programmer\[cq]s Manual" .SH NAME \f[B]ibv_create_counters\f[R], \f[B]ibv_destroy_counters\f[R] \- Create or destroy a counters handle .SH SYNOPSIS .IP .EX #include \f[B]\f[R] \f[B]struct\f[R] ibv_counters * ibv_create_counters(\f[B]struct\f[R] ibv_context *context, \f[B]struct\f[R] ibv_counters_init_attr *init_attr); int ibv_destroy_counters(\f[B]struct\f[R] ibv_counters *counters); .EE .SH DESCRIPTION \f[B]ibv_create_counters\f[R]() creates a new counters handle for the RDMA device context. .PP An ibv_counters handle can be attached to a verbs resource (e.g.: QP, WQ, Flow) statically when these are created. .PP For example attach an ibv_counters statically to a Flow (struct ibv_flow) during creation of a new Flow by calling \f[B]ibv_create_flow()\f[R]. .PP Counters are cleared upon creation and values will be monotonically increasing. .PP \f[B]ibv_destroy_counters\f[R]() releases the counters handle, user should detach the counters object before destroying it. .SH ARGUMENTS .TP \f[I]context\f[R] RDMA device context to create the counters on. .TP \f[I]init_attr\f[R] Is an ibv_counters_init_attr struct, as defined in verbs.h. .SS \f[I]init_attr\f[R] Argument .IP .EX \f[B]struct\f[R] ibv_counters_init_attr { int comp_mask; }; .EE .TP \f[I]comp_mask\f[R] Bitmask specifying what fields in the structure are valid. .SH RETURN VALUE \f[B]ibv_create_counters\f[R]() returns a pointer to the allocated ibv_counters object, or NULL if the request fails (and sets errno to indicate the failure reason) .PP \f[B]ibv_destroy_counters\f[R]() returns 0 on success, or the value of errno on failure (which indicates the failure reason) .SH ERRORS .TP EOPNOTSUPP \f[B]ibv_create_counters\f[R]() is not currently supported on this device (ENOSYS may sometimes be returned by old versions of libibverbs). .TP ENOMEM \f[B]ibv_create_counters\f[R]() could not create ibv_counters object, not enough memory .TP EINVAL invalid parameter supplied \f[B]ibv_destroy_counters\f[R]() .SH EXAMPLE An example of use of ibv_counters is shown in \f[B]ibv_read_counters\f[R] .SH SEE ALSO \f[B]ibv_attach_counters_point_flow\f[R], \f[B]ibv_read_counters\f[R], \f[B]ibv_create_flow\f[R] .SH AUTHORS Raed Salem \c .MT raeds@mellanox.com .ME \c .PP Alex Rosenbaum \c .MT alexr@mellanox.com .ME \c