History

DIM: fix dim.h kernel-doc and headers

Lots of fixes to kernel-doc in structs, enums, and functions. Also add header files that are being used but not yet #included.

Randy Dunlap committed 7 years ago

Commit 690a6ca1 parent b2d8c271 file · +33 −30Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/dim.h+33−30
@@ -4,22 +4,26 @@ · 3 unmodified lines
4#ifndef DIM_H4#ifndef DIM_H
5#define DIM_H5#define DIM_H
6 6
7#include <linux/bits.h>
8#include <linux/kernel.h>
7#include <linux/module.h>9#include <linux/module.h>
10#include <linux/types.h>
11#include <linux/workqueue.h>
8 12
9/**13/*
10 * Number of events between DIM iterations.14 * Number of events between DIM iterations.
11 * Causes a moderation of the algorithm run.15 * Causes a moderation of the algorithm run.
12 */16 */
13#define DIM_NEVENTS 6417#define DIM_NEVENTS 64
14 18
15/**19/*
16 * Is a difference between values justifies taking an action.20 * Is a difference between values justifies taking an action.
17 * We consider 10% difference as significant.21 * We consider 10% difference as significant.
18 */22 */
19#define IS_SIGNIFICANT_DIFF(val, ref) \23#define IS_SIGNIFICANT_DIFF(val, ref) \
20 (((100UL * abs((val) - (ref))) / (ref)) > 10)24 (((100UL * abs((val) - (ref))) / (ref)) > 10)
21 25
22/**26/*
23 * Calculate the gap between two values.27 * Calculate the gap between two values.
24 * Take wrap-around and variable size into consideration.28 * Take wrap-around and variable size into consideration.
25 */29 */
@@ -27,12 +31,13 @@ · 1 unmodified line
27 & (BIT_ULL(bits) - 1))31 & (BIT_ULL(bits) - 1))
28 32
29/**33/**
30 * Structure for CQ moderation values.34 * struct dim_cq_moder - Structure for CQ moderation values.
31 * Used for communications between DIM and its consumer.35 * Used for communications between DIM and its consumer.
32 *36 *
33 * @usec: CQ timer suggestion (by DIM)37 * @usec: CQ timer suggestion (by DIM)
34 * @pkts: CQ packet counter suggestion (by DIM)38 * @pkts: CQ packet counter suggestion (by DIM)
35 * @cq_period_mode: CQ priod count mode (from CQE/EQE)39 * @comps: Completion counter
40 * @cq_period_mode: CQ period count mode (from CQE/EQE)
36 */41 */
37struct dim_cq_moder {42struct dim_cq_moder {
38 u16 usec;43 u16 usec;
@@ -42,13 +47,14 @@ struct dim_cq_moder { · 3 unmodified lines
42};47};
43 48
44/**49/**
45 * Structure for DIM sample data.50 * struct dim_sample - Structure for DIM sample data.
46 * Used for communications between DIM and its consumer.51 * Used for communications between DIM and its consumer.
47 *52 *
48 * @time: Sample timestamp53 * @time: Sample timestamp
49 * @pkt_ctr: Number of packets54 * @pkt_ctr: Number of packets
50 * @byte_ctr: Number of bytes55 * @byte_ctr: Number of bytes
51 * @event_ctr: Number of events56 * @event_ctr: Number of events
57 * @comp_ctr: Current completion counter
52 */58 */
53struct dim_sample {59struct dim_sample {
54 ktime_t time;60 ktime_t time;
@@ -59,12 +65,14 @@ struct dim_sample { · 4 unmodified lines
59};65};
60 66
61/**67/**
62 * Structure for DIM stats.68 * struct dim_stats - Structure for DIM stats.
63 * Used for holding current measured rates.69 * Used for holding current measured rates.
64 *70 *
65 * @ppms: Packets per msec71 * @ppms: Packets per msec
66 * @bpms: Bytes per msec72 * @bpms: Bytes per msec
67 * @epms: Events per msec73 * @epms: Events per msec
74 * @cpms: Completions per msec
75 * @cpe_ratio: Ratio of completions to events
68 */76 */
69struct dim_stats {77struct dim_stats {
70 int ppms; /* packets per msec */78 int ppms; /* packets per msec */
@@ -75,12 +83,13 @@ struct dim_stats { · 4 unmodified lines
75};83};
76 84
77/**85/**
78 * Main structure for dynamic interrupt moderation (DIM).86 * struct dim - Main structure for dynamic interrupt moderation (DIM).
79 * Used for holding all information about a specific DIM instance.87 * Used for holding all information about a specific DIM instance.
80 *88 *
81 * @state: Algorithm state (see below)89 * @state: Algorithm state (see below)
82 * @prev_stats: Measured rates from previous iteration (for comparison)90 * @prev_stats: Measured rates from previous iteration (for comparison)
83 * @start_sample: Sampled data at start of current iteration91 * @start_sample: Sampled data at start of current iteration
92 * @measuring_sample: A &dim_sample that is used to update the current events
84 * @work: Work to perform on action required93 * @work: Work to perform on action required
85 * @priv: A pointer to the struct that points to dim94 * @priv: A pointer to the struct that points to dim
86 * @profile_ix: Current moderation profile95 * @profile_ix: Current moderation profile
@@ -106,24 +115,21 @@ struct dim { · 19 unmodified lines
106};115};
107 116
108/**117/**
109 * enum dim_cq_period_mode118 * enum dim_cq_period_mode - Modes for CQ period count
110 *
111 * These are the modes for CQ period count.
112 *119 *
113 * @DIM_CQ_PERIOD_MODE_START_FROM_EQE: Start counting from EQE120 * @DIM_CQ_PERIOD_MODE_START_FROM_EQE: Start counting from EQE
114 * @DIM_CQ_PERIOD_MODE_START_FROM_CQE: Start counting from CQE (implies timer reset)121 * @DIM_CQ_PERIOD_MODE_START_FROM_CQE: Start counting from CQE (implies timer reset)
115 * @DIM_CQ_PERIOD_NUM_MODES: Number of modes122 * @DIM_CQ_PERIOD_NUM_MODES: Number of modes
116 */123 */
117enum {124enum dim_cq_period_mode {
118 DIM_CQ_PERIOD_MODE_START_FROM_EQE = 0x0,125 DIM_CQ_PERIOD_MODE_START_FROM_EQE = 0x0,
119 DIM_CQ_PERIOD_MODE_START_FROM_CQE = 0x1,126 DIM_CQ_PERIOD_MODE_START_FROM_CQE = 0x1,
120 DIM_CQ_PERIOD_NUM_MODES127 DIM_CQ_PERIOD_NUM_MODES
121};128};
122 129
123/**130/**
124 * enum dim_state131 * enum dim_state - DIM algorithm states
125 *132 *
126 * These are the DIM algorithm states.
127 * These will determine if the algorithm is in a valid state to start an iteration.133 * These will determine if the algorithm is in a valid state to start an iteration.
128 *134 *
129 * @DIM_START_MEASURE: This is the first iteration (also after applying a new profile)135 * @DIM_START_MEASURE: This is the first iteration (also after applying a new profile)
@@ -131,16 +137,15 @@ enum { · 1 unmodified line
131 * need to perform an action137 * need to perform an action
132 * @DIM_APPLY_NEW_PROFILE: DIM consumer is currently applying a profile - no need to measure138 * @DIM_APPLY_NEW_PROFILE: DIM consumer is currently applying a profile - no need to measure
133 */139 */
134enum {140enum dim_state {
135 DIM_START_MEASURE,141 DIM_START_MEASURE,
136 DIM_MEASURE_IN_PROGRESS,142 DIM_MEASURE_IN_PROGRESS,
137 DIM_APPLY_NEW_PROFILE,143 DIM_APPLY_NEW_PROFILE,
138};144};
139 145
140/**146/**
141 * enum dim_tune_state147 * enum dim_tune_state - DIM algorithm tune states
142 *148 *
143 * These are the DIM algorithm tune states.
144 * These will determine which action the algorithm should perform.149 * These will determine which action the algorithm should perform.
145 *150 *
146 * @DIM_PARKING_ON_TOP: Algorithm found a local top point - exit on significant difference151 * @DIM_PARKING_ON_TOP: Algorithm found a local top point - exit on significant difference
@@ -148,7 +153,7 @@ enum { · 1 unmodified line
148 * @DIM_GOING_RIGHT: Algorithm is currently trying higher moderation levels153 * @DIM_GOING_RIGHT: Algorithm is currently trying higher moderation levels
149 * @DIM_GOING_LEFT: Algorithm is currently trying lower moderation levels154 * @DIM_GOING_LEFT: Algorithm is currently trying lower moderation levels
150 */155 */
151enum {156enum dim_tune_state {
152 DIM_PARKING_ON_TOP,157 DIM_PARKING_ON_TOP,
153 DIM_PARKING_TIRED,158 DIM_PARKING_TIRED,
154 DIM_GOING_RIGHT,159 DIM_GOING_RIGHT,
@@ -156,25 +161,23 @@ enum { · 1 unmodified line
156};161};
157 162
158/**163/**
159 * enum dim_stats_state164 * enum dim_stats_state - DIM algorithm statistics states
160 *165 *
161 * These are the DIM algorithm statistics states.
162 * These will determine the verdict of current iteration.166 * These will determine the verdict of current iteration.
163 *167 *
164 * @DIM_STATS_WORSE: Current iteration shows worse performance than before168 * @DIM_STATS_WORSE: Current iteration shows worse performance than before
165 * @DIM_STATS_WORSE: Current iteration shows same performance than before169 * @DIM_STATS_SAME: Current iteration shows same performance than before
166 * @DIM_STATS_WORSE: Current iteration shows better performance than before170 * @DIM_STATS_BETTER: Current iteration shows better performance than before
167 */171 */
168enum {172enum dim_stats_state {
169 DIM_STATS_WORSE,173 DIM_STATS_WORSE,
170 DIM_STATS_SAME,174 DIM_STATS_SAME,
171 DIM_STATS_BETTER,175 DIM_STATS_BETTER,
172};176};
173 177
174/**178/**
175 * enum dim_step_result179 * enum dim_step_result - DIM algorithm step results
176 *180 *
177 * These are the DIM algorithm step results.
178 * These describe the result of a step.181 * These describe the result of a step.
179 *182 *
180 * @DIM_STEPPED: Performed a regular step183 * @DIM_STEPPED: Performed a regular step
@@ -182,7 +185,7 @@ enum { · 1 unmodified line
182 * tired parking185 * tired parking
183 * @DIM_ON_EDGE: Stepped to the most left/right profile186 * @DIM_ON_EDGE: Stepped to the most left/right profile
184 */187 */
185enum {188enum dim_step_result {
186 DIM_STEPPED,189 DIM_STEPPED,
187 DIM_TOO_TIRED,190 DIM_TOO_TIRED,
188 DIM_ON_EDGE,191 DIM_ON_EDGE,
@@ -199,7 +202,7 @@ enum { · 10 unmodified lines
199bool dim_on_top(struct dim *dim);202bool dim_on_top(struct dim *dim);
200 203
201/**204/**
202 * dim_turn - change profile alterning direction205 * dim_turn - change profile altering direction
203 * @dim: DIM context206 * @dim: DIM context
204 *207 *
205 * Go left if we were going right and vice-versa.208 * Go left if we were going right and vice-versa.
@@ -238,7 +241,7 @@ void dim_calc_stats(struct dim_sample *start, struct dim_sample *end, · 32 unmodified lines
238 struct dim_stats *curr_stats);241 struct dim_stats *curr_stats);
239 242
240/**243/**
241 * dim_update_sample - set a sample's fields with give values244 * dim_update_sample - set a sample's fields with given values
242 * @event_ctr: number of events to set245 * @event_ctr: number of events to set
243 * @packets: number of packets to set246 * @packets: number of packets to set
244 * @bytes: number of bytes to set247 * @bytes: number of bytes to set
@@ -304,8 +307,8 @@ struct dim_cq_moder net_dim_get_def_tx_moderation(u8 cq_period_mode); · 59 unmodified lines
304 * @end_sample: Current data measurement307 * @end_sample: Current data measurement
305 *308 *
306 * Called by the consumer.309 * Called by the consumer.
307 * This is the main logic of the algorithm, where data is processed in order to decide on next310 * This is the main logic of the algorithm, where data is processed in order
308 * required action.311 * to decide on next required action.
309 */312 */
310void net_dim(struct dim *dim, struct dim_sample end_sample);313void net_dim(struct dim *dim, struct dim_sample end_sample);
311 314

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t