RDMA++
Loading...
Searching...
No Matches
pd.h
1#pragma once
2
3#include <memory>
4
5#include <infiniband/verbs.h>
6
7#include "rdmapp/device.h"
8#include "rdmapp/mr.h"
9
10#include "rdmapp/detail/noncopyable.h"
11
12namespace rdmapp {
13
14class qp;
15
20class pd : public noncopyable, public std::enable_shared_from_this<pd> {
21 std::shared_ptr<device> device_;
22 struct ibv_pd *pd_;
23 friend class qp;
24 friend class srq;
25
26public:
32 pd(std::shared_ptr<device> device);
33
39 std::shared_ptr<device> device_ptr() const;
40
49 local_mr reg_mr(void *addr, size_t length,
50 int flags = IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE |
51 IBV_ACCESS_REMOTE_READ |
52 IBV_ACCESS_REMOTE_ATOMIC);
57 ~pd();
58};
59
60} // namespace rdmapp
This class is an abstraction of an Infiniband device.
Definition device.h:48
Represents a local memory region.
Definition mr.h:34
Definition noncopyable.h:5
This class is an abstraction of a Protection Domain.
Definition pd.h:20
local_mr reg_mr(void *addr, size_t length, int flags=IBV_ACCESS_LOCAL_WRITE|IBV_ACCESS_REMOTE_WRITE|IBV_ACCESS_REMOTE_READ|IBV_ACCESS_REMOTE_ATOMIC)
Register a local memory region.
Definition pd.cc:24
~pd()
Destroy the pd object and the associated protection domain.
Definition pd.cc:30
std::shared_ptr< device > device_ptr() const
Get the device object pointer.
Definition pd.cc:22
This class is an abstraction of an Infiniband Queue Pair.
Definition qp.h:50
This class represents a Shared Receive Queue.
Definition srq.h:15