MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bw_test

Function bw_test

freebsd/contrib/rdma/krping/krping.c:1135–1262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133}
1134
1135static void bw_test(struct krping_cb *cb)
1136{
1137 int ccnt, scnt, rcnt;
1138 int iters=cb->count;
1139 struct timeval start_tv, stop_tv;
1140 cycles_t *post_cycles_start = NULL;
1141 cycles_t *post_cycles_stop = NULL;
1142 cycles_t *poll_cycles_start = NULL;
1143 cycles_t *poll_cycles_stop = NULL;
1144 cycles_t *last_poll_cycles_start = NULL;
1145 cycles_t sum_poll = 0, sum_post = 0, sum_last_poll = 0;
1146 int i;
1147 int cycle_iters = 1000;
1148
1149 ccnt = 0;
1150 scnt = 0;
1151 rcnt = 0;
1152
1153 post_cycles_start = kmalloc(cycle_iters * sizeof(cycles_t), GFP_KERNEL);
1154 if (!post_cycles_start) {
1155 printk(KERN_ERR PFX "%s kmalloc failed\n", __FUNCTION__);
1156 goto done;
1157 }
1158 post_cycles_stop = kmalloc(cycle_iters * sizeof(cycles_t), GFP_KERNEL);
1159 if (!post_cycles_stop) {
1160 printk(KERN_ERR PFX "%s kmalloc failed\n", __FUNCTION__);
1161 goto done;
1162 }
1163 poll_cycles_start = kmalloc(cycle_iters * sizeof(cycles_t), GFP_KERNEL);
1164 if (!poll_cycles_start) {
1165 printk(KERN_ERR PFX "%s kmalloc failed\n", __FUNCTION__);
1166 goto done;
1167 }
1168 poll_cycles_stop = kmalloc(cycle_iters * sizeof(cycles_t), GFP_KERNEL);
1169 if (!poll_cycles_stop) {
1170 printk(KERN_ERR PFX "%s kmalloc failed\n", __FUNCTION__);
1171 goto done;
1172 }
1173 last_poll_cycles_start = kmalloc(cycle_iters * sizeof(cycles_t),
1174 GFP_KERNEL);
1175 if (!last_poll_cycles_start) {
1176 printk(KERN_ERR PFX "%s kmalloc failed\n", __FUNCTION__);
1177 goto done;
1178 }
1179 cb->rdma_sq_wr.wr.opcode = IB_WR_RDMA_WRITE;
1180 cb->rdma_sq_wr.rkey = cb->remote_rkey;
1181 cb->rdma_sq_wr.remote_addr = cb->remote_addr;
1182 cb->rdma_sq_wr.wr.sg_list->length = cb->size;
1183
1184 if (cycle_iters > iters)
1185 cycle_iters = iters;
1186 microtime(&start_tv);
1187 while (scnt < iters || ccnt < iters) {
1188
1189 while (scnt < iters && scnt - ccnt < cb->txdepth) {
1190 struct ib_send_wr *bad_wr;
1191
1192 if (scnt < cycle_iters)

Callers 2

krping_bw_test_serverFunction · 0.85
krping_bw_test_clientFunction · 0.85

Calls 2

microtimeFunction · 0.85
get_cyclesFunction · 0.85

Tested by

no test coverage detected