23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_NET 179 return bp !=
NULL &&
bp->xb_buffer == nb &&
207 if (
dom->nd_xprt_private !=
NULL) {
209 dp =
dom->nd_xprt_private;
213 return M0_RC(-ENOMEM);
215 dom->nd_xprt_private = dp;
299 struct sockaddr_in sa;
309 buf[
sizeof(
buf)-1] =
'\0';
310 for (
p=
buf; *
p && *
p !=
':';
p++);
315 for (
p=pp; *
p && *
p !=
':';
p++);
318 sscanf(
p,
"%u", &
id);
324 sscanf(pp,
"%d", &pnum);
325 sa.sin_port = htons(pnum);
328 sa.sin_addr.s_addr = in_aton(dot_ip);
329 if (sa.sin_addr.s_addr == 0)
332 if (inet_aton(dot_ip, &sa.sin_addr) == 0)
644 if (wi_st_chg ==
NULL)
665 "mem_tm_worker%d",
i);
693 if (wi_st_chg ==
NULL)
766 #undef M0_TRACE_SUBSYSTEM struct m0_list_link xwi_link
static bool mem_dom_invariant(const struct m0_net_domain *dom)
const struct m0_net_xprt_ops * nx_ops
M0_INTERNAL void m0_list_link_fini(struct m0_list_link *link)
static struct m0_net_bulk_mem_end_point * mem_ep_alloc(void)
static struct m0_addb2_philter p
static void mem_wf_msg_send(struct m0_net_transfer_mc *tm, struct m0_net_bulk_mem_work_item *wi)
static void mem_wf_msg_recv_cb(struct m0_net_transfer_mc *tm, struct m0_net_bulk_mem_work_item *wi)
struct m0_net_transfer_mc * nb_tm
struct m0_cond xtm_work_list_cv
M0_INTERNAL void m0_list_add(struct m0_list *head, struct m0_list_link *new)
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
static int mem_xo_tm_start(struct m0_net_transfer_mc *tm, const char *addr)
enum m0_net_bulk_mem_tm_state xtm_state
static m0_bcount_t mem_xo_get_max_buffer_desc_size(const struct m0_net_domain *dom)
static bool mem_ep_invariant(const struct m0_net_end_point *ep)
M0_INTERNAL void m0_net_bulk_mem_tm_set_num_threads(struct m0_net_transfer_mc *tm, size_t num)
static struct m0_net_buffer * mem_wi_to_buffer(struct m0_net_bulk_mem_work_item *wi)
struct m0_bufvec nb_buffer
M0_INTERNAL void m0_net__tm_cancel(struct m0_net_transfer_mc *tm)
static bool mem_bmo_buffer_in_bounds(const struct m0_net_buffer *nb)
int m0_thread_join(struct m0_thread *q)
M0_INTERNAL void m0_list_init(struct m0_list *head)
static void mem_wi_post_buffer_event(struct m0_net_bulk_mem_work_item *wi)
struct m0_list_link xd_dom_linkage
static void mem_wi_add(struct m0_net_bulk_mem_work_item *wi, struct m0_net_bulk_mem_tm_pvt *tp)
static struct m0_list mem_domains
enum m0_net_tm_state ntm_state
struct m0_thread * xtm_worker_threads
static void mem_wf_cancel_cb(struct m0_net_transfer_mc *tm, struct m0_net_bulk_mem_work_item *wi)
static const struct m0_net_bulk_mem_ops mem_xprt_methods
M0_INTERNAL void m0_list_fini(struct m0_list *head)
enum m0_net_bulk_mem_work_opcode xwi_op
enum m0_net_bulk_mem_tm_state xwi_next_state
M0_INTERNAL void m0_list_del(struct m0_list_link *old)
struct m0_net_domain * ntm_dom
M0_INTERNAL void m0_net_xprt_default_set(const struct m0_net_xprt *xprt)
struct m0_net_buffer s_nb
static void mem_wf_state_change(struct m0_net_transfer_mc *tm, struct m0_net_bulk_mem_work_item *wi)
M0_INTERNAL int m0_mem_xprt_init(void)
#define M0_THREAD_INIT(thread, TYPE, init, func, arg, namefmt,...)
static int mem_xo_buf_register(struct m0_net_buffer *nb)
struct m0_list xtm_work_list
struct m0_net_end_point * xwi_nbe_ep
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
struct m0_net_buffer * nbe_buffer
M0_INTERNAL void m0_net_buffer_event_post(const struct m0_net_buffer_event *ev)
M0_INTERNAL void m0_cond_init(struct m0_cond *cond, struct m0_mutex *mutex)
static int mem_xo_end_point_create(struct m0_net_end_point **epp, struct m0_net_transfer_mc *tm, const char *addr)
M0_INTERNAL uint32_t default_xo_rpc_max_segs_nr(struct m0_net_domain *ndom)
static void mem_xo_buf_del(struct m0_net_buffer *nb)
static int mem_bmo_desc_create(struct m0_net_buf_desc *desc, struct m0_net_transfer_mc *tm, enum m0_net_queue_type qt, m0_bcount_t buflen, int64_t buf_id)
static struct m0_net_bulk_mem_end_point * mem_ep_to_pvt(const struct m0_net_end_point *ep)
static void mem_post_error(struct m0_net_transfer_mc *tm, int status)
M0_INTERNAL void m0_net_xprt_register(const struct m0_net_xprt *xprt)
return M0_ERR(-EOPNOTSUPP)
static void mem_xo_dom_fini(struct m0_net_domain *dom)
static m0_bcount_t mem_xo_get_max_buffer_size(const struct m0_net_domain *dom)
enum m0_net_queue_type nb_qtype
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_copy(struct m0_bufvec_cursor *dcur, struct m0_bufvec_cursor *scur, m0_bcount_t num_bytes)
static int mem_xo_buf_add(struct m0_net_buffer *nb)
m0_bcount_t xwi_nbe_length
static void mem_xo_buf_deregister(struct m0_net_buffer *nb)
static int mem_copy_buffer(struct m0_net_buffer *d_nb, struct m0_net_buffer *s_nb, m0_bcount_t num_bytes)
M0_INTERNAL bool m0_mutex_is_locked(const struct m0_mutex *mutex)
const struct m0_net_xprt * nd_xprt
static void mem_xo_end_point_release(struct m0_ref *ref)
M0_INTERNAL void m0_cond_fini(struct m0_cond *cond)
m0_time_t m0_time_now(void)
#define M0_DEFAULT_NETWORK
static struct m0_stob_domain * dom
M0_INTERNAL void m0_bufvec_cursor_init(struct m0_bufvec_cursor *cur, const struct m0_bufvec *bvec)
M0_INTERNAL void m0_cond_signal(struct m0_cond *cond)
M0_INTERNAL m0_bcount_t default_xo_rpc_max_seg_size(struct m0_net_domain *ndom)
struct m0_net_domain * nb_dom
M0_INTERNAL bool m0_list_contains(const struct m0_list *list, const struct m0_list_link *link)
static void mem_wf_active_bulk(struct m0_net_transfer_mc *tm, struct m0_net_bulk_mem_work_item *wi)
static void mem_xo_tm_worker(struct m0_net_transfer_mc *tm)
static m0_bcount_t mem_xo_get_max_buffer_segment_size(const struct m0_net_domain *dom)
static const struct m0_net_xprt_ops mem_xo_xprt_ops
static struct m0_net_bulk_mem_buffer_pvt * mem_buffer_to_pvt(const struct m0_net_buffer *nb)
m0_net_bulk_mem_work_fn_t bmo_work_fn[M0_NET_XOP_NR]
M0_INTERNAL m0_bcount_t m0_vec_count(const struct m0_vec *vec)
M0_INTERNAL void m0_mem_xprt_fini(void)
static bool mem_buffer_in_bounds(const struct m0_net_buffer *nb)
int(* xo_end_point_create)(struct m0_net_end_point **epp, struct m0_net_transfer_mc *tm, const char *addr)
static int mem_xo_tm_init(struct m0_net_transfer_mc *tm)
uint64_t xd_buf_id_counter
#define M0_ALLOC_PTR(ptr)
static void mem_wf_passive_bulk_cb(struct m0_net_transfer_mc *tm, struct m0_net_bulk_mem_work_item *wi)
static m0_bcount_t mem_buffer_length(const struct m0_net_buffer *nb)
const struct m0_net_bulk_mem_ops * xd_ops
static bool mem_buffer_invariant(const struct m0_net_buffer *nb)
M0_INTERNAL void m0_net_xprt_deregister(const struct m0_net_xprt *xprt)
int(* xo_dom_init)(const struct m0_net_xprt *xprt, struct m0_net_domain *dom)
M0_INTERNAL void m0_cond_broadcast(struct m0_cond *cond)
struct m0_net_domain * xd_dom
struct m0_net_buf_desc nb_desc
static bool mem_tm_invariant(const struct m0_net_transfer_mc *tm)
static struct bulkio_params * bp
struct m0_net_end_point xep_ep
static int mem_ep_create(struct m0_net_end_point **epp, struct m0_net_transfer_mc *tm, const struct sockaddr_in *sa, uint32_t id)
M0_INTERNAL size_t m0_net_bulk_mem_tm_get_num_threads(const struct m0_net_transfer_mc *tm)
M0_INTERNAL void m0_list_link_init(struct m0_list_link *link)
struct m0_net_xprt * xprt
static struct m0_net_bulk_mem_domain_pvt * mem_dom_to_pvt(const struct m0_net_domain *dom)
M0_INTERNAL void m0_list_add_tail(struct m0_list *head, struct m0_list_link *new)
static void mem_ep_get(struct m0_net_end_point *ep)
char xep_addr[M0_NET_BULK_MEM_XEP_ADDR_LEN]
static void mem_xo_tm_fini(struct m0_net_transfer_mc *tm)
static int mem_desc_create(struct m0_net_buf_desc *desc, struct m0_net_transfer_mc *tm, enum m0_net_queue_type qt, m0_bcount_t buflen, int64_t buf_id)
static int mem_xo_dom_init(const struct m0_net_xprt *xprt, struct m0_net_domain *dom)
static struct m0_net_bulk_mem_tm_pvt * mem_tm_to_pvt(const struct m0_net_transfer_mc *tm)
M0_INTERNAL uint32_t default_xo_rpc_max_recv_msgs(struct m0_net_domain *ndom, m0_bcount_t rpc_size)
static void mem_ep_free(struct m0_net_bulk_mem_end_point *mep)
struct m0_net_transfer_mc * xtm_tm
M0_INTERNAL m0_bcount_t default_xo_rpc_max_msg_size(struct m0_net_domain *ndom, m0_bcount_t rpc_size)
static int32_t mem_xo_get_max_buffer_segments(const struct m0_net_domain *dom)
static int mem_xo_tm_stop(struct m0_net_transfer_mc *tm, bool cancel)
static void mem_wf_error_cb(struct m0_net_transfer_mc *tm, struct m0_net_bulk_mem_work_item *wi)
const struct m0_net_xprt m0_net_bulk_mem_xprt
struct m0_net_end_point * nb_ep
enum m0_thread_state t_state
static int mem_bmo_ep_create(struct m0_net_end_point **epp, struct m0_net_transfer_mc *tm, const struct sockaddr_in *sa, uint32_t id)
#define M0_IMPOSSIBLE(fmt,...)