Motr  M0
node_bulk.c File Reference
#include "lib/arith.h"
#include "lib/errno.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "lib/atomic.h"
#include "motr/magic.h"
#include "net/test/network.h"
#include "net/test/node.h"
#include "net/test/node_helper.h"
#include "net/test/service.h"
#include "net/test/ringbuf.h"
#include "net/test/node_bulk.h"
#include "net/test/debug.h"
Include dependency graph for node_bulk.c:

Go to the source code of this file.

Data Structures

struct  buf_status_errno
 
struct  buf_status_bulk
 
struct  buf_status_ping
 
struct  server_status_bulk
 
struct  state_transition
 
struct  node_bulk_ctx
 

Macros

#define NET_TEST_MODULE_NAME   node_bulk
 
#define TRANSITION(name)
 

Enumerations

enum  transfer_state {
  TS_UNUSED = 0, TS_QUEUED, TS_BD_SENT, TS_CB_LEFT2,
  TS_CB_LEFT1, TS_FAILED2, TS_FAILED1, TS_BD_RECEIVED,
  TS_SENDING, TS_RECEIVING, TS_BADMSG, TS_FAILED,
  TS_TRANSFERRED
}
 

Functions

 M0_TL_DESCR_DEFINE (bsb, "buf_status_bulk", static, struct buf_status_bulk, bsb_tlink, bsb_magic, M0_NET_TEST_BSB_MAGIC, M0_NET_TEST_BSB_HEAD_MAGIC)
 
 M0_TL_DEFINE (bsb, static, struct buf_status_bulk)
 
 M0_TL_DESCR_DEFINE (ssb, "server_status_bulk", static, struct server_status_bulk, ssb_tlink, ssb_magic, M0_NET_TEST_SSB_MAGIC, M0_NET_TEST_SSB_HEAD_MAGIC)
 
 M0_TL_DEFINE (ssb, static, struct server_status_bulk)
 
 M0_TL_DESCR_DEFINE (bsp, "buf_status_ping", static, struct buf_status_ping, bsp_tlink, bsp_magic, M0_NET_TEST_BSP_MAGIC, M0_NET_TEST_BSP_HEAD_MAGIC)
 
 M0_TL_DEFINE (bsp, static, struct buf_status_ping)
 
static void sd_update (struct node_bulk_ctx *ctx, enum m0_net_test_nh_msg_type type, enum m0_net_test_nh_msg_status status, enum m0_net_test_nh_msg_direction direction)
 
static void node_bulk_tm_event_cb (const struct m0_net_tm_event *ev)
 
static struct node_bulk_ctxnode_bulk_ctx_from_net_ctx (struct m0_net_test_network_ctx *net_ctx)
 
static bool node_bulk_state_change_allowed (enum transfer_state from, enum transfer_state to, const struct state_transition allowed[], size_t allowed_size)
 
static bool node_bulk_state_is_final (enum transfer_state state)
 
static void node_bulk_state_change (struct node_bulk_ctx *ctx, size_t bs_index, enum transfer_state state)
 
static void node_bulk_state_check (const struct state_transition state_list[], size_t state_nr)
 
static void node_bulk_state_check_all (void)
 
static enum transfer_state node_bulk_state_search (enum transfer_state state, const struct state_transition state_list[], size_t state_nr)
 
static void node_bulk_state_change_cb (struct node_bulk_ctx *ctx, size_t bs_index, bool success)
 
void node_bulk_state_transition_auto (struct node_bulk_ctx *ctx, size_t bs_index)
 
void node_bulk_state_transition_auto_all (struct node_bulk_ctx *ctx)
 
static void server_process_unused_ping (struct node_bulk_ctx *ctx)
 
static struct m0_net_buffernet_buf_bulk_get (struct node_bulk_ctx *ctx, size_t buf_bulk_index)
 
static void buf_desc_set0 (struct node_bulk_ctx *ctx, size_t buf_bulk_index)
 
static void buf_desc_swap (struct node_bulk_ctx *ctx, size_t buf_bulk_index)
 
static void buf_desc_server_free (struct node_bulk_ctx *ctx, size_t buf_bulk_index)
 
static void buf_desc_client_free (struct node_bulk_ctx *ctx, size_t bs_index)
 
static m0_bcount_t buf_desc_deserialize (struct node_bulk_ctx *ctx, size_t buf_bulk_index, size_t buf_ping_index, m0_bcount_t offset)
 
static m0_bcount_t node_bulk_server_transfer_start (struct node_bulk_ctx *ctx, size_t buf_ping_index, m0_bcount_t offset)
 
static void node_bulk_cb_server (struct node_bulk_ctx *ctx, size_t buf_index, enum m0_net_queue_type q, const struct m0_net_buffer_event *ev)
 
static void node_bulk_cb_client (struct node_bulk_ctx *ctx, size_t buf_index, enum m0_net_queue_type q, const struct m0_net_buffer_event *ev)
 
static bool node_bulk_is_stopping (struct node_bulk_ctx *ctx)
 
static void node_bulk_cb (struct m0_net_test_network_ctx *net_ctx, const uint32_t buf_index, enum m0_net_queue_type q, const struct m0_net_buffer_event *ev)
 
static size_t client_server_index (struct node_bulk_ctx *ctx, size_t bs_index)
 
static int client_bulk_enqueue (struct node_bulk_ctx *ctx, size_t buf_index)
 
static void client_bulk_dequeue (struct node_bulk_ctx *ctx, size_t buf_index)
 
static void client_transfer_start (struct node_bulk_ctx *ctx, size_t bs_index)
 
static void client_process_unused_bulk (struct node_bulk_ctx *ctx)
 
static m0_bcount_t client_bds_serialize2 (struct m0_net_test_network_ctx *net, size_t bsb_index, size_t msg_buf_index, m0_bcount_t offset)
 
static void client_bulk_bufs_dequeue (struct node_bulk_ctx *ctx, struct buf_status_bulk *bs)
 
static void client_bds_send (struct node_bulk_ctx *ctx, struct server_status_bulk *ss)
 
static void client_process_queued_bulk (struct node_bulk_ctx *ctx)
 
static void node_bulk_buf_unused (struct node_bulk_ctx *ctx)
 
static void node_bulk_buf_dequeue (struct node_bulk_ctx *ctx)
 
static bool node_bulk_bufs_unused_all (struct node_bulk_ctx *ctx)
 
static void net_bulk_worker_cb (struct node_bulk_ctx *ctx, bool pending)
 
static void node_bulk_worker (struct node_bulk_ctx *ctx)
 
static int node_bulk_test_init_fini (struct node_bulk_ctx *ctx, const struct m0_net_test_cmd *cmd)
 
static void * node_bulk_initfini (void *ctx_, struct m0_net_test_service *svc)
 
static void * node_bulk_init (struct m0_net_test_service *svc)
 
static void node_bulk_fini (void *ctx_)
 
static int node_bulk_step (void *ctx_)
 
static int node_bulk_cmd_init (void *ctx_, const struct m0_net_test_cmd *cmd, struct m0_net_test_cmd *reply)
 
static int node_bulk_cmd_start (void *ctx_, const struct m0_net_test_cmd *cmd, struct m0_net_test_cmd *reply)
 
static int node_bulk_cmd_stop (void *ctx_, const struct m0_net_test_cmd *cmd, struct m0_net_test_cmd *reply)
 
static int node_bulk_cmd_status (void *ctx_, const struct m0_net_test_cmd *cmd, struct m0_net_test_cmd *reply)
 
int m0_net_test_node_bulk_init (void)
 
void m0_net_test_node_bulk_fini (void)
 

Variables

static const struct m0_net_tm_callbacks node_bulk_tm_cb
 
static const struct state_transition node_bulk_client_success []
 
static const struct state_transition node_bulk_client_failure []
 
static const struct state_transition node_bulk_server_success []
 
static const struct state_transition node_bulk_server_failure []
 
struct {
   const struct state_transition *   nbst_transition
 
   const size_t   nbst_nr
 
node_bulk_state_transitions []
 
static struct m0_net_test_network_buffer_callbacks node_bulk_buf_cb
 
static struct m0_net_test_service_cmd_handler node_bulk_cmd_handler []
 
struct m0_net_test_service_ops m0_net_test_node_bulk_ops
 

Macro Definition Documentation

◆ NET_TEST_MODULE_NAME

#define NET_TEST_MODULE_NAME   node_bulk

Definition at line 39 of file node_bulk.c.

◆ TRANSITION

#define TRANSITION (   name)
Value:
{ \
.nbst_transition = name, \
.nbst_nr = ARRAY_SIZE(name), \
}
const char * name
Definition: trace.c:110
#define ARRAY_SIZE(a)
Definition: misc.h:45

Variable Documentation

◆ nbst_nr

const size_t nbst_nr

Definition at line 430 of file node_bulk.c.

◆ nbst_transition

const struct state_transition* nbst_transition

Definition at line 429 of file node_bulk.c.