Motr  M0
idx_dix.c File Reference
#include "lib/trace.h"
#include "lib/misc.h"
#include "lib/finject.h"
#include "ut/ut.h"
#include "ut/misc.h"
#include "rpc/rpclib.h"
#include "fid/fid.h"
#include "motr/client.h"
#include "motr/client_internal.h"
#include "motr/idx.h"
#include "dix/layout.h"
#include "dix/client.h"
#include "dix/meta.h"
#include "fop/fom_simple.h"
#include "cas/cas_xc.h"
#include "dtm0/fop.h"
#include "dtm0/drlink.h"
#include "conf/helpers.h"
#include "dix/fid_convert.h"
#include "be/dtm0_log.h"
#include "dtm0/helper.h"
#include "dtm0/service.h"
Include dependency graph for idx_dix.c:

Go to the source code of this file.

Data Structures

struct  dtm0_ut_ctx
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT
 
#define WAIT_TIMEOUT   M0_TIME_NEVER
 
#define SERVER_LOG_FILE_NAME   "cas_server.log"
 

Enumerations

enum  { MAX_RPCS_IN_FLIGHT = 10, CNT = 10, BATCH_SZ = 128 }
 

Functions

static void dix_config_init ()
 
static void dix_config_fini ()
 
static void idx_dix_ut_m0_client_init ()
 
static void idx_dix_ut_init ()
 
static void idx_dix_ut_fini ()
 
static void ut_dix_init_fini (void)
 
static int * rcs_alloc (int count)
 
static uint8_t ifid_type (bool dist)
 
static void general_ifid_fill (struct m0_fid *ifid, bool dist)
 
static void general_ifid_fill_batch (struct m0_fid *ifid, bool dist, int i)
 
static void ut_dix_namei_ops_cancel (bool dist)
 
static void ut_dix_namei_ops_cancel_dist (void)
 
static void ut_dix_namei_ops_cancel_non_dist (void)
 
static void ut_dix_namei_ops (bool dist, uint32_t flags)
 
static void ut_dix_namei_ops_dist (void)
 
static void ut_dix_namei_ops_dist_skip_layout (void)
 
static void ut_dix_namei_ops_dist_skip_layout_enable_crow (void)
 
static void ut_dix_namei_ops_non_dist (void)
 
static uint64_t dix_key (uint64_t i)
 
static uint64_t dix_val (uint64_t i)
 
static void ut_dix_record_ops (bool dist, uint32_t flags)
 
static void ut_dix_record_ops_dist_skip_layout (void)
 
static void ut_dix_record_ops_dist_skip_layout_enable_crow (void)
 
static void ut_dix_record_ops_dist (void)
 
static void ut_dix_record_ops_non_dist (void)
 
static int ut_suite_mt_idx_dix_init (void)
 
static int ut_suite_mt_idx_dix_fini (void)
 
void st_mt (void)
 
void st_lsfid (void)
 
void st_lsfid_cancel (void)
 
struct m0_clientst_get_instance ()
 
static int duc_setup (void)
 
static void idx_setup (void)
 
static void idx_teardown (void)
 
static int duc_teardown (void)
 
static void run_m0ops (uint64_t nr, enum m0_idx_opcode opcode, uint64_t phase1wait, uint64_t phase2wait)
 
static void exec_then_stable (uint64_t nr, enum m0_idx_opcode opcode)
 
static void exec_one_by_one (uint64_t nr, enum m0_idx_opcode opcode)
 
static void exec_concurrent (uint64_t nr, enum m0_idx_opcode opcode)
 
static void st_dtm0 (void)
 
static void st_dtm0_putdel (void)
 
static void st_dtm0_e_then_s (void)
 
static void st_dtm0_c (void)
 
static void dtm0_ut_cas_op_prepare (const struct m0_fid *cfid, struct m0_cas_op *op, struct m0_cas_rec *rec, uint64_t *key, uint64_t *val, struct m0_dtm0_tx_desc *txr)
 
static void dtm0_ut_send_redo (const struct m0_fid *ifid, uint64_t *key, uint64_t *val)
 
static void dtm0_ut_read_and_check (uint64_t key, uint64_t val)
 
static void st_dtm0_r (void)
 

Variables

static struct m0_clientut_m0c
 
static struct m0_config ut_m0_config
 
static struct m0_idx_dix_config ut_dix_config
 
static char * cas_startup_cmd []
 
static const char * local_ep_addr = "0@lo:12345:34:2"
 
static const char * srv_ep_addr = { "0@lo:12345:34:1" }
 
static const char * process_fid = M0_UT_CONF_PROCESS
 
struct m0_fid pver = M0_FID_TINIT('v', 1, 100)
 
static struct m0_rpc_server_ctx dix_ut_sctx
 
struct m0_ut_suite ut_suite_idx_dix
 
static struct dtm0_ut_ctx duc = {}
 
static struct m0_fid cli_dtm0_fid = M0_FID_INIT(0x7300000000000001, 0x1a)
 
struct m0_ut_suite ut_suite_mt_idx_dix
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT

Definition at line 24 of file idx_dix.c.

◆ SERVER_LOG_FILE_NAME

#define SERVER_LOG_FILE_NAME   "cas_server.log"

Definition at line 48 of file idx_dix.c.

◆ WAIT_TIMEOUT

#define WAIT_TIMEOUT   M0_TIME_NEVER

Definition at line 47 of file idx_dix.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_RPCS_IN_FLIGHT 
CNT 
BATCH_SZ 

Definition at line 54 of file idx_dix.c.

Function Documentation

◆ dix_config_fini()

static void dix_config_fini ( )
static

Definition at line 101 of file idx_dix.c.

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

◆ dix_config_init()

static void dix_config_init ( )
static

Definition at line 82 of file idx_dix.c.

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

◆ dix_key()

static uint64_t dix_key ( uint64_t  i)
static

Definition at line 439 of file idx_dix.c.

Here is the caller graph for this function:

◆ dix_val()

static uint64_t dix_val ( uint64_t  i)
static

Definition at line 444 of file idx_dix.c.

Here is the caller graph for this function:

◆ dtm0_ut_cas_op_prepare()

static void dtm0_ut_cas_op_prepare ( const struct m0_fid cfid,
struct m0_cas_op op,
struct m0_cas_rec rec,
uint64_t *  key,
uint64_t *  val,
struct m0_dtm0_tx_desc txr 
)
static

Definition at line 1067 of file idx_dix.c.

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

◆ dtm0_ut_read_and_check()

static void dtm0_ut_read_and_check ( uint64_t  key,
uint64_t  val 
)
static

Definition at line 1170 of file idx_dix.c.

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

◆ dtm0_ut_send_redo()

static void dtm0_ut_send_redo ( const struct m0_fid ifid,
uint64_t *  key,
uint64_t *  val 
)
static

Definition at line 1103 of file idx_dix.c.

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

◆ duc_setup()

static int duc_setup ( void  )
static

Definition at line 864 of file idx_dix.c.

Here is the call graph for this function:

◆ duc_teardown()

static int duc_teardown ( void  )
static

Definition at line 923 of file idx_dix.c.

Here is the call graph for this function:

◆ exec_concurrent()

static void exec_concurrent ( uint64_t  nr,
enum m0_idx_opcode  opcode 
)
static

Launch an operation then launch another one. When all opearations are launched, wait until they get stable.

Definition at line 1026 of file idx_dix.c.

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

◆ exec_one_by_one()

static void exec_one_by_one ( uint64_t  nr,
enum m0_idx_opcode  opcode 
)
static

Launch an operation and wait until it gets stable. Then launch another one.

Definition at line 1018 of file idx_dix.c.

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

◆ exec_then_stable()

static void exec_then_stable ( uint64_t  nr,
enum m0_idx_opcode  opcode 
)
static

Launch an operation, wait until it gets executed and launch another one. When all operations are executed, wait until all of them get stable.

Definition at line 1011 of file idx_dix.c.

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

◆ general_ifid_fill()

static void general_ifid_fill ( struct m0_fid ifid,
bool  dist 
)
static

Definition at line 193 of file idx_dix.c.

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

◆ general_ifid_fill_batch()

static void general_ifid_fill_batch ( struct m0_fid ifid,
bool  dist,
int  i 
)
static

Definition at line 198 of file idx_dix.c.

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

◆ idx_dix_ut_fini()

static void idx_dix_ut_fini ( )
static

Definition at line 154 of file idx_dix.c.

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

◆ idx_dix_ut_init()

static void idx_dix_ut_init ( )
static

Definition at line 141 of file idx_dix.c.

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

◆ idx_dix_ut_m0_client_init()

static void idx_dix_ut_m0_client_init ( )
static

Definition at line 107 of file idx_dix.c.

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

◆ idx_setup()

static void idx_setup ( void  )
static

Definition at line 884 of file idx_dix.c.

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

◆ idx_teardown()

static void idx_teardown ( void  )
static

Definition at line 905 of file idx_dix.c.

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

◆ ifid_type()

static uint8_t ifid_type ( bool  dist)
static

Definition at line 188 of file idx_dix.c.

Here is the caller graph for this function:

◆ rcs_alloc()

static int* rcs_alloc ( int  count)
static

Definition at line 175 of file idx_dix.c.

Here is the caller graph for this function:

◆ run_m0ops()

static void run_m0ops ( uint64_t  nr,
enum m0_idx_opcode  opcode,
uint64_t  phase1wait,
uint64_t  phase2wait 
)
static

Definition at line 935 of file idx_dix.c.

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

◆ st_dtm0()

static void st_dtm0 ( void  )
static

Definition at line 1031 of file idx_dix.c.

Here is the call graph for this function:

◆ st_dtm0_c()

static void st_dtm0_c ( void  )
static

Definition at line 1059 of file idx_dix.c.

Here is the call graph for this function:

◆ st_dtm0_e_then_s()

static void st_dtm0_e_then_s ( void  )
static

Definition at line 1051 of file idx_dix.c.

Here is the call graph for this function:

◆ st_dtm0_putdel()

static void st_dtm0_putdel ( void  )
static

Definition at line 1038 of file idx_dix.c.

Here is the call graph for this function:

◆ st_dtm0_r()

static void st_dtm0_r ( void  )
static

Definition at line 1201 of file idx_dix.c.

Here is the call graph for this function:

◆ st_lsfid()

void st_lsfid ( void  )

Definition at line 516 of file mt_fom.c.

Here is the call graph for this function:

◆ st_lsfid_cancel()

void st_lsfid_cancel ( void  )

Definition at line 521 of file mt_fom.c.

Here is the call graph for this function:

◆ st_mt()

void st_mt ( void  )

Definition at line 511 of file mt_fom.c.

Here is the call graph for this function:

◆ ut_dix_init_fini()

static void ut_dix_init_fini ( void  )
static

Definition at line 169 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_namei_ops()

static void ut_dix_namei_ops ( bool  dist,
uint32_t  flags 
)
static

Definition at line 305 of file idx_dix.c.

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

◆ ut_dix_namei_ops_cancel()

static void ut_dix_namei_ops_cancel ( bool  dist)
static

Definition at line 203 of file idx_dix.c.

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

◆ ut_dix_namei_ops_cancel_dist()

static void ut_dix_namei_ops_cancel_dist ( void  )
static

Definition at line 295 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_namei_ops_cancel_non_dist()

static void ut_dix_namei_ops_cancel_non_dist ( void  )
static

Definition at line 300 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_namei_ops_dist()

static void ut_dix_namei_ops_dist ( void  )
static

Definition at line 417 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_namei_ops_dist_skip_layout()

static void ut_dix_namei_ops_dist_skip_layout ( void  )
static

Definition at line 422 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_namei_ops_dist_skip_layout_enable_crow()

static void ut_dix_namei_ops_dist_skip_layout_enable_crow ( void  )
static

Definition at line 428 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_namei_ops_non_dist()

static void ut_dix_namei_ops_non_dist ( void  )
static

Definition at line 434 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_record_ops()

static void ut_dix_record_ops ( bool  dist,
uint32_t  flags 
)
static

Definition at line 449 of file idx_dix.c.

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

◆ ut_dix_record_ops_dist()

static void ut_dix_record_ops_dist ( void  )
static

Definition at line 790 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_record_ops_dist_skip_layout()

static void ut_dix_record_ops_dist_skip_layout ( void  )
static

Definition at line 778 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_record_ops_dist_skip_layout_enable_crow()

static void ut_dix_record_ops_dist_skip_layout_enable_crow ( void  )
static

Definition at line 784 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_dix_record_ops_non_dist()

static void ut_dix_record_ops_non_dist ( void  )
static

Definition at line 795 of file idx_dix.c.

Here is the call graph for this function:

◆ ut_suite_mt_idx_dix_fini()

static int ut_suite_mt_idx_dix_fini ( void  )
static

Definition at line 837 of file idx_dix.c.

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

◆ ut_suite_mt_idx_dix_init()

static int ut_suite_mt_idx_dix_init ( void  )
static

Definition at line 831 of file idx_dix.c.

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

Variable Documentation

◆ cas_startup_cmd

char* cas_startup_cmd[]
static
Initial value:
= {
"m0d", "-T", "linux",
"-D", "cs_sdb", "-S", "cs_stob",
"-A", "linuxstob:cs_addb_stob",
"-e", M0_NET_XPRT_PREFIX_DEFAULT":0@lo:12345:34:1",
"-H", "0@lo:12345:34:1",
"-w", "10", "-F",
"-c", M0_SRC_PATH("motr/ut/dix_conf.xc")
}
#define M0_SRC_PATH(name)
Definition: misc.h:48
#define M0_NET_XPRT_PREFIX_DEFAULT
Definition: net.h:98
#define M0_UT_CONF_PROCESS
Definition: misc.h:45

Definition at line 60 of file idx_dix.c.

◆ cli_dtm0_fid

struct m0_fid cli_dtm0_fid = M0_FID_INIT(0x7300000000000001, 0x1a)
static

Definition at line 862 of file idx_dix.c.

◆ dix_ut_sctx

struct m0_rpc_server_ctx dix_ut_sctx
static
Initial value:
= {
.rsx_argv = cas_startup_cmd,
.rsx_log_file_name = SERVER_LOG_FILE_NAME
}
static char * cas_startup_cmd[]
Definition: idx_dix.c:60
#define SERVER_LOG_FILE_NAME
Definition: idx_dix.c:48
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 76 of file idx_dix.c.

◆ duc

struct dtm0_ut_ctx duc = {}
static

Definition at line 861 of file idx_dix.c.

◆ local_ep_addr

const char* local_ep_addr = "0@lo:12345:34:2"
static

Definition at line 71 of file idx_dix.c.

◆ process_fid

const char* process_fid = M0_UT_CONF_PROCESS
static

Definition at line 73 of file idx_dix.c.

◆ pver

struct m0_fid pver = M0_FID_TINIT('v', 1, 100)

Definition at line 74 of file idx_dix.c.

◆ srv_ep_addr

const char* srv_ep_addr = { "0@lo:12345:34:1" }
static

Definition at line 72 of file idx_dix.c.

◆ ut_dix_config

struct m0_idx_dix_config ut_dix_config
static

Definition at line 52 of file idx_dix.c.

◆ ut_m0_config

struct m0_config ut_m0_config
static

Definition at line 51 of file idx_dix.c.

◆ ut_m0c

struct m0_client* ut_m0c
static

Definition at line 50 of file idx_dix.c.

◆ ut_suite_idx_dix

struct m0_ut_suite ut_suite_idx_dix
Initial value:
= {
.ts_name = "idx-dix",
.ts_owners = "Egor",
.ts_init = NULL,
.ts_fini = NULL,
.ts_tests = {
{ "init-fini", ut_dix_init_fini, "Egor" },
{ "namei-ops-dist", ut_dix_namei_ops_dist, "Egor" },
{ "namei-ops-non-dist", ut_dix_namei_ops_non_dist, "Egor" },
{ "record-ops-dist", ut_dix_record_ops_dist, "Egor" },
{ "record-ops-non-dist", ut_dix_record_ops_non_dist, "Egor" },
{ "namei-ops-cancel-dist", ut_dix_namei_ops_cancel_dist,
"Vikram" },
{ "namei-ops-cancel-non-dist", ut_dix_namei_ops_cancel_non_dist,
"Vikram" },
{ "namei-ops-dist-skip-layout",
"Venky" },
{ "record-ops-dist-skip-layout",
"Venky" },
{ "namei-ops-dist-skip-layout-enable-crow",
"Venky" },
{ "record-ops-dist-skip-layout-enable-crow",
"Venky" },
{ NULL, NULL }
}
}
static void ut_dix_record_ops_dist_skip_layout_enable_crow(void)
Definition: idx_dix.c:784
#define NULL
Definition: misc.h:38
static void ut_dix_namei_ops_dist_skip_layout_enable_crow(void)
Definition: idx_dix.c:428
static void ut_dix_record_ops_dist_skip_layout(void)
Definition: idx_dix.c:778
static void ut_dix_init_fini(void)
Definition: idx_dix.c:169
static void ut_dix_namei_ops_non_dist(void)
Definition: idx_dix.c:434
static void ut_dix_record_ops_non_dist(void)
Definition: idx_dix.c:795
static void ut_dix_record_ops_dist(void)
Definition: idx_dix.c:790
static void ut_dix_namei_ops_dist_skip_layout(void)
Definition: idx_dix.c:422
static void ut_dix_namei_ops_cancel_dist(void)
Definition: idx_dix.c:295
static void ut_dix_namei_ops_cancel_non_dist(void)
Definition: idx_dix.c:300
static void ut_dix_namei_ops_dist(void)
Definition: idx_dix.c:417

Definition at line 800 of file idx_dix.c.

◆ ut_suite_mt_idx_dix

struct m0_ut_suite ut_suite_mt_idx_dix
Initial value:
= {
.ts_name = "idx-dix-mt",
.ts_owners = "Anatoliy",
.ts_init = duc_setup,
.ts_fini = duc_teardown,
.ts_tests = {
{ "fom", st_mt, "Anatoliy" },
{ "lsf", st_lsfid, "Anatoliy" },
{ "lsfc", st_lsfid_cancel, "Vikram" },
{ "dtm0", st_dtm0, "Anatoliy" },
{ "dtm0_putdel", st_dtm0_putdel, "Ivan" },
{ "dtm0_e_then_s", st_dtm0_e_then_s, "Ivan" },
{ "dtm0_c", st_dtm0_c, "Ivan" },
{ "dtm0_r", st_dtm0_r, "Sergey" },
{ NULL, NULL }
}
}
static void st_dtm0_r(void)
Definition: idx_dix.c:1201
#define NULL
Definition: misc.h:38
static void st_dtm0(void)
Definition: idx_dix.c:1031
void st_mt(void)
Definition: mt_fom.c:511
void st_lsfid_cancel(void)
Definition: mt_fom.c:521
static void st_dtm0_c(void)
Definition: idx_dix.c:1059
static void st_dtm0_putdel(void)
Definition: idx_dix.c:1038
static void st_dtm0_e_then_s(void)
Definition: idx_dix.c:1051
static int duc_setup(void)
Definition: idx_dix.c:864
void st_lsfid(void)
Definition: mt_fom.c:516
static int duc_teardown(void)
Definition: idx_dix.c:923

Definition at line 1223 of file idx_dix.c.