25 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_UT 85 for ( ;
i < len && bytes < step; ++bytes, ++
i, ++
p, ++
val) {
126 for ( ;
i < len && bytes < step; ++
i, ++
p, ++bytes, ++
val) {
168 #ifdef LNET_PID_LUSTRE 258 #define zvUT(x, expRC) \ 263 M0_ASSERT_INFO(rc == erc, "%d != %d (%s : %s)", \ 264 rc, erc, #x, #expRC); \ 266 #define zUT(x) zvUT(x, 0) 270 #define PAGE_SHIFT 12 271 #elif defined (CONFIG_AARCH64) 272 #define PAGE_SHIFT 16 275 #error "The platform is not supported" 277 #define PAGE_SIZE (1UL << PAGE_SHIFT) 318 #define DOM1 (&td->dom1) 319 #define DOM2 (&td->dom2) 320 #define TM1 (&td->tm1) 321 #define TM2 (&td->tm2) 322 #define CBD1 (&td->cbd1) 323 #define CBD2 (&td->cbd2) 346 for (
i = 0;
i < len; ++
i) {
347 nb = m0_net_tm_tlist_head(&tm->
ntm_q[
qt]);
350 "Cleanup/DEL D:%p T:%p Q:%d B:%p\n",
359 for (j = 0; j < 10; ++j) {
370 "Cleanup D:%p T:%p Q:%d B failed\n",
384 "Cleanup/PUT D:%p T:%p E:%p\n",
391 NLXDBGP(td,0,
"Cleanup D:%p T:%p E failed\n",
dom, tm);
405 NLXP(
"\txo:%p lcbuf:%p kcb:%p\n",
406 (
void *)
bp, (
void *) lcbuf, (
void *) kcb);
417 NLXP(
"\txo:%p lctm:%p kctm:%p\n",
418 (
void *) tp, (
void *) lctm, (
void *) kctm);
420 nlx_kprint_lnet_handle(
"\tEQ1", kctm->
ktm_eqh);
446 TM1->ntm_callbacks = &td->
tmcb;
447 TM2->ntm_callbacks = &td->
tmcb;
453 #define SETUP_DOM(which) \ 455 struct m0_net_domain *dom = &td->dom ## which; \ 456 struct m0_net_transfer_mc *tm = &td->tm ## which; \ 457 char ***nidstrs = &td->nidstrs ## which; \ 458 M0_UT_ASSERT(!m0_net_domain_init(dom, &m0_net_lnet_xprt)); \ 459 M0_UT_ASSERT(!m0_net_lnet_ifaces_get(dom, nidstrs)); \ 460 M0_UT_ASSERT(*nidstrs != NULL && **nidstrs != NULL); \ 462 char epstr[M0_NET_LNET_XEP_ADDR_LEN]; \ 463 m0_bcount_t max_seg_size; \ 464 struct m0_net_buffer *nb; \ 466 max_seg_size = m0_net_domain_get_max_buffer_segment_size(dom); \ 467 M0_UT_ASSERT(max_seg_size > 0); \ 468 M0_UT_ASSERT(max_seg_size >= UT_MSG_SIZE); \ 469 td->buf_size ## which = max_seg_size * UT_BUFSEGS ## which; \ 470 td->buf_seg_size ## which = max_seg_size; \ 471 for (i = 0; i < UT_BUFS ## which; ++i) { \ 472 nb = &td->bufs ## which [i]; \ 473 rc = m0_bufvec_alloc_aligned(&nb->nb_buffer, \ 474 UT_BUFSEGS ## which, \ 477 M0_UT_ASSERT(rc == 0); \ 479 M0_IMPOSSIBLE("aborting: buf alloc failed"); \ 480 goto dereg ## which; \ 482 rc = m0_net_buffer_register(nb, dom); \ 484 M0_IMPOSSIBLE("aborting: buf reg failed"); \ 485 goto dereg ## which; \ 487 M0_UT_ASSERT(nb->nb_flags & M0_NET_BUF_REGISTERED); \ 488 nb->nb_callbacks = &td->buf_cb ## which; \ 489 NLXDBGPnl(td, 2, "[%d] D:%p T:%p B:%p [%u,%d]=%lu\n", \ 490 which, dom, tm, nb, (unsigned) max_seg_size, \ 491 UT_BUFSEGS ## which, \ 492 (unsigned long) td->buf_size ## which); \ 493 NLXDBGnl(td, 2, ut_describe_buf(nb)); \ 496 M0_UT_ASSERT(!m0_net_tm_init(tm, dom)); \ 498 (*ps_cb)(td, which); \ 500 sprintf(epstr, "%s:%d:%d:*", \ 501 **nidstrs, STARTSTOP_PID, STARTSTOP_PORTAL); \ 502 m0_clink_add_lock(&tm->ntm_chan, &td->tmwait ## which); \ 503 M0_UT_ASSERT(!m0_net_tm_start(tm, epstr)); \ 504 m0_chan_wait(&td->tmwait ## which); \ 505 m0_clink_del_lock(&td->tmwait ## which); \ 506 M0_UT_ASSERT(tm->ntm_state == M0_NET_TM_STARTED); \ 507 if (tm->ntm_state == M0_NET_TM_FAILED) { \ 508 M0_IMPOSSIBLE("aborting: tm" #which " startup failed"); \ 509 goto fini ## which; \ 511 NLXDBGPnl(td, 2, "[%d] D:%p T:%p E:%s\n", which, dom, tm, \ 512 tm->ntm_ep->nep_addr); \ 513 NLXDBGnl(td, 2, ut_describe_tm(tm)); \ 517 #define TEARDOWN_DOM(which) \ 519 struct m0_net_domain *dom; \ 520 struct m0_net_transfer_mc *tm = &td->tm ## which; \ 521 m0_clink_add_lock(&tm->ntm_chan, &td->tmwait ## which); \ 522 M0_UT_ASSERT(!m0_net_tm_stop(tm, false)); \ 523 m0_chan_wait(&td->tmwait ## which); \ 524 m0_clink_del_lock(&td->tmwait ## which); \ 525 M0_UT_ASSERT(tm->ntm_state == M0_NET_TM_STOPPED); \ 527 tm = &td->tm ## which; \ 528 m0_net_tm_fini(tm); \ 530 dom = &td->dom ## which; \ 531 for (i = 0; i < UT_BUFS ## which; ++i) { \ 532 struct m0_net_buffer *nb; \ 533 nb = &td->bufs ## which [i]; \ 534 if (nb->nb_buffer.ov_vec.v_nr == 0) \ 536 m0_net_buffer_deregister(nb, dom); \ 537 m0_bufvec_free_aligned(&nb->nb_buffer, UT_PAGE_SHIFT); \ 539 if (td->nidstrs ## which != NULL) \ 540 m0_net_lnet_ifaces_put(dom, &td->nidstrs ## which); \ 541 M0_UT_ASSERT(td->nidstrs ## which == NULL); \ 542 m0_net_domain_fini(dom); \ 587 else if (!S_ISCHR(st.st_mode))
630 dp =
dom.nd_xprt_private;
657 static char *n1t0 =
"10.72.49.14@o2ib0:12345:31:0";
658 static char *n1t1 =
"10.72.49.14@o2ib0:12345:31:1";
659 static char *n1ts =
"10.72.49.14@o2ib0:12345:31:*";
660 static char *n2t0 =
"192.168.96.128@tcp1:12345:31:0";
661 static char *n2t1 =
"192.168.96.128@tcp1:12345:31:1";
662 static char *n2ts =
"192.168.96.128@tcp1:12345:31:*";
741 const char *nid_to_use;
764 nid_to_use = nidstrs[0];
765 for (
i = 0; nidstrs[
i] !=
NULL; ++
i) {
766 if (strstr(nidstrs[
i],
"@lo") !=
NULL)
768 nid_to_use = nidstrs[
i];
771 sprintf(epstr,
"%s:%d:%d:101",
773 sprintf(badportal_epstr,
"%s:%d:99:101", nid_to_use,
STARTSTOP_PID);
774 sprintf(dyn_epstr,
"%s:%d:%d:*",
855 M0_UT_ASSERT(strcmp(tm[
i].ntm_ep->nep_addr, dyn_epstr) != 0);
862 strcpy(save_epstr, tm[1].ntm_ep->nep_addr);
877 M0_UT_ASSERT(strcmp(tm[1].ntm_ep->nep_addr, save_epstr) == 0);
904 uint32_t num_recv_bufs,
905 uint32_t recv_max_msgs,
909 bool space_exhausted)
944 for (rb_num = 0; rb_num < num_recv_bufs && rb_num <
UT_BUFS1; ++rb_num){
945 nb1 = &td->
bufs1[rb_num];
951 if (rb_num != num_recv_bufs) {
955 #define RESET_RECV_COUNTERS() \ 958 bevs_left = recv_max_msgs; \ 960 space_left = td->buf_size1; \ 966 total_bytes_sent = 0;
967 msg_size = send_len_first;
971 while (msg_size <= space_left && bevs_left > 0) {
973 nb1 = &td->
bufs1[rb_num-1];
981 NLXDBGPnl(td, 2,
"\t%s S%d %lu bytes -> %s\n",
982 TM2->ntm_ep->nep_addr, msg_num,
983 (
unsigned long) msg_size, ep2->
nep_addr);
999 total_bytes_sent += msg_size;
1004 "\t%s R%d %lu bytes <- %s off %lu left %lu/%d\n",
1009 (
unsigned long) space_left, bevs_left);
1028 msg_size = send_len_rest;
1035 if (rb_num <= num_recv_bufs)
1041 if (space_exhausted) {
1050 for (rb_num = 0; rb_num < num_recv_bufs; ++rb_num) {
1051 nb1 = &td->
bufs1[rb_num];
1056 while (msg_num-- > 0)
1065 #undef RESET_RECV_COUNTERS 1076 nb1 = &td->
bufs1[0];
1077 nb2 = &td->
bufs2[0];
1086 NLXDBGPnl(td, 1,
"TEST: add/del on the receive queue\n");
1128 NLXDBGPnl(td, 1,
"TEST: send until max receive messages reached " 1129 "(1 receive buffer)\n");
1133 NLXDBGPnl(td, 1,
"TEST: send until max receive messages reached " 1134 "(2 receive buffers, > 1 seg)\n");
1140 NLXDBGPnl(td, 1,
"TEST: send until receive space exhausted " 1141 "(1 receive buffer)\n");
1145 NLXDBGPnl(td, 1,
"TEST: send until receive space exhausted " 1146 "(2 receive buffers, > 1 seg)\n");
1155 NLXDBGPnl(td, 1,
"TEST: send/no receive buffer - no error expected\n");
1170 NLXDBGPnl(td, 2,
"\t%s S%d %lu bytes -> %s\n",
1171 TM2->ntm_ep->nep_addr, 1,
1195 NLXDBGPnl(td, 1,
"TEST: send / non-existent TM - no error expected\n");
1202 sprintf(epstr,
"%s:%d:%d:*",
1205 sprintf(epstr,
"%s:%d:%d:1024",
1216 NLXDBGPnl(td, 2,
"\t%s S%d %lu bytes -> %s\n",
1217 TM2->ntm_ep->nep_addr, 1,
1267 NLXDBGPnl(td, 1,
"TEST: match bit encoding\n");
1268 #define TEST_MATCH_BIT_ENCODE(_t, _c) \ 1269 nlx_core_match_bits_decode(nlx_core_match_bits_encode((_t),(_c)), \ 1271 M0_UT_ASSERT(tmid == (_t)); \ 1272 M0_UT_ASSERT(counter == (_c)) 1279 #undef TEST_MATCH_BIT_ENCODE 1286 NLXDBGPnl(td, 1,
"TEST: buffer descriptor S(export, import)\n");
1301 NLXDBGPnl(td, 1,
"TEST: buffer descriptor F(import invalid size)\n");
1310 #define VALIDATE_MATCH_BITS(mb, s_lctm) \ 1311 nlx_core_match_bits_decode(mb, &tmid, &counter); \ 1312 M0_UT_ASSERT(tmid == s_lctm->ctm_addr.cepa_tmid); \ 1313 M0_UT_ASSERT(counter == s_lctm->ctm_mb_counter - 1) 1322 NLXDBGPnl(td, 1,
"TEST: encode buffer descriptor S(PS1)\n");
1336 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor S(AR2 == PS1)\n");
1353 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor F(corrupt)\n");
1356 CBD1->cbd_data[2]++;
1363 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor S(AR2 > PS1)\n");
1380 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor F(AR2 < PS1)\n");
1388 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor F(AS2 == PS1)\n");
1404 NLXDBGPnl(td, 1,
"TEST: encode buffer descriptor S(PR2)\n");
1418 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor S(AS1 == PR2)\n");
1435 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor S(AS1 < PR2)\n");
1452 #undef VALIDATE_MATCH_BITS 1457 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor F(AS1 > PR2)\n");
1465 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor F(AR1 == PR2)\n");
1478 NLXDBGPnl(td, 1,
"TEST: decode buffer descriptor F(corrupt)\n");
1479 CBD2->cbd_match_bits++;
1490 NLXDBGPnl(td, 1,
"TEST: match bit counter wraps\n");
1524 unsigned char seed =
's';
1548 NLXDBGPnl(td, 1,
"TEST: bulk transfer F(PS !~ AS)\n");
1554 NLXDBGPnl(td, 1,
"TEST: bulk transfer F(PS > AR)\n");
1566 NLXDBGPnl(td, 1,
"TEST: bulk transfer S(PS ~ AR)\n");
1605 NLXDBGP(td, 3,
"\tcancelling nb2s\n");
1609 NLXP(
"Unable to cancel nb2s\n");
1612 NLXDBGP(td, 3,
"\tderegistering nb2s\n");
1630 unsigned char seed =
'r';
1655 NLXDBGPnl(td, 1,
"TEST: bulk transfer F(PR !~ AR)\n");
1660 NLXDBGPnl(td, 1,
"TEST: bulk transfer F(PR < AS)\n");
1671 NLXDBGPnl(td, 1,
"TEST: bulk transfer S(PR ~ AS)\n");
1708 NLXDBGP(td, 3,
"\tcancelling nb2l\n");
1712 NLXP(
"Unable to cancel nb2l\n");
1715 NLXDBGP(td, 3,
"\tderegistering nb2l\n");
1740 NLXDBGPnl(td, 1,
"TEST: add/del on the passive queues\n");
1801 nlx_debug._debug_ = 0;
1805 nlx_debug._debug_ = 0;
1852 NLXDBGPnl(td, 1,
"TEST: no-op sync calls\n");
1872 NLXDBGPnl(td, 1,
"TEST: sync delivery of buffer events\n");
1899 for (
i = 1;
i <= num_msgs; ++
i) {
1900 len = initial_len *
i;
1938 for (
i = 1, len = 0,
offset = 0;
i <= num_msgs; ++
i) {
1940 len = initial_len *
i;
2014 uint64_t timeout_secs = 1;
2027 NLXDBGPnl(td, 1,
"TEST: buffer single timeout: %d\n", (
int)
qt);
2059 abs_timeout - buf_add_time);
2072 NLXDBGPnl(td, 1,
"TEST: buffer multiple timeout\n");
2104 (abs_timeout - buf_add_time) *
UT_BUFS1);
2118 NLXDBGPnl(td, 1,
"TEST: buffer mixed timeout\n");
2152 abs_timeout - buf_add_time);
2177 nb1 = &td->
bufs1[0];
2259 #undef M0_TRACE_SUBSYSTEM
M0_INTERNAL void m0_net_lnet_dom_set_debug(struct m0_net_domain *dom, unsigned dbg)
static void m0_atomic64_inc(struct m0_atomic64 *a)
struct m0_ut_suite m0_net_lnet_ut
uint64_t nqs_num_f_events
static struct m0_addb2_philter p
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
struct m0_net_transfer_mc * nb_tm
static m0_bindex_t cb_offset2
static void ut_test_framework(ut_test_fw_body_t body, ut_test_fw_prestart_cb_t ps_cb, int dbg)
#define M0_ALLOC_ARR(arr, nr)
static bool nlx_dom_invariant(const struct m0_net_domain *dom)
M0_INTERNAL int m0_bitmap_init(struct m0_bitmap *map, size_t nr)
static int ktest_lnet_init(void)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
static void ktest_core_ep_addr(void)
void m0_net_domain_fini(struct m0_net_domain *dom)
m0_time_t nqs_time_in_queue
M0_INTERNAL int m0_net_tm_start(struct m0_net_transfer_mc *tm, const char *addr)
uint64_t nqs_num_s_events
struct m0_net_buffer bufs1[UT_BUFS1]
M0_INTERNAL int struct dentry struct kstat * stat
static void ktest_buf_shape(void)
struct m0_net_transfer_mc tm2
static int32_t cb_status1
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
M0_INTERNAL void m0_bitmap_fini(struct m0_bitmap *map)
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
static void test_sync_msg_recv_cb1(const struct m0_net_buffer_event *ev)
struct m0_bufvec nb_buffer
static void test_tm_initfini(void)
M0_INTERNAL int m0_net_buffer_register(struct m0_net_buffer *buf, struct m0_net_domain *dom)
static void ktest_lnet_fini(void)
static int test_bulk_passive_send(struct ut_data *td)
static m0_bcount_t cb_length2
static bool test_msg_send_loop(struct ut_data *td, uint32_t num_recv_bufs, uint32_t recv_max_msgs, struct m0_net_end_point *ep2, m0_bcount_t send_len_first, m0_bcount_t send_len_rest, bool space_exhausted)
const struct m0_net_xprt m0_net_lnet_xprt
const m0_time_t M0_TIME_NEVER
struct nlx_core_ep_addr cb_addr
static int32_t ecb_status
static struct nlx_kcore_interceptable_subs nlx_kcore_iv
static void nlx_core_match_bits_decode(uint64_t mb, uint32_t *tmid, uint64_t *counter)
M0_INTERNAL int m0_net_tm_stats_get(struct m0_net_transfer_mc *tm, enum m0_net_queue_type qtype, struct m0_net_qstats *qs, bool reset)
static void test_msg(void)
static void test_buf_desc_body(struct ut_data *td)
enum m0_net_tm_state ntm_state
static enum m0_net_tm_ev_type ecb_evt
struct m0_net_tm_callbacks tmcb
static m0_bcount_t cb_length1
static int test_lnet_fini(void)
static unsigned cb_called2
M0_INTERNAL void * m0_bufvec_cursor_addr(struct m0_bufvec_cursor *cur)
M0_INTERNAL bool m0_net_buffer_del(struct m0_net_buffer *buf, struct m0_net_transfer_mc *tm)
static const char * nlx_ucore_dev_name
static struct m0_atomic64 test_timeout_ttb_retval
m0_bcount_t nb_min_receive_size
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
struct m0_net_buffer * nbe_buffer
static int nlx_xo__nbd_recover(struct m0_net_transfer_mc *tm, const struct m0_net_buf_desc *nbd, struct nlx_core_buf_desc *cbd)
m0_time_t m0_time(uint64_t secs, long ns)
int(* _nlx_tm_timeout_buffers)(struct m0_net_transfer_mc *tm, m0_time_t now)
struct m0_net_end_point * nbe_ep
M0_INTERNAL int m0_net_lnet_ep_addr_net_cmp(const char *addr1, const char *addr2)
static struct nlx_xo_interceptable_subs saved_xo_subs
bool ntm_bev_auto_deliver
struct m0_net_buffer_callbacks buf_cb2
void(* ut_test_fw_body_t)(struct ut_data *td)
struct m0_tl ntm_end_points
static int test_lnet_init(void)
int m0_bufvec_alloc_aligned(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size, unsigned shift)
static void test_bulk_body(struct ut_data *td)
static void ut_restore_subs(void)
static m0_bindex_t cb_offset1
uint64_t nlx_core_opaque_ptr_t
static void ut_net_buffer_sign(struct m0_net_buffer *nb, m0_bcount_t len, unsigned char seed)
static void ktest_buf_reg(void)
M0_INTERNAL bool m0_bufvec_cursor_move(struct m0_bufvec_cursor *cur, m0_bcount_t count)
struct nlx_core_buf_desc cbd1
struct m0_net_domain dom2
struct nlx_core_ep_addr ctm_addr
enum m0_net_tm_state nte_next_state
static void ut_save_subs(void)
void(* ut_test_fw_prestart_cb_t)(struct ut_data *td, int which)
M0_INTERNAL int m0_net_tm_init(struct m0_net_transfer_mc *tm, struct m0_net_domain *dom)
M0_INTERNAL void m0_net_lnet_tm_set_debug(struct m0_net_transfer_mc *tm, unsigned dbg)
static void test_sync_msg_send_cb2(const struct m0_net_buffer_event *ev)
static int nlx_xo_core_bev_to_net_bev(struct m0_net_transfer_mc *tm, struct nlx_core_buffer_event *lcbev, struct m0_net_buffer_event *nbev)
enum m0_net_queue_type nb_qtype
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_step(const struct m0_bufvec_cursor *cur)
uint32_t nb_max_receive_msgs
#define m0_list_for_each_entry(head, pos, type, member)
m0_bcount_t buf_seg_size2
M0_INTERNAL void m0_net_tm_fini(struct m0_net_transfer_mc *tm)
const struct m0_net_xprt * nd_xprt
static void ut_cbreset2(void)
M0_INTERNAL int m0_net_lnet_ifaces_get(struct m0_net_domain *dom, char ***addrs)
void(* ntc_event_cb)(const struct m0_net_tm_event *ev)
m0_time_t m0_time_now(void)
struct m0_atomic64 ref_cnt
static void test_fail(void)
nlx_core_opaque_ptr_t cbe_buffer_id
struct m0_chan * xtm_ev_chan
struct nlx_core_domain xd_core
#define TEST_MATCH_BIT_ENCODE(_t, _c)
static struct m0_stob_domain * dom
M0_INTERNAL void m0_bufvec_cursor_init(struct m0_bufvec_cursor *cur, const struct m0_bufvec *bvec)
static void test_timeout_msg_recv_cb1(const struct m0_net_buffer_event *ev)
struct m0_list_link ntm_dom_linkage
static void ut_buf_cb2(const struct m0_net_buffer_event *ev)
M0_INTERNAL size_t m0_tlist_length(const struct m0_tl_descr *d, const struct m0_tl *list)
M0_INTERNAL bool m0_list_contains(const struct m0_list *list, const struct m0_list_link *link)
struct nlx_core_buffer xb_core
static bool ut_net_buffer_authenticate(struct m0_net_buffer *nb, m0_bcount_t len, m0_bcount_t offset, unsigned char seed)
M0_INTERNAL void m0_net_lnet_ifaces_put(struct m0_net_domain *dom, char ***addrs)
static struct m0_net_buffer * cb_nb2
static void ntc_event_callback(const struct m0_net_tm_event *ev)
M0_INTERNAL void m0_net_desc_free(struct m0_net_buf_desc *desc)
M0_INTERNAL void m0_bitmap_set(struct m0_bitmap *map, size_t idx, bool val)
M0_INTERNAL void m0_net_end_point_get(struct m0_net_end_point *ep)
static void test_timeout_body(struct ut_data *td)
m0_net_buffer_cb_proc_t nbc_cb[M0_NET_QT_NR]
static m0_bindex_t offset
M0_INTERNAL int m0_net_desc_copy(const struct m0_net_buf_desc *from_desc, struct m0_net_buf_desc *to_desc)
static struct nlx_xo_interceptable_subs nlx_xo_iv
static void ktest_bulk(void)
static int nlx_tm_timeout_buffers(struct m0_net_transfer_mc *tm, m0_time_t now)
struct m0_tl ntm_q[M0_NET_QT_NR]
M0_INTERNAL int m0_net_tm_stop(struct m0_net_transfer_mc *tm, bool abort)
M0_INTERNAL void m0_bufvec_free_aligned(struct m0_bufvec *bufvec, unsigned shift)
static void ut_cbreset(void)
M0_INTERNAL void m0_net_buffer_event_deliver_all(struct m0_net_transfer_mc *tm)
static struct m0_net_end_point * cb_ep1
static bool nlx_core_ep_eq(const struct nlx_core_ep_addr *cep1, const struct nlx_core_ep_addr *cep2)
static int64_t m0_atomic64_get(const struct m0_atomic64 *a)
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
int nlx_core_ep_addr_decode(struct nlx_core_domain *lcdom, const char *ep_addr, struct nlx_core_ep_addr *cepa)
void m0_net_end_point_put(struct m0_net_end_point *ep)
M0_INTERNAL void m0_net_buffer_event_notify(struct m0_net_transfer_mc *tm, struct m0_chan *chan)
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 void ut_test_framework_dom_cleanup(struct ut_data *td, struct m0_net_domain *dom)
struct m0_net_domain dom1
#define RESET_RECV_COUNTERS()
M0_INTERNAL void m0_net_buffer_deregister(struct m0_net_buffer *buf, struct m0_net_domain *dom)
static void ecb_reset(void)
#define TEARDOWN_DOM(which)
int m0_net_domain_init(struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
M0_INTERNAL bool m0_net_buffer_event_pending(struct m0_net_transfer_mc *tm)
static int test_bulk_passive_recv(struct ut_data *td)
M0_INTERNAL int m0_net_buffer_event_deliver_synchronously(struct m0_net_transfer_mc *tm)
struct m0_net_end_point * ntm_ep
static struct m0_net_end_point * cb_ep2
static void test_sync_body(struct ut_data *td)
static void ktest_dev(void)
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL bool m0_chan_timedwait(struct m0_clink *link, const m0_time_t abs_timeout)
M0_INTERNAL int m0_net_buffer_add(struct m0_net_buffer *buf, struct m0_net_transfer_mc *tm)
#define NLXDBGP(ptr, dbg, fmt,...)
m0_time_t m0_time_from_now(uint64_t secs, long ns)
struct m0_net_transfer_mc tm1
M0_INTERNAL struct m0_thread * m0_thread_self(void)
static void test_sync_prestart(struct ut_data *td, int which)
#define VALIDATE_MATCH_BITS(mb, s_lctm)
M0_INTERNAL int m0_net_tm_confine(struct m0_net_transfer_mc *tm, const struct m0_bitmap *processors)
struct nlx_core_buf_desc cbd2
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
static void ut_buf_cb1(const struct m0_net_buffer_event *ev)
static void test_tm_startstop(void)
static void ut_cbreset1(void)
enum m0_net_queue_type cb_qtype
static void test_sync(void)
static m0_time_t test_timeout_tm_get_buffer_timeout_tick(const struct m0_net_transfer_mc *tm)
struct m0_net_buf_desc nb_desc
static int nlx_xo__nbd_allocate(struct m0_net_transfer_mc *tm, const struct nlx_core_buf_desc *cbd, struct m0_net_buf_desc *nbd)
enum m0_net_tm_ev_type nte_type
static struct bulkio_params * bp
static enum m0_net_tm_state ecb_tms
static int32_t cb_status2
static bool ut_chan_timedwait(struct m0_clink *link, uint32_t secs)
static bool nlx_core_kmem_loc_invariant(const struct nlx_core_kmem_loc *loc)
static bool nlx_core_kmem_loc_is_empty(const struct nlx_core_kmem_loc *loc)
static void test_bulk(void)
static struct m0_atomic64 test_timeout_ttb_called
#define m0_tl_for(name, head, obj)
static unsigned nlx_ucore_nidstrs_thunk
static void test_msg_body(struct ut_data *td)
static void test_buf_desc(void)
struct m0_net_buffer bufs2[UT_BUFS2]
static struct m0_thread * test_sync_ut_handle
static int test_timeout_tm_timeout_buffers(struct m0_net_transfer_mc *tm, m0_time_t now)
static unsigned cb_called1
static void ktest_enc_dec(void)
static enum m0_net_queue_type cb_qt2
M0_INTERNAL int m0_net_end_point_create(struct m0_net_end_point **epp, struct m0_net_transfer_mc *tm, const char *addr)
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)
struct m0_net_buffer_callbacks buf_cb1
const struct m0_net_tm_callbacks * ntm_callbacks
static enum m0_net_queue_type cb_qt1
static struct m0_net_buffer * cb_nb1
static uint64_t max64u(uint64_t a, uint64_t b)
static void ktest_msg(void)
static void m0_atomic64_set(struct m0_atomic64 *a, int64_t num)
m0_bcount_t buf_seg_size1
struct m0_net_end_point * nb_ep
m0_time_t(* _nlx_tm_get_buffer_timeout_tick)(const struct m0_net_transfer_mc *tm)
struct nlx_core_transfer_mc xtm_core
#define M0_IMPOSSIBLE(fmt,...)
#define NLXDBGPnl(ptr, dbg, fmt,...)
static void test_timeout(void)
static void ut_tm_ecb(const struct m0_net_tm_event *ev)