Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions providers/efa/efadv.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ struct efadv_cq_attr {
uint8_t *buffer;
uint32_t entry_size;
uint32_t num_entries;
uint32_t *doorbell;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is address, why is it uint32_t and not uint64_t?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doorbell is 32 bits and I prefer returning a relevant pointer type rather than an address, in similar to what we do in efadv_query_qp_wqs.
Changed the commit message to better reflect on this.

};

int efadv_query_cq(struct ibv_cq *ibvcq, struct efadv_cq_attr *attr, uint32_t inlen);
Expand Down
5 changes: 5 additions & 0 deletions providers/efa/man/efadv_query_cq.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct efadv_cq_attr {
uint8_t *buffer;
uint32_t entry_size;
uint32_t num_entries;
uint32_t *doorbell;
};
```

Expand All @@ -51,6 +52,10 @@ struct efadv_cq_attr {
*num_entries*
: Maximal number of entries in the completion queue.

*doorbell*
: Reverse doorbell used to update the device of polled entries and to
request notifications. NULL when not in use for this Completion Queue.

# RETURN VALUE

**efadv_query_cq()** returns 0 on success, or the value of errno on failure
Expand Down
3 changes: 3 additions & 0 deletions providers/efa/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,9 @@ int efadv_query_cq(struct ibv_cq *ibvcq, struct efadv_cq_attr *attr, uint32_t in
attr->entry_size = cq->cqe_size;
attr->num_entries = ibvcq->cqe;

if (vext_field_avail(typeof(*attr), doorbell, inlen))
attr->doorbell = cq->db;

return 0;
}

Expand Down