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