Skip to content

Commit

Permalink
rdma/fi_eq: Support cntr byte counting
Browse files Browse the repository at this point in the history
Define new enum value to support byte counting with counters.

Signed-off-by: chadkoster-hpe <chad.koster@hpe.com>
  • Loading branch information
chadkoster-hpe authored and shefty committed Mar 7, 2024
1 parent 8c95e30 commit 57a229d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/rdma/fi_eq.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ struct fid_cq {
*/

enum fi_cntr_events {
FI_CNTR_EVENTS_COMP
FI_CNTR_EVENTS_COMP,
FI_CNTR_EVENTS_BYTES /* count bytes not completeion events */
};

struct fi_cntr_attr {
Expand Down
20 changes: 20 additions & 0 deletions man/fi_cntr.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,26 @@ struct fi_cntr_attr {
on all successful completions, separately from whether the operation
generates an entry in an event queue.

- *FI_CNTR_EVENTS_BYTES*
: The counter is incremented by the number of user bytes,
excluding any CQ data, transferred in a transport message
upon reaching the specified completion semantic.
For initiator side counters, the count reflects the size of the
requested transfer and is updated after the message reaches
the desired completion level (FI_INJECT_COMPLETE,
FI_TRANSMIT_COMPLETE, etc.). For send and write operations,
the count reflects the number of bytes transferred to the peer.
For read operations, the count reflects the number of bytes
returned in a read response. Operations which may both
write and read data, such as atomics, behave as read operations
at the initiator, but writes at the target. For target side
counters, the count reflects the size of received user data
and is incremented subject to target side completion semantics.
In most cases, this indicates FI_DELIVERY_COMPLETE, but may
differ when accessing device memory (HMEM). On error, the
tranfer size is not applied to the error field, that field is
increment by 1. The FI_COLLECTIVE transfer type is not supported.

*wait_obj*
: Counters may be associated with a specific wait object. Wait
objects allow applications to block until the wait object is
Expand Down
1 change: 1 addition & 0 deletions src/fi_tostr.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ ofi_tostr_cntr_events(char *buf, size_t len, enum fi_cntr_events events)
{
switch (events) {
CASEENUMSTRN(FI_CNTR_EVENTS_COMP, len);
CASEENUMSTRN(FI_CNTR_EVENTS_BYTES, len);
default:
ofi_strncatf(buf, len, "Unknown");
break;
Expand Down

0 comments on commit 57a229d

Please sign in to comment.