1IBV_ADVISE_MR(3) Libibverbs Programmer's Manual IBV_ADVISE_MR(3)
2
3
4
6 ibv_advise_mr - Gives advice or directions to the kernel about an ad‐
7 dress range belongs to a memory region (MR).
8
10 #include <infiniband/verbs.h>
11
12 int ibv_advise_mr(struct ibv_pd *pd,
13 enum ibv_advise_mr_advice advice,
14 uint32_t flags,
15 struct ibv_sge *sg_list,
16 uint32_t num_sge)
17
19 ibv_advise_mr() Give advice or directions to the kernel about an ad‐
20 dress range belonging to a memory region (MR). Applications that are
21 aware of future access patterns can use this verb in order to leverage
22 this knowledge to improve system or application performance.
23
24 Conventional advice values
25
26 IBV_ADVISE_MR_ADVICE_PREFETCH
27 Pre-fetch a range of an on-demand paging MR. Make pages present
28 with read-only permission before the actual IO is conducted.
29 This would provide a way to reduce latency by overlapping pag‐
30 ing-in and either compute time or IO to other ranges.
31
32 IBV_ADVISE_MR_ADVICE_PREFETCH_WRITE
33 Like IBV_ADVISE_MR_ADVICE_PREFETCH but with read-access and
34 write-access permission to the fetched memory.
35
37 pd The protection domain (PD) associated with the MR.
38
39 advice The requested advise value (as listed above).
40
41 flags Describes the properties of the advise operation Conventional
42 advice values IBV_ADVISE_MR_FLAG_FLUSH : Request to be a syn‐
43 chronized operation. Return to the caller after the operation
44 is completed.
45
46 sg_list
47 Pointer to the s/g array When using IBV_ADVISE_OP_PREFETCH ad‐
48 vise value, all the lkeys of all the scatter gather elements
49 (SGEs) must be associated with ODP MRs (MRs that were registered
50 with IBV_ACCESS_ON_DEMAND).
51
52 num_sge
53 Number of elements in the s/g array
54
56 ibv_advise_mr() returns 0 when the call was successful, or the value of
57 errno on failure (which indicates the failure reason).
58
59 ENOSYS libibverbs or provider driver doesn't support the ibv_ad‐
60 vise_mr() verb.
61
62 ENOTSUP
63 The advise operation isn't supported.
64
65 EFAULT In one of the following: o When the range requested is out of
66 the MR bounds, or when parts of it are not part of the process
67 address space. o One of the lkeys provided in the scatter gath‐
68 er list is invalid or with wrong write access.
69
70 EINVAL In one of the following: o The PD is invalid. o The flags are
71 invalid.
72
74 An application may pre-fetch any address range within an ODP MR when
75 using the IBV_ADVISE_MR_ADVICE_PREFETCH or IBV_ADVISE_MR_AD‐
76 VICE_PREFETCH_WRITE advice. Semantically, this operation is best-ef‐
77 fort. That means the kernel does not guarantee that underlying pages
78 are updated in the HCA or the pre-fetched pages would remain resident.
79
80 When using IBV_ADVISE_MR_ADVICE_PREFETCH or IBV_ADVISE_MR_AD‐
81 VICE_PREFETCH_WRITE advice, the operation will be done in the following
82 stages: o Page in the user pages to memory (pages aren't pinned). o
83 Get the dma mapping of these user pages. o Post the underlying page
84 translations to the HCA.
85
86 If IBV_ADVISE_MR_FLAG_FLUSH is specified then the underlying pages are
87 guaranteed to be updated in the HCA before returning SUCCESS. Other‐
88 wise the driver can choose to postpone the posting of the new transla‐
89 tions to the HCA. When performing a local RDMA access operation it is
90 recommended to use IBV_ADVISE_MR_FLAG_FLUSH flag with one of the
91 pre-fetch advices to increase probability that the pages translations
92 are valid in the HCA and avoid future page faults.
93
95 ibv_reg_mr(3), ibv_rereg_mr(3), ibv_dereg_mr(3)
96
98 Aviad Yehezkel <aviadye@mellanox.com>
99
100
101
102libibverbs 2018-10-19 IBV_ADVISE_MR(3)