Lines Matching full:dim
6 #include <linux/dim.h>
8 static int rdma_dim_step(struct dim *dim) in rdma_dim_step() argument
10 if (dim->tune_state == DIM_GOING_RIGHT) { in rdma_dim_step()
11 if (dim->profile_ix == (RDMA_DIM_PARAMS_NUM_PROFILES - 1)) in rdma_dim_step()
13 dim->profile_ix++; in rdma_dim_step()
14 dim->steps_right++; in rdma_dim_step()
16 if (dim->tune_state == DIM_GOING_LEFT) { in rdma_dim_step()
17 if (dim->profile_ix == 0) in rdma_dim_step()
19 dim->profile_ix--; in rdma_dim_step()
20 dim->steps_left++; in rdma_dim_step()
44 static bool rdma_dim_decision(struct dim_stats *curr_stats, struct dim *dim) in rdma_dim_decision() argument
46 int prev_ix = dim->profile_ix; in rdma_dim_decision()
47 u8 state = dim->tune_state; in rdma_dim_decision()
53 &dim->prev_stats); in rdma_dim_decision()
58 dim->profile_ix = 0; in rdma_dim_decision()
61 dim_turn(dim); in rdma_dim_decision()
64 step_res = rdma_dim_step(dim); in rdma_dim_decision()
66 dim_turn(dim); in rdma_dim_decision()
71 dim->prev_stats = *curr_stats; in rdma_dim_decision()
73 return dim->profile_ix != prev_ix; in rdma_dim_decision()
76 void rdma_dim(struct dim *dim, u64 completions) in rdma_dim() argument
78 struct dim_sample *curr_sample = &dim->measuring_sample; in rdma_dim()
84 &dim->measuring_sample); in rdma_dim()
86 switch (dim->state) { in rdma_dim()
88 nevents = curr_sample->event_ctr - dim->start_sample.event_ctr; in rdma_dim()
91 if (!dim_calc_stats(&dim->start_sample, curr_sample, &curr_stats)) in rdma_dim()
93 if (rdma_dim_decision(&curr_stats, dim)) { in rdma_dim()
94 dim->state = DIM_APPLY_NEW_PROFILE; in rdma_dim()
95 schedule_work(&dim->work); in rdma_dim()
100 dim->state = DIM_MEASURE_IN_PROGRESS; in rdma_dim()
103 &dim->start_sample); in rdma_dim()