Struct ibverbs::Context
[−]
[src]
pub struct Context { /* fields omitted */ }
An RDMA context bound to a device.
Methods
impl Context
[src]
pub fn create_cq(
&self,
min_cq_entries: i32,
id: isize
) -> Result<CompletionQueue>
[src]
&self,
min_cq_entries: i32,
id: isize
) -> Result<CompletionQueue>
Create a completion queue (CQ).
When an outstanding Work Request, within a Send or Receive Queue, is completed, a Work Completion is being added to the CQ of that Work Queue. This Work Completion indicates that the outstanding Work Request has been completed (and no longer considered outstanding) and provides details on it (status, direction, opcode, etc.).
A single CQ can be shared for sending, receiving, and sharing across multiple QPs. The Work Completion holds the information to specify the QP number and the Queue (Send or Receive) that it came from.
min_cq_entries
defines the minimum size of the CQ. The actual created size can be equal
or higher than this value. id
is an opaque identifier that is echoed by
CompletionQueue::poll
.
Errors
EINVAL
: Invalidmin_cq_entries
(must be1 <= cqe <= dev_cap.max_cqe
).ENOMEM
: Not enough resources to complete this operation.
pub fn alloc_pd(&self) -> Result<ProtectionDomain, ()>
[src]
Allocate a protection domain (PDs) for the device's context.
The created PD will be used primarily to create QueuePair
s and MemoryRegion
s.
A protection domain is a means of protection, and helps you create a group of object that can work together. If several objects were created using PD1, and others were created using PD2, working with objects from group1 together with objects from group2 will not work.