Motr
M0
|
Data Structures | |
struct | m0_net_test_network_buffer_callbacks |
struct | m0_net_test_network_timeouts |
struct | m0_net_test_network_cfg |
struct | m0_net_test_network_ctx |
Typedefs | |
typedef void(* | m0_net_test_network_buffer_cb_proc_t) (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) |
Enumerations | |
enum | m0_net_test_network_buf_type { M0_NET_TEST_BUF_BULK, M0_NET_TEST_BUF_PING } |
m0_net_test_network_ prefix is too long. rename and align.
s/uint32_t/size_t/
typedef void(* m0_net_test_network_buffer_cb_proc_t) (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) |
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_bd_nr_dec | ( | struct m0_net_test_network_ctx * | ctx, |
uint32_t | buf_ping_index | ||
) |
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 | ||
) |
Serialize or deserialize bulk buffer network transport descriptor to/from ping buffer.
op | Serialization operation. |
ctx | Net-test network context. |
buf_bulk_index | Bulk buffer index. Buffer descriptor will be taken from this buffer for serialization and set for this buffer after deserialization. |
buf_ping_index | Ping buffer index. This buffer will be used as container to serialized buffer descriptors. |
offset | Offset in the ping buffer to serialize/deserialize network descriptor. Should have value 0 for the first descriptor when serializing/deserializing. |
Definition at line 655 of file network.c.
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 | ||
) |
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 | ||
) |
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 | ||
) |
Resize network buffer. Calls m0_net_buffer_deregister()/m0_net_buffer_register().
Definition at line 741 of file network.c.
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 | ||
) |
Remove network buffer from queue.
ctx | Net-test network context. |
buf_index | Index of buffer in ctx->ntc_buf_bulk or ntc->buf_ping arrays, depending on buf_type parameter. |
buf_type | Buffer type. |
Definition at line 500 of file network.c.
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 | ||
) |
Add bulk buffer to bulk passive/active send/recv queue.
ctx | Net-test network context. |
buf_bulk_index | Index of buffer in ctx->ntc_buf_bulk array. |
ep_index | Entry point index in ctx->ntc_ep array. Makes sense only for passive send/recv queue. |
q | Queue type. Should be one of bulk queue types. |
Definition at line 479 of file network.c.
void m0_net_test_network_ctx_fini | ( | struct m0_net_test_network_ctx * | ctx | ) |
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 | ||
) |
Initialize net-test network context. Allocate ping and bulk buffers.
ctx | net-test network context structure. |
cfg | net-test network context configuration. Function will make make a copy of this structure in ctx, so there is no need to keep cfg valid until m0_net_test_network_ctx_fini(). |
tm_addr | transfer machine address (example: "0@lo:12345:42:1024") |
Definition at line 367 of file network.c.
bool m0_net_test_network_ctx_invariant | ( | struct m0_net_test_network_ctx * | ctx | ) |
struct m0_net_end_point* m0_net_test_network_ep | ( | struct m0_net_test_network_ctx * | ctx, |
size_t | ep_index | ||
) |
int m0_net_test_network_ep_add | ( | struct m0_net_test_network_ctx * | ctx, |
const char * | ep_addr | ||
) |
Add endpoint to m0_net_test_network_ctx structure.
Definition at line 380 of file network.c.
int m0_net_test_network_ep_add_slist | ( | struct m0_net_test_network_ctx * | ctx, |
const struct m0_net_test_slist * | eps | ||
) |
Add endpoints to m0_net_test_network_ctx structure. If some endpoint addition fails, then no endpoints will be added to network context and all added endpoints will be m0_net_end_point_put()'ed.
Definition at line 400 of file network.c.
ssize_t m0_net_test_network_ep_search | ( | struct m0_net_test_network_ctx * | ctx, |
const char * | ep_addr | ||
) |
Search for ep_addr in m0_net_test_network_ctx.ntc_ep This function have time complexity of O(number of endpoints in the network context).
Definition at line 791 of file network.c.
int m0_net_test_network_msg_recv | ( | struct m0_net_test_network_ctx * | ctx, |
uint32_t | buf_ping_index | ||
) |
Add message to network messages receive queue.
Definition at line 469 of file network.c.
int m0_net_test_network_msg_send | ( | struct m0_net_test_network_ctx * | ctx, |
uint32_t | buf_ping_index, | ||
uint32_t | ep_index | ||
) |
Add message buffer to network messages send queue.
ctx | Net-test network context. |
buf_ping_index | Index of buffer in ctx->ntc_buf_ping array. |
ep_index | Entry point index in ctx->ntc_ep array. Entry points should be added to this array prior to calling this function using m0_net_test_network_ep_add(). Message will be sent to this endpoint. |
Definition at line 457 of file network.c.
int m0_net_test_network_msg_send_ep | ( | struct m0_net_test_network_ctx * | ctx, |
uint32_t | buf_ping_index, | ||
struct m0_net_end_point * | ep | ||
) |
Add message buffer to network messages send queue. Use struct m0_net_end_point instead of endpoint index.
Definition at line 442 of file network.c.
struct m0_net_test_network_timeouts m0_net_test_network_timeouts_never | ( | void | ) |
Return m0_net_test_network_timeouts, filled with M0_TIME_NEVER. Useful because M0_TIME_NEVER is declared as "extern const".
Definition at line 803 of file network.c.