| 1 |
/* |
| 2 |
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All |
| 3 |
* rights reserved. |
| 4 |
* Copyright (c) 2015-2016 Cray Inc. All rights reserved. |
| 5 |
* |
| 6 |
* This software is available to you under a choice of one of two |
| 7 |
* licenses. You may choose to be licensed under the terms of the GNU |
| 8 |
* General Public License (GPL) Version 2, available from the file |
| 9 |
* COPYING in the main directory of this source tree, or the |
| 10 |
* BSD license below: |
| 11 |
* |
| 12 |
* Redistribution and use in source and binary forms, with or |
| 13 |
* without modification, are permitted provided that the following |
| 14 |
* conditions are met: |
| 15 |
* |
| 16 |
* - Redistributions of source code must retain the above |
| 17 |
* copyright notice, this list of conditions and the following |
| 18 |
* disclaimer. |
| 19 |
* |
| 20 |
* - Redistributions in binary form must reproduce the above |
| 21 |
* copyright notice, this list of conditions and the following |
| 22 |
* disclaimer in the documentation and/or other materials |
| 23 |
* provided with the distribution. |
| 24 |
* |
| 25 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 26 |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 27 |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 28 |
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 29 |
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 30 |
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 31 |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 32 |
* SOFTWARE. |
| 33 |
*/ |
| 34 |
|
| 35 |
#ifndef _FI_DIRECT_RMA_H_ |
| 36 |
#define _FI_DIRECT_RMA_H_ |
| 37 |
|
| 38 |
#define FABRIC_DIRECT_RMA 1 |
| 39 |
|
| 40 |
/******************************************************************************* |
| 41 |
* GNI API Functions |
| 42 |
******************************************************************************/ |
| 43 |
extern ssize_t gnix_ep_read(struct fid_ep *ep, void *buf, size_t len, |
| 44 |
void *desc, fi_addr_t src_addr, uint64_t addr, |
| 45 |
uint64_t key, void *context); |
| 46 |
|
| 47 |
extern ssize_t gnix_ep_readv(struct fid_ep *ep, const struct iovec *iov, |
| 48 |
void **desc, size_t count, fi_addr_t src_addr, |
| 49 |
uint64_t addr, uint64_t key, void *context); |
| 50 |
|
| 51 |
extern ssize_t gnix_ep_readmsg(struct fid_ep *ep, const struct fi_msg_rma *msg, |
| 52 |
uint64_t flags); |
| 53 |
|
| 54 |
extern ssize_t gnix_ep_write(struct fid_ep *ep, const void *buf, size_t len, |
| 55 |
void *desc, fi_addr_t dest_addr, uint64_t addr, |
| 56 |
uint64_t key, void *context); |
| 57 |
|
| 58 |
extern ssize_t gnix_ep_writev(struct fid_ep *ep, const struct iovec *iov, |
| 59 |
void **desc, size_t count, fi_addr_t dest_addr, |
| 60 |
uint64_t addr, uint64_t key, void *context); |
| 61 |
|
| 62 |
extern ssize_t gnix_ep_writemsg(struct fid_ep *ep, const struct fi_msg_rma *msg, |
| 63 |
uint64_t flags); |
| 64 |
|
| 65 |
extern ssize_t gnix_ep_rma_inject(struct fid_ep *ep, const void *buf, |
| 66 |
size_t len, fi_addr_t dest_addr, |
| 67 |
uint64_t addr, uint64_t key); |
| 68 |
|
| 69 |
extern ssize_t gnix_ep_writedata(struct fid_ep *ep, const void *buf, size_t len, |
| 70 |
void *desc, uint64_t data, fi_addr_t dest_addr, |
| 71 |
uint64_t addr, uint64_t key, void *context); |
| 72 |
|
| 73 |
extern ssize_t gnix_ep_rma_injectdata(struct fid_ep *ep, const void *buf, |
| 74 |
size_t len, uint64_t data, |
| 75 |
fi_addr_t dest_addr, uint64_t addr, |
| 76 |
uint64_t key); |
| 77 |
|
| 78 |
/******************************************************************************* |
| 79 |
* Libfabric API Functions |
| 80 |
******************************************************************************/ |
| 81 |
static inline ssize_t fi_read(struct fid_ep *ep, void *buf, size_t len, |
| 82 |
void *desc, fi_addr_t src_addr, uint64_t addr, |
| 83 |
uint64_t key, void *context) |
| 84 |
{ |
| 85 |
return gnix_ep_read(ep, buf, len, desc, src_addr, addr, key, context); |
| 86 |
} |
| 87 |
|
| 88 |
static inline ssize_t fi_readv(struct fid_ep *ep, const struct iovec *iov, |
| 89 |
void **desc, size_t count, fi_addr_t src_addr, |
| 90 |
uint64_t addr, uint64_t key, void *context) |
| 91 |
{ |
| 92 |
return gnix_ep_readv(ep, iov, desc, count, src_addr, addr, key, |
| 93 |
context); |
| 94 |
} |
| 95 |
|
| 96 |
static inline ssize_t fi_readmsg(struct fid_ep *ep, |
| 97 |
const struct fi_msg_rma *msg, uint64_t flags) |
| 98 |
{ |
| 99 |
return gnix_ep_readmsg(ep, msg, flags); |
| 100 |
} |
| 101 |
|
| 102 |
static inline ssize_t fi_write(struct fid_ep *ep, const void *buf, size_t len, |
| 103 |
void *desc, fi_addr_t dest_addr, uint64_t addr, |
| 104 |
uint64_t key, void *context) |
| 105 |
{ |
| 106 |
return gnix_ep_write(ep, buf, len, desc, dest_addr, addr, key, context); |
| 107 |
} |
| 108 |
|
| 109 |
static inline ssize_t fi_writev(struct fid_ep *ep, const struct iovec *iov, |
| 110 |
void **desc, size_t count, fi_addr_t dest_addr, |
| 111 |
uint64_t addr, uint64_t key, void *context) |
| 112 |
{ |
| 113 |
return gnix_ep_writev(ep, iov, desc, count, dest_addr, addr, key, |
| 114 |
context); |
| 115 |
} |
| 116 |
|
| 117 |
static inline ssize_t fi_writemsg(struct fid_ep *ep, |
| 118 |
const struct fi_msg_rma *msg, uint64_t flags) |
| 119 |
{ |
| 120 |
return gnix_ep_writemsg(ep, msg, flags); |
| 121 |
} |
| 122 |
|
| 123 |
static inline ssize_t fi_inject_write(struct fid_ep *ep, const void *buf, |
| 124 |
size_t len, fi_addr_t dest_addr, |
| 125 |
uint64_t addr, uint64_t key) |
| 126 |
{ |
| 127 |
return gnix_ep_rma_inject(ep, buf, len, dest_addr, addr, key); |
| 128 |
} |
| 129 |
|
| 130 |
static inline ssize_t fi_writedata(struct fid_ep *ep, const void *buf, |
| 131 |
size_t len, void *desc, uint64_t data, |
| 132 |
fi_addr_t dest_addr, uint64_t addr, |
| 133 |
uint64_t key, void *context) |
| 134 |
{ |
| 135 |
return gnix_ep_writedata(ep, buf, len, desc, data, dest_addr, addr, key, |
| 136 |
context); |
| 137 |
} |
| 138 |
|
| 139 |
static inline ssize_t fi_inject_writedata(struct fid_ep *ep, const void *buf, |
| 140 |
size_t len, uint64_t data, |
| 141 |
fi_addr_t dest_addr, uint64_t addr, |
| 142 |
uint64_t key) |
| 143 |
{ |
| 144 |
return gnix_ep_rma_injectdata(ep, buf, len, data, dest_addr, addr, key); |
| 145 |
} |
| 146 |
|
| 147 |
#endif /* _FI_DIRECT_RMA_H_ */ |