25 #ifndef __MOTR_NET_LNET_CORE_H__ 26 #define __MOTR_NET_LNET_CORE_H__ 626 #define NLX_PO2_SHIFT(n) \ 627 (((n) <= 8) ? 3 : ((n) <= 16) ? 4 : ((n) <= 32) ? 5 : \ 628 ((n) <= 64) ? 6 : ((n) <= 128) ? 7 : ((n) <= 256) ? 8 : \ 629 ((n) <= 512) ? 9 : ((n) / 0)) 630 #define NLX_ALLOC_ALIGNED_PTR(ptr) \ 631 ((ptr) = nlx_core_mem_alloc(sizeof ((ptr)[0]), \ 632 NLX_PO2_SHIFT(sizeof ((ptr)[0])))) 633 #define NLX_FREE_ALIGNED_PTR(ptr) \ 634 nlx_core_mem_free((ptr), sizeof ((ptr)[0]), \ 635 NLX_PO2_SHIFT(sizeof ((ptr)[0]))) 637 #define NLX_ALLOC(ptr, len) ({ ptr = m0_alloc(len); }) 638 #define NLX_ALLOC_PTR(ptr) M0_ALLOC_PTR(ptr) 639 #define NLX_ALLOC_ARR(ptr, nr) M0_ALLOC_ARR(ptr, nr)
static int nlx_core_buf_msg_recv(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
static int nlx_core_buf_passive_send(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
static const char * ep_addr
static void nlx_core_buf_deregister(struct nlx_core_domain *lcdom, struct nlx_core_buffer *lcbuf)
static void * nlx_core_mem_alloc(size_t size, unsigned shift)
static int32_t nlx_core_get_max_buffer_segments(struct nlx_core_domain *lcdom)
static void nlx_core_nidstrs_put(struct nlx_core_domain *lcdom, char ***nidary)
static void nlx_core_dom_fini(struct nlx_core_domain *lcdom)
M0_INTERNAL void nlx_core_dom_set_debug(struct nlx_core_domain *lcdom, unsigned dbg)
M0_INTERNAL void nlx_core_bevq_release(struct nlx_core_transfer_mc *lctm, size_t release)
uint64_t nlx_core_opaque_ptr_t
M0_INTERNAL void nlx_core_tm_set_debug(struct nlx_core_transfer_mc *lctm, unsigned dbg)
M0_INTERNAL int nlx_core_bevq_provision(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, size_t need)
static int nlx_core_dom_init(struct m0_net_domain *dom, struct nlx_core_domain *lcdom)
static struct m0_bufvec bvec
static struct m0_stob_domain * dom
void nlx_core_ep_addr_encode(struct nlx_core_domain *lcdom, const struct nlx_core_ep_addr *cepa, char buf[M0_NET_LNET_XEP_ADDR_LEN])
static void nlx_core_mem_free(void *data, size_t size, unsigned shift)
M0_INTERNAL bool nlx_core_buf_event_get(struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer_event *lcbe)
static int nlx_core_buf_passive_recv(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
static int nlx_core_nidstrs_get(struct nlx_core_domain *lcdom, char ***nidary)
static int nlx_core_buf_register(struct nlx_core_domain *lcdom, nlx_core_opaque_ptr_t buffer_id, const struct m0_bufvec *bvec, struct nlx_core_buffer *lcbuf)
static int nlx_core_buf_del(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
static bool nlx_core_ep_eq(const struct nlx_core_ep_addr *cep1, const struct nlx_core_ep_addr *cep2)
int nlx_core_ep_addr_decode(struct nlx_core_domain *lcdom, const char *ep_addr, struct nlx_core_ep_addr *cepa)
M0_INTERNAL void nlx_core_buf_desc_encode(struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf, struct nlx_core_buf_desc *cbd)
static int nlx_core_buf_active_send(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
static int nlx_core_tm_start(struct nlx_core_domain *lcdom, struct m0_net_transfer_mc *tm, struct nlx_core_transfer_mc *lctm)
static int nlx_core_buf_active_recv(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
static m0_bcount_t nlx_core_get_max_buffer_segment_size(struct nlx_core_domain *lcdom)
static int nlx_core_buf_event_wait(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, m0_time_t timeout)
static int nlx_core_buf_msg_send(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
M0_INTERNAL int nlx_core_buf_desc_decode(struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf, struct nlx_core_buf_desc *cbd)
static int nlx_core_new_blessed_bev(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer_event **bevp)
static m0_bcount_t nlx_core_get_max_buffer_size(struct nlx_core_domain *lcdom)
static void nlx_core_tm_stop(struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm)