Motr  M0
tm_provision_ut.c File Reference
#include "net/buffer_pool.h"
Include dependency graph for tm_provision_ut.c:

Go to the source code of this file.

Enumerations

enum  { POOL_COLOURS = 5, POOL_THRESHOLD = 2, POOL_BUF_NR = M0_NET_TM_RECV_QUEUE_DEF_LEN * 4, MIN_RECV_SIZE = 1 << 12 }
 

Functions

void ut_tm_prov_event_cb (const struct m0_net_tm_event *ev)
 
static void ut_prov_msg_recv_cb (const struct m0_net_buffer_event *ev)
 
static void ut_pool_low (struct m0_net_buffer_pool *bp)
 
static void ut_pool_not_empty (struct m0_net_buffer_pool *bp)
 
static int ut_tm_prov_stop (struct m0_net_transfer_mc *tm, bool cancel)
 
static struct m0_net_bufferpool_colour_buffer_add (struct m0_net_transfer_mc *tm)
 
static void provision_buffer_validate_colour (struct m0_net_buffer *nb, struct m0_net_transfer_mc *tm)
 
static void ut_tm_stop_fini (struct m0_net_transfer_mc *tm)
 
static void test_net_tm_prov (void)
 

Variables

static int max_recv_msgs = 1
 
static struct m0_net_buffer_poolpool_prov
 
static int ut_tm_prov_event_cb_calls
 
static struct m0_net_tm_callbacks ut_tm_prov_cb
 
static const struct m0_net_buffer_callbacks ut_buf_prov_cb
 
static bool pool_not_empty_called = false
 
static const struct m0_net_buffer_pool_ops b_ops
 
static bool ut_tm_prov_stop_called = false
 
static struct m0_net_transfer_mc ut_prov_tm1
 
static struct m0_net_transfer_mc ut_prov_tm2
 
static struct m0_net_domain ut_prov_dom
 
struct m0_ut_suite m0_net_tm_prov_ut
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
POOL_COLOURS 
POOL_THRESHOLD 
POOL_BUF_NR 
MIN_RECV_SIZE 

Definition at line 33 of file tm_provision_ut.c.

Function Documentation

◆ pool_colour_buffer_add()

static struct m0_net_buffer* pool_colour_buffer_add ( struct m0_net_transfer_mc tm)
static

Definition at line 149 of file tm_provision_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ provision_buffer_validate_colour()

static void provision_buffer_validate_colour ( struct m0_net_buffer nb,
struct m0_net_transfer_mc tm 
)
static

Definition at line 180 of file tm_provision_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_net_tm_prov()

static void test_net_tm_prov ( void  )
static

Definition at line 219 of file tm_provision_ut.c.

Here is the call graph for this function:

◆ ut_pool_low()

static void ut_pool_low ( struct m0_net_buffer_pool bp)
static

Definition at line 91 of file tm_provision_ut.c.

◆ ut_pool_not_empty()

static void ut_pool_not_empty ( struct m0_net_buffer_pool bp)
static

Definition at line 97 of file tm_provision_ut.c.

Here is the call graph for this function:

◆ ut_prov_msg_recv_cb()

static void ut_prov_msg_recv_cb ( const struct m0_net_buffer_event ev)
static

Definition at line 60 of file tm_provision_ut.c.

Here is the call graph for this function:

◆ ut_tm_prov_event_cb()

void ut_tm_prov_event_cb ( const struct m0_net_tm_event ev)

Definition at line 41 of file tm_provision_ut.c.

◆ ut_tm_prov_stop()

static int ut_tm_prov_stop ( struct m0_net_transfer_mc tm,
bool  cancel 
)
static

Definition at line 109 of file tm_provision_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ut_tm_stop_fini()

static void ut_tm_stop_fini ( struct m0_net_transfer_mc tm)
static

Definition at line 191 of file tm_provision_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ b_ops

const struct m0_net_buffer_pool_ops b_ops
static
Initial value:
= {
.nbpo_not_empty = ut_pool_not_empty,
.nbpo_below_threshold = ut_pool_low,
}
static void ut_pool_low(struct m0_net_buffer_pool *bp)
static void ut_pool_not_empty(struct m0_net_buffer_pool *bp)

Definition at line 103 of file tm_provision_ut.c.

◆ m0_net_tm_prov_ut

struct m0_ut_suite m0_net_tm_prov_ut
Initial value:
= {
.ts_name = "net-prov-ut",
.ts_init = NULL,
.ts_fini = NULL,
.ts_tests = {
{ "net_prov", test_net_tm_prov},
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static void test_net_tm_prov(void)

Definition at line 538 of file tm_provision_ut.c.

◆ max_recv_msgs

int max_recv_msgs = 1
static

Definition at line 31 of file tm_provision_ut.c.

◆ pool_not_empty_called

bool pool_not_empty_called = false
static

Definition at line 96 of file tm_provision_ut.c.

◆ pool_prov

struct m0_net_buffer_pool* pool_prov
static

Definition at line 32 of file tm_provision_ut.c.

◆ ut_buf_prov_cb

const struct m0_net_buffer_callbacks ut_buf_prov_cb
static
Initial value:
= {
.nbc_cb = {
},
}
static void ut_passive_bulk_recv_cb(const struct m0_net_buffer_event *ev)
Definition: bulk_if.c:554
static void ut_active_bulk_recv_cb(const struct m0_net_buffer_event *ev)
Definition: bulk_if.c:564
static void ut_active_bulk_send_cb(const struct m0_net_buffer_event *ev)
Definition: bulk_if.c:569
static void ut_msg_send_cb(const struct m0_net_buffer_event *ev)
Definition: bulk_if.c:549
static void ut_prov_msg_recv_cb(const struct m0_net_buffer_event *ev)
static void ut_passive_bulk_send_cb(const struct m0_net_buffer_event *ev)
Definition: bulk_if.c:559

Definition at line 80 of file tm_provision_ut.c.

◆ ut_prov_dom

struct m0_net_domain ut_prov_dom
static

Definition at line 217 of file tm_provision_ut.c.

◆ ut_prov_tm1

struct m0_net_transfer_mc ut_prov_tm1
static
Initial value:
= {
.ntm_callbacks = &ut_tm_prov_cb,
.ntm_state = M0_NET_TM_UNDEFINED
}
static struct m0_net_tm_callbacks ut_tm_prov_cb

Definition at line 207 of file tm_provision_ut.c.

◆ ut_prov_tm2

struct m0_net_transfer_mc ut_prov_tm2
static
Initial value:
= {
.ntm_callbacks = &ut_tm_prov_cb,
.ntm_state = M0_NET_TM_UNDEFINED
}
static struct m0_net_tm_callbacks ut_tm_prov_cb

Definition at line 212 of file tm_provision_ut.c.

◆ ut_tm_prov_cb

struct m0_net_tm_callbacks ut_tm_prov_cb
static
Initial value:
= {
.ntc_event_cb = ut_tm_prov_event_cb
}
void ut_tm_prov_event_cb(const struct m0_net_tm_event *ev)

Definition at line 56 of file tm_provision_ut.c.

◆ ut_tm_prov_event_cb_calls

int ut_tm_prov_event_cb_calls
static

Definition at line 40 of file tm_provision_ut.c.

◆ ut_tm_prov_stop_called

bool ut_tm_prov_stop_called = false
static

Definition at line 108 of file tm_provision_ut.c.