nm_ibverbs.h
Go to the documentation of this file.
54uint32_t nm_ibverbs_copy_from_and_checksum(void*dest, nm_data_slicer_t*p_slicer, const void*src, nm_len_t offset, nm_len_t len);
55uint32_t nm_ibverbs_copy_to_and_checksum(const void*src, nm_data_slicer_t*p_slicer, void*dest, nm_len_t offset, nm_len_t len);
75 };
122static inline int nm_ibverbs_addr_eq(const struct nm_ibverbs_addr_s*p_addr1, const struct nm_ibverbs_addr_s*p_addr2)
250static void nm_ibverbs_cnx_addr_entry_destructor(struct nm_ibverbs_addr_s*p_addr, struct nm_ibverbs_cnx_addr_entry_s*p_entry)
255PUK_HASHTABLE_TYPE(nm_ibverbs_cnx_addr_entry, struct nm_ibverbs_addr_s*, struct nm_ibverbs_cnx_addr_entry_s*,
341struct nm_ibverbs_cnx_s*nm_ibverbs_cnx_create(struct nm_ibverbs_context_s*p_ibverbs_context, int cnx_id);
345void nm_ibverbs_cnx_connect_async(struct nm_ibverbs_cnx_s*p_ibverbs_cnx, const void*p_url, size_t urlsize);
352struct nm_ibverbs_cnx_s*nm_ibverbs_cnx_vector_connect(struct nm_ibverbs_context_s*p_ibverbs_context,
364void nm_ibverbs_cnx_lazy_create(struct nm_ibverbs_context_s*p_ibverbs_context, struct nm_ibverbs_cnx_s**pp_ibverbs_cnx,
390struct nm_ibverbs_cnx_s*nm_ibverbs_cnx_lazy_by_qpn(struct nm_ibverbs_context_s*p_ibverbs_context, uint32_t qpn)
392 struct nm_ibverbs_cnx_s*p_cnx = nm_ibverbs_cnx_qpn_hashtable_lookup(&p_ibverbs_context->connect.cnx_by_qpn, &qpn);
398struct nm_ibverbs_context_s*nm_ibverbs_context_resolve_opts(puk_context_t p_context, const struct nm_ibverbs_opts_s*p_opts);
420void nm_ibverbs_context_get_profile(struct nm_ibverbs_context_s*p_ibverbs_context, struct nm_drv_profile_s*p_profile);
423void nm_ibverbs_context_get_url(struct nm_ibverbs_context_s*p_ibverbs_context, const void**pp_url, size_t*p_urlsize);
426void nm_ibverbs_context_get_wide_url(struct nm_ibverbs_context_s*p_ibverbs_context, int session_size, int rank,
431void nm_ibverbs_context_set_srq_limit(struct nm_ibverbs_context_s*p_ibverbs_context, int srq_limit);
433struct ibv_mr*nm_ibverbs_reg_mr(struct nm_ibverbs_context_s*p_ibverbs_context, void*buf, size_t size,
510static inline int nm_ibverbs_recv_poll(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, uint64_t wrid)
512static inline int nm_ibverbs_recv_poll(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, uint64_t wrid)
522static inline int nm_ibverbs_send_poll(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, uint64_t wrid)
524static inline int nm_ibverbs_send_poll(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, uint64_t wrid)
534static inline int nm_ibverbs_send_flush(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, uint64_t wrid)
536static inline int nm_ibverbs_send_flush(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, uint64_t wrid)
547static inline int nm_ibverbs_send_flushn_total(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, int n)
549static inline int nm_ibverbs_send_flushn_total(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, int n)
560static inline int nm_ibverbs_send_flushn(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, int wrid, int n)
562static inline int nm_ibverbs_send_flushn(struct nm_ibverbs_cnx_s*__restrict__ p_ibverbs_cnx, int wrid, int n)
614static inline void nm_ibverbs_regpool_entry_segment(const struct nm_ibverbs_regpool_entry_s*p_entry, struct nm_ibverbs_segment_s*p_seg)
646void nm_ibverbs_regpool_init(struct nm_ibverbs_regpool_s*p_regpool, struct nm_ibverbs_context_s*p_ibverbs_context, nm_len_t entry_size, nm_len_t slice_size);
650const struct nm_ibverbs_regpool_entry_s*nm_ibverbs_regpool_alloc_entry(struct nm_ibverbs_regpool_s*p_regpool);
652void nm_ibverbs_regpool_free_entry(struct nm_ibverbs_regpool_s*p_regpool, const struct nm_ibverbs_regpool_entry_s*p_entry);
assert(p_data->ops.p_traversal !=NULL)
static int nm_ibverbs_rdma_poll_recv(struct nm_ibverbs_cnx_s *__restrict__ p_ibverbs_cnx) __attribute__((warn_unused_result))
Definition nm_ibverbs.h:504
uint32_t nm_ibverbs_copy_from_and_checksum(void *dest, nm_data_slicer_t *p_slicer, const void *src, nm_len_t offset, nm_len_t len)
uint32_t nm_ibverbs_copy_to_and_checksum(const void *src, nm_data_slicer_t *p_slicer, void *dest, nm_len_t offset, nm_len_t len)
int nm_ibverbs_rdma_poll_inout(struct nm_ibverbs_cnx_s *__restrict__ p_ibverbs_cnx, int inout) __attribute__((warn_unused_result))
void nm_ibverbs_cnx_connect_wait(struct nm_ibverbs_cnx_s *p_ibverbs_cnx)
PUK_LIST_TYPE(nm_ibverbs_cnx_addr_entry, struct nm_ibverbs_cnx_addr_msg_s msg;enum nm_ibverbs_cnx_addr_state_e local_state;int local_timeout;uint64_t local_oob;struct nm_ibverbs_cnx_s *p_cnx;double t_timeout;)
an address entry used to store connection addresses
struct ibv_mr * nm_ibverbs_reg_mr(struct nm_ibverbs_context_s *p_ibverbs_context, void *buf, size_t size, struct nm_ibverbs_segment_s *p_segment)
static const char *const nm_ibverbs_status_strings[]
messages for Work Completion status
Definition nm_ibverbs.h:442
void nm_ibverbs_context_get_profile(struct nm_ibverbs_context_s *p_ibverbs_context, struct nm_drv_profile_s *p_profile)
static int nm_ibverbs_send_flushn(struct nm_ibverbs_cnx_s *__restrict__ p_ibverbs_cnx, int wrid, int n) __attribute__((warn_unused_result))
Definition nm_ibverbs.h:562
int nm_ibverbs_ud_recv_pool_poll(struct nm_ibverbs_ud_recv_pool_s *p_recv)
void nm_ibverbs_cnx_close(struct nm_ibverbs_cnx_s *p_ibverbs_cnx)
void nm_ibverbs_ud_send(struct nm_ibverbs_ud_ep_s *p_ud_ep, void *buf, size_t size, const struct nm_ibverbs_addr_s *p_remote_addr)
uint32_t nm_ibverbs_checksum(const char *data, nm_len_t len)
static void nm_ibverbs_cnx_addr_entry_destructor(struct nm_ibverbs_addr_s *p_addr, struct nm_ibverbs_cnx_addr_entry_s *p_entry)
Definition nm_ibverbs.h:250
int nm_ibverbs_do_rdma(struct nm_ibverbs_cnx_s *__restrict__ p_ibverbs_cnx, const void *__restrict__ buf, int size, uint64_t raddr, int opcode, int flags, uint32_t lkey, uint32_t rkey, uint64_t wrid) __attribute__((warn_unused_result))
int nm_ibverbs_context_wait_event(struct nm_ibverbs_context_s *p_ibverbs_context)
PUK_HASHTABLE_TYPE(nm_ibverbs_cnx_addr_entry, struct nm_ibverbs_addr_s *, struct nm_ibverbs_cnx_addr_entry_s *, &nm_ibverbs_addr_hash, &nm_ibverbs_addr_eq, &nm_ibverbs_cnx_addr_entry_destructor)
int nm_ibverbs_cnx_vector_enabled(void)
checks whether vector connect attribute is set
void nm_ibverbs_regpool_init(struct nm_ibverbs_regpool_s *p_regpool, struct nm_ibverbs_context_s *p_ibverbs_context, nm_len_t entry_size, nm_len_t slice_size)
static uint32_t nm_ibverbs_addr_hash(const struct nm_ibverbs_addr_s *p_addr)
Definition nm_ibverbs.h:130
int nm_ibverbs_ud_send_poll(struct nm_ibverbs_ud_send_s *p_send)
static uint64_t nm_ibverbs_cnx_lazy_get_oob(struct nm_ibverbs_cnx_s *p_ibverbs_cnx)
get latest oob data received
Definition nm_ibverbs.h:380
#define GRH_OFFSET
offset at the beginning of all messages to allow for GRH header to be inserted in UD mode
Definition nm_ibverbs.h:49
void nm_ibverbs_ud_recv_post(struct nm_ibverbs_ud_recv_s *p_recv, struct nm_ibverbs_ud_ep_s *p_ud_ep, void *buf, size_t size)
uint32_t nm_ibverbs_memcpy_and_checksum(void *_dest, const void *_src, nm_len_t len)
void nm_ibverbs_cnx_connect_async(struct nm_ibverbs_cnx_s *p_ibverbs_cnx, const void *p_url, size_t urlsize)
static int nm_ibverbs_segment_isnull(const struct nm_ibverbs_segment_s *p_seg)
Definition nm_ibverbs.h:94
static int nm_ibverbs_recv_poll(struct nm_ibverbs_cnx_s *__restrict__ p_ibverbs_cnx, uint64_t wrid) __attribute__((warn_unused_result))
Definition nm_ibverbs.h:512
void nm_ibverbs_regpool_destroy(struct nm_ibverbs_regpool_s *p_regpool)
void nm_ibverbs_regpool_free_entry(struct nm_ibverbs_regpool_s *p_regpool, const struct nm_ibverbs_regpool_entry_s *p_entry)
int nm_ibverbs_rdma_send(struct nm_ibverbs_cnx_s *p_ibverbs_cnx, int size, const void *__restrict__ ptr, const void *__restrict__ _raddr, const void *__restrict__ _lbase, const struct nm_ibverbs_segment_s *p_seg, const struct ibv_mr *__restrict__ mr, int wrid) __attribute__((warn_unused_result))
static void nm_ibverbs_regpool_entry_segment(const struct nm_ibverbs_regpool_entry_s *p_entry, struct nm_ibverbs_segment_s *p_seg)
fill segment from regpool entry
Definition nm_ibverbs.h:614
int nm_ibverbs_ud_recv_poll(struct nm_ibverbs_ud_recv_s *p_recv)
const struct nm_ibverbs_regpool_entry_s * nm_ibverbs_regpool_alloc_entry(struct nm_ibverbs_regpool_s *p_regpool)
static int nm_ibverbs_send_flushn_total(struct nm_ibverbs_cnx_s *__restrict__ p_ibverbs_cnx, int n) __attribute__((warn_unused_result))
Definition nm_ibverbs.h:549
static int nm_ibverbs_rdma_poll_send(struct nm_ibverbs_cnx_s *__restrict__ p_ibverbs_cnx) __attribute__((warn_unused_result))
Definition nm_ibverbs.h:497
int nm_ibverbs_cnx_lazy_enabled(void)
checks whether lazy connect attribute is set
static int nm_ibverbs_send_poll(struct nm_ibverbs_cnx_s *__restrict__ p_ibverbs_cnx, uint64_t wrid) __attribute__((warn_unused_result))
Definition nm_ibverbs.h:524
PUK_IFACE_TYPE(NewMad_ibverbs, struct nm_ibverbs_iface_s)
void nm_ibverbs_ud_recv_pool_reload(struct nm_ibverbs_ud_recv_pool_s *p_recv, int i)
static int nm_ibverbs_send_flush(struct nm_ibverbs_cnx_s *__restrict__ p_ibverbs_cnx, uint64_t wrid) __attribute__((warn_unused_result))
Definition nm_ibverbs.h:536
void nm_ibverbs_cnx_lazy_send_oob(struct nm_ibverbs_cnx_s *p_ibverbs_cnx, uint64_t oob)
send oob data to remote node
static struct nm_ibverbs_context_s * nm_ibverbs_context_resolve(puk_context_t p_context)
resolve context with default opts
Definition nm_ibverbs.h:409
void nm_ibverbs_cnx_lazy_create(struct nm_ibverbs_context_s *p_ibverbs_context, struct nm_ibverbs_cnx_s **pp_ibverbs_cnx, const void *p_remote_url, size_t url_size, int cnx_id)
dynamically create a lazy connection
void nm_ibverbs_ud_ep_open(struct nm_ibverbs_ud_ep_s *p_ud_ep, struct nm_ibverbs_hca_s *p_hca)
struct nm_ibverbs_cnx_s * nm_ibverbs_cnx_vector_connect(struct nm_ibverbs_context_s *p_ibverbs_context, const void *p_remote_url, size_t url_size)
return an already connected cnx, when vector connection is available
static void nm_ibverbs_context_default_opts(struct nm_ibverbs_opts_s *p_opts)
Definition nm_ibverbs.h:400
static int nm_ibverbs_qpn_eq(const uint32_t *p_int1, const uint32_t *p_int2)
Definition nm_ibverbs.h:111
void nm_ibverbs_ud_recv_pool_delete(struct nm_ibverbs_ud_recv_pool_s *p_recv)
void nm_ibverbs_cnx_lazy_progress(struct nm_ibverbs_context_s *p_ibverbs_context)
make progress on lazy connections
int nm_ibverbs_checksum_enabled(void)
static struct nm_ibverbs_cnx_s * nm_ibverbs_cnx_lazy_by_qpn(struct nm_ibverbs_context_s *p_ibverbs_context, uint32_t qpn)
Definition nm_ibverbs.h:390
PUK_LFSTACK_TYPE(nm_ibverbs_regpool_block, struct nm_ibverbs_regpool_entry_s entry;)
static int nm_ibverbs_addr_eq(const struct nm_ibverbs_addr_s *p_addr1, const struct nm_ibverbs_addr_s *p_addr2)
Definition nm_ibverbs.h:122
struct nm_ibverbs_context_s * nm_ibverbs_context_resolve_opts(puk_context_t p_context, const struct nm_ibverbs_opts_s *p_opts)
void nm_ibverbs_ud_send_post(struct nm_ibverbs_ud_send_s *p_send, struct nm_ibverbs_ud_ep_s *p_ud_ep, void *buf, size_t size, const struct nm_ibverbs_addr_s *p_remote_addr)
void nm_ibverbs_context_get_url(struct nm_ibverbs_context_s *p_ibverbs_context, const void **pp_url, size_t *p_urlsize)
get the address for this context
void nm_ibverbs_ud_recv(struct nm_ibverbs_ud_ep_s *p_ud_ep, void *buf, size_t size)
int nm_ibverbs_alignment
void nm_ibverbs_context_set_srq_limit(struct nm_ibverbs_context_s *p_ibverbs_context, int srq_limit)
void nm_ibverbs_hca_open(struct nm_ibverbs_hca_s *p_hca, const char *device, int port, int gidx)
struct nm_ibverbs_cnx_s * nm_ibverbs_cnx_create(struct nm_ibverbs_context_s *p_ibverbs_context, int cnx_id)
void nm_ibverbs_context_cancel_wait(struct nm_ibverbs_context_s *p_ibverbs_context)
void nm_ibverbs_hca_close(struct nm_ibverbs_hca_s *p_hca)
void nm_ibverbs_ud_ep_close(struct nm_ibverbs_ud_ep_s *p_ud_ep)
void nm_ibverbs_context_get_wide_url(struct nm_ibverbs_context_s *p_ibverbs_context, int session_size, int rank, const void **pp_url, size_t *p_urlsize)
get wide address for vector connect
static int nm_ibverbs_cnx_lazy_ready(struct nm_ibverbs_cnx_s *p_ibverbs_cnx)
returns whether the given lazy connection is ready for communication
Definition nm_ibverbs.h:368
static uint32_t nm_ibverbs_qpn_hash(const uint32_t *p_int)
Definition nm_ibverbs.h:115
void nm_ibverbs_ud_recv_pool_post(struct nm_ibverbs_ud_recv_pool_s *p_recv, struct nm_ibverbs_ud_ep_s *p_ud_ep, void *buf, size_t size, int depth)
#define NM_IBVERBS_UD_DEPTH
size of QP for send/recv on UD QP for connection establishment
Definition nm_ibverbs.h:29
void nm_ibverbs_context_delete(struct nm_ibverbs_context_s *p_ibverbs_context)
int nm_ibverbs_dereg_mr(struct nm_ibverbs_context_s *p_ibverbs_context, struct ibv_mr *p_mr)
int nm_ibverbs_memalign
@ NM_IBVERBS_WRID_UD_RECV_POOL_LAST
size of QP for send/recv on UD QP for connection establishment
Definition nm_ibverbs.h:82
Definition of the minidriver interface.
nm_len_t size
size of the onsided data (not incuding target-side completion)
Definition nm_onesided_private.h:1
main header for private nmad definitions.
This is the common public header for NewMad.
an addresse entry used to exchange connection addresses
Definition nm_ibverbs.h:220
struct nm_ibverbs_addr_s ud_addr
remote address of IB context (UD endpoint)
Definition nm_ibverbs.h:221
enum nm_ibverbs_cnx_addr_msg_s::nm_ibverbs_cnx_addr_state_e state
remote latest received state
nm_ibverbs_cnx_addr_state_e
Definition nm_ibverbs.h:224
a packet sent through UD for address exchange
Definition nm_ibverbs.h:235
struct nm_ibverbs_cnx_addr_msg_s addr_msg
Definition nm_ibverbs.h:237
struct nm_ibverbs_cnx_addr_entry_s * p_addr_entry
address entry for thix cnx
Definition nm_ibverbs.h:307
struct nm_ibverbs_cnx_s::@6 vector_connect
information only available when vectored connection is used.
struct nm_ibverbs_context_s * p_ibverbs_context
Definition nm_ibverbs.h:314
int use_comp_channel
whether we will use completion channel (blocking syscalls)
Definition nm_ibverbs.h:299
struct nm_ibverbs_ud_recv_pool_s recv_pool
Definition nm_ibverbs.h:276
struct nm_ibverbs_cnx_qpn_hashtable_s cnx_by_qpn
table of cnx hashed by their local QPN
Definition nm_ibverbs.h:274
struct nm_ibverbs_cnx_addr_entry_list_s pending_entries
list of entries currently in progress, sorted by timeout
Definition nm_ibverbs.h:275
struct nm_ibverbs_cnx_s ** pp_cached_cnxs
array of pre-allocated connections
Definition nm_ibverbs.h:285
struct ibv_comp_channel * comp_channel
completion channel for blocking calls
Definition nm_ibverbs.h:291
struct nm_ibverbs_context_s::nm_ibverbs_opts_s ib_opts
struct nm_ibverbs_context_s::@4 srq
struct nm_ibverbs_cnx_addr_entry_hashtable_s addr_hash
cnx addresses, hashed by remote context address
Definition nm_ibverbs.h:273
void * p_wide_url
wide url containing both UD url & vector of pre-allocated cnxs
Definition nm_ibverbs.h:282
struct nm_ibverbs_cnx_connect_packet_s recv_packets[8192]
Definition nm_ibverbs.h:277
struct nm_ibverbs_context_s::@3 vector_connect
vectored connection, for launchers that support wide url and drivers with bare IB addr (no segment)
struct nm_ibverbs_hca_s::@1 async_events
void(* p_reg_back_pressure)(void *, nm_len_t)
function to ask to reduce pressure on memory registration to rcache
Definition nm_ibverbs.h:176
nm_len_t size_mem_reg
total amount of memory registered in this HCA context
Definition nm_ibverbs.h:174
struct nm_ibverbs_hca_s::@0 ib_caps
Definition nm_ibverbs.h:608
struct nm_ibverbs_regpool_slice_lfstack_s slices
Definition nm_ibverbs.h:634
struct nm_ibverbs_context_s * p_ibverbs_context
Definition nm_ibverbs.h:638
struct nm_ibverbs_regpool_block_lfstack_s blocks
Definition nm_ibverbs.h:635
Definition nm_ibverbs.h:200
Definition nm_ibverbs.h:194
Definition nm_ibverbs.h:209
Definition nm_core_interface.h:1023