86 rc = memcmp(b1_data, b2_data, length) == 0;
102 const uint32_t buf_index,
110 const uint32_t buf_index,
118 const uint32_t buf_index,
123 M0_IMPOSSIBLE(
"impossible bulk buffer callback in ping test");
213 const uint32_t buf_index,
375 const uint32_t buf_index,
537 memset(&hostname, 0,
sizeof(hostname));
538 memset(&ep_str, 0,
sizeof(ep_str));
539 rc = gethostname(hostname,
sizeof(hostname)-1);
541 sprintf(ep_str,
"inet:tcp:%s@3004", hostname);
564 memset(&ep_str, 0,
sizeof(ep_str));
565 sprintf(ep_str,
"inet:verbs:%s@3008", hostname);
#define M0_BUFVEC_INIT_BUF(addr_ptr, count_ptr)
void m0_net_test_network_buffer_dequeue(struct m0_net_test_network_ctx *ctx, enum m0_net_test_network_buf_type buf_type, int32_t buf_index)
struct m0_net_test_network_timeouts m0_net_test_network_timeouts_never(void)
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
uint32_t ntncfg_buf_ping_nr
static struct m0_semaphore q
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
int m0_net_test_network_msg_recv(struct m0_net_test_network_ctx *ctx, uint32_t buf_ping_index)
int m0_net_test_network_ctx_init(struct m0_net_test_network_ctx *ctx, struct m0_net_test_network_cfg *cfg, const char *tm_addr)
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
static const struct m0_net_tm_callbacks bulk_tm_cb
struct m0_bufvec nb_buffer
static void ping_tm_event_cb(const struct m0_net_tm_event *ev)
int m0_net_test_network_ep_add(struct m0_net_test_network_ctx *ctx, const char *ep_addr)
m0_bcount_t m0_net_test_network_bd_serialize(enum m0_net_test_serialize_op op, struct m0_net_test_network_ctx *ctx, uint32_t buf_bulk_index, uint32_t buf_ping_index, m0_bcount_t offset)
m0_net_test_network_buffer_cb_proc_t ntnbc_cb[M0_NET_QT_NR]
static struct m0_net_test_network_buffer_callbacks bulk_buf_cb
static struct m0_semaphore send_sem
static void ping_cb_msg_recv(struct m0_net_test_network_ctx *ctx, const uint32_t buf_index, enum m0_net_queue_type q, const struct m0_net_buffer_event *ev)
static struct m0_semaphore recv_sem
static void bulk_cb(struct m0_net_test_network_ctx *ctx, const uint32_t buf_index, enum m0_net_queue_type q, const struct m0_net_buffer_event *ev)
int m0_net_test_network_bulk_enqueue(struct m0_net_test_network_ctx *ctx, int32_t buf_bulk_index, int32_t ep_index, enum m0_net_queue_type q)
void m0_net_test_network_ut_buf_desc(void)
static struct m0_net_test_network_buffer_callbacks ping_buf_cb
static void ping_cb_impossible(struct m0_net_test_network_ctx *ctx, const uint32_t buf_index, enum m0_net_queue_type q, const struct m0_net_buffer_event *ev)
static void multiple_buf_desc_encode_decode(struct m0_net_test_network_ctx *ctx, int count)
m0_bcount_t ntncfg_buf_size_bulk
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_copy(struct m0_bufvec_cursor *dcur, struct m0_bufvec_cursor *scur, m0_bcount_t num_bytes)
struct m0_net_test_network_buffer_callbacks ntncfg_buf_cb
void(* ntc_event_cb)(const struct m0_net_tm_event *ev)
static struct m0_net_test_network_buffer_callbacks buf_cb_empty
M0_INTERNAL void m0_bufvec_cursor_init(struct m0_bufvec_cursor *cur, const struct m0_bufvec *bvec)
void m0_net_test_network_ctx_fini(struct m0_net_test_network_ctx *ctx)
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
void * m0_alloc(size_t size)
static void tm_event_cb_empty(const struct m0_net_tm_event *ev)
m0_net_test_network_buf_type
static m0_bindex_t offset
int m0_net_test_network_msg_send(struct m0_net_test_network_ctx *ctx, uint32_t buf_ping_index, uint32_t ep_index)
size_t m0_net_test_network_bd_nr(struct m0_net_test_network_ctx *ctx, uint32_t buf_ping_index)
void m0_net_test_network_ut_addr_decode(void)
static m0_bcount_t bv_copy(struct m0_bufvec *dst, struct m0_bufvec *src, m0_bcount_t len)
static const struct m0_net_tm_callbacks ping_tm_cb
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
struct m0_net_buffer * m0_net_test_network_buf(struct m0_net_test_network_ctx *ctx, enum m0_net_test_network_buf_type buf_type, uint32_t buf_index)
M0_INTERNAL void m0_semaphore_fini(struct m0_semaphore *semaphore)
m0_bcount_t ntncfg_buf_size_ping
struct m0_net_test_network_timeouts ntncfg_timeouts
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
void m0_net_test_network_ut_bulk(void)
static const struct m0_net_tm_callbacks tm_cb_empty
static void cb_empty(struct m0_net_test_network_ctx *ctx, const uint32_t buf_index, enum m0_net_queue_type q, const struct m0_net_buffer_event *ev)
static bool buf_desc_eq(struct m0_net_test_network_ctx *ctx1, uint32_t buf_index1, struct m0_net_test_network_ctx *ctx2, uint32_t buf_index2)
uint32_t ntncfg_buf_bulk_nr
static bool bulk_offset_mismatch
struct m0_net_buf_desc nb_desc
void m0_net_test_network_buf_fill(struct m0_net_test_network_ctx *ctx, enum m0_net_test_network_buf_type buf_type, uint32_t buf_index, uint8_t fill)
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
static struct m0_semaphore bulk_cb_sem[M0_NET_QT_NR]
void m0_net_test_network_ut_ping(void)
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
static bool net_buf_data_eq(enum m0_net_test_network_buf_type buf_type, struct m0_net_test_network_ctx *ctx1, uint32_t buf_index1, struct m0_net_test_network_ctx *ctx2, uint32_t buf_index2)
int m0_net_test_network_buf_resize(struct m0_net_test_network_ctx *ctx, enum m0_net_test_network_buf_type buf_type, uint32_t buf_index, m0_bcount_t new_size)
static void ping_cb_msg_send(struct m0_net_test_network_ctx *ctx, const uint32_t buf_index, enum m0_net_queue_type q, const struct m0_net_buffer_event *ev)
struct m0_pdclust_src_addr src
struct m0_net_tm_callbacks ntncfg_tm_cb
#define M0_IMPOSSIBLE(fmt,...)