1IBV_ADVISE_MR(3)        Libibverbs Programmer’s Manual        IBV_ADVISE_MR(3)
2
3
4

NAME

6       ibv_advise_mr  -  Gives advice or directions to the kernel about an ad‐
7       dress range belongs to a memory region (MR).
8

SYNOPSIS

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

DESCRIPTION

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

ARGUMENTS

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

RETURN VALUE

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       EOPNOTSUPP
60              libibverbs  or  provider  driver  doesn’t  support  the  ibv_ad‐
61              vise_mr() verb (ENOSYS may sometimes be returned by old versions
62              of libibverbs).
63
64       ENOTSUP
65              The advise operation isn’t supported.
66
67       EFAULT In one of the following: o When the range requested  is  out  of
68              the  MR  bounds, or when parts of it are not part of the process
69              address space.  o One of the lkeys provided in the scatter gath‐
70              er list is invalid or with wrong write access.
71
72       EINVAL In  one  of the following: o The PD is invalid.  o The flags are
73              invalid.
74

NOTES

76       An application may pre-fetch any address range within an  ODP  MR  when
77       using    the    IBV_ADVISE_MR_ADVICE_PREFETCH    or   IBV_ADVISE_MR_AD‐
78       VICE_PREFETCH_WRITE advice.  Semantically, this operation  is  best-ef‐
79       fort.   That  means the kernel does not guarantee that underlying pages
80       are updated in the HCA or the pre-fetched pages would remain resident.
81
82       When   using   IBV_ADVISE_MR_ADVICE_PREFETCH    or    IBV_ADVISE_MR_AD‐
83       VICE_PREFETCH_WRITE advice, the operation will be done in the following
84       stages: o Page in the user pages to memory (pages  aren’t  pinned).   o
85       Get  the  dma  mapping of these user pages.  o Post the underlying page
86       translations to the HCA.
87
88       If IBV_ADVISE_MR_FLAG_FLUSH is specified then the underlying pages  are
89       guaranteed  to  be updated in the HCA before returning SUCCESS.  Other‐
90       wise the driver can choose to postpone the posting of the new  transla‐
91       tions  to the HCA.  When performing a local RDMA access operation it is
92       recommended to use IBV_ADVISE_MR_FLAG_FLUSH flag with one of  the  pre-
93       fetch  advices  to increase probability that the pages translations are
94       valid in the HCA and avoid future page faults.
95

SEE ALSO

97       ibv_reg_mr(3), ibv_rereg_mr(3), ibv_dereg_mr(3)
98

AUTHOR

100       Aviad Yehezkel <aviadye@mellanox.com>
101
102
103
104libibverbs                        2018-10-19                  IBV_ADVISE_MR(3)
Impressum