Lots of fixes to kernel-doc in structs, enums, and functions. Also add header files that are being used but not yet #included.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -4,22 +4,26 @@ · 3 unmodified lines | ||
| 4 | 4 | #ifndef DIM_H |
| 5 | 5 | #define DIM_H |
| 6 | 6 | |
| 7 | +#include <linux/bits.h> | |
| 8 | +#include <linux/kernel.h> | |
| 7 | 9 | #include <linux/module.h> |
| 10 | +#include <linux/types.h> | |
| 11 | +#include <linux/workqueue.h> | |
| 8 | 12 | |
| 9 | −/** | |
| 13 | +/* | |
| 10 | 14 | * Number of events between DIM iterations. |
| 11 | 15 | * Causes a moderation of the algorithm run. |
| 12 | 16 | */ |
| 13 | 17 | #define DIM_NEVENTS 64 |
| 14 | 18 | |
| 15 | −/** | |
| 19 | +/* | |
| 16 | 20 | * Is a difference between values justifies taking an action. |
| 17 | 21 | * We consider 10% difference as significant. |
| 18 | 22 | */ |
| 19 | 23 | #define IS_SIGNIFICANT_DIFF(val, ref) \ |
| 20 | 24 | (((100UL * abs((val) - (ref))) / (ref)) > 10) |
| 21 | 25 | |
| 22 | −/** | |
| 26 | +/* | |
| 23 | 27 | * Calculate the gap between two values. |
| 24 | 28 | * Take wrap-around and variable size into consideration. |
| 25 | 29 | */ |
| @@ -27,12 +31,13 @@ · 1 unmodified line | ||
| 27 | 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 | 35 | * Used for communications between DIM and its consumer. |
| 32 | 36 | * |
| 33 | 37 | * @usec: CQ timer suggestion (by DIM) |
| 34 | 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 | */ |
| 37 | 42 | struct dim_cq_moder { |
| 38 | 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 | 51 | * Used for communications between DIM and its consumer. |
| 47 | 52 | * |
| 48 | 53 | * @time: Sample timestamp |
| 49 | 54 | * @pkt_ctr: Number of packets |
| 50 | 55 | * @byte_ctr: Number of bytes |
| 51 | 56 | * @event_ctr: Number of events |
| 57 | + * @comp_ctr: Current completion counter | |
| 52 | 58 | */ |
| 53 | 59 | struct dim_sample { |
| 54 | 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 | 69 | * Used for holding current measured rates. |
| 64 | 70 | * |
| 65 | 71 | * @ppms: Packets per msec |
| 66 | 72 | * @bpms: Bytes per msec |
| 67 | 73 | * @epms: Events per msec |
| 74 | + * @cpms: Completions per msec | |
| 75 | + * @cpe_ratio: Ratio of completions to events | |
| 68 | 76 | */ |
| 69 | 77 | struct dim_stats { |
| 70 | 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 | 87 | * Used for holding all information about a specific DIM instance. |
| 80 | 88 | * |
| 81 | 89 | * @state: Algorithm state (see below) |
| 82 | 90 | * @prev_stats: Measured rates from previous iteration (for comparison) |
| 83 | 91 | * @start_sample: Sampled data at start of current iteration |
| 92 | + * @measuring_sample: A &dim_sample that is used to update the current events | |
| 84 | 93 | * @work: Work to perform on action required |
| 85 | 94 | * @priv: A pointer to the struct that points to dim |
| 86 | 95 | * @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_mode | |
| 110 | − * | |
| 111 | − * These are the modes for CQ period count. | |
| 118 | + * enum dim_cq_period_mode - Modes for CQ period count | |
| 112 | 119 | * |
| 113 | 120 | * @DIM_CQ_PERIOD_MODE_START_FROM_EQE: Start counting from EQE |
| 114 | 121 | * @DIM_CQ_PERIOD_MODE_START_FROM_CQE: Start counting from CQE (implies timer reset) |
| 115 | 122 | * @DIM_CQ_PERIOD_NUM_MODES: Number of modes |
| 116 | 123 | */ |
| 117 | −enum { | |
| 124 | +enum dim_cq_period_mode { | |
| 118 | 125 | DIM_CQ_PERIOD_MODE_START_FROM_EQE = 0x0, |
| 119 | 126 | DIM_CQ_PERIOD_MODE_START_FROM_CQE = 0x1, |
| 120 | 127 | DIM_CQ_PERIOD_NUM_MODES |
| 121 | 128 | }; |
| 122 | 129 | |
| 123 | 130 | /** |
| 124 | − * enum dim_state | |
| 131 | + * enum dim_state - DIM algorithm states | |
| 125 | 132 | * |
| 126 | − * These are the DIM algorithm states. | |
| 127 | 133 | * These will determine if the algorithm is in a valid state to start an iteration. |
| 128 | 134 | * |
| 129 | 135 | * @DIM_START_MEASURE: This is the first iteration (also after applying a new profile) |
| @@ -131,16 +137,15 @@ enum { · 1 unmodified line | ||
| 131 | 137 | * need to perform an action |
| 132 | 138 | * @DIM_APPLY_NEW_PROFILE: DIM consumer is currently applying a profile - no need to measure |
| 133 | 139 | */ |
| 134 | −enum { | |
| 140 | +enum dim_state { | |
| 135 | 141 | DIM_START_MEASURE, |
| 136 | 142 | DIM_MEASURE_IN_PROGRESS, |
| 137 | 143 | DIM_APPLY_NEW_PROFILE, |
| 138 | 144 | }; |
| 139 | 145 | |
| 140 | 146 | /** |
| 141 | − * enum dim_tune_state | |
| 147 | + * enum dim_tune_state - DIM algorithm tune states | |
| 142 | 148 | * |
| 143 | − * These are the DIM algorithm tune states. | |
| 144 | 149 | * These will determine which action the algorithm should perform. |
| 145 | 150 | * |
| 146 | 151 | * @DIM_PARKING_ON_TOP: Algorithm found a local top point - exit on significant difference |
| @@ -148,7 +153,7 @@ enum { · 1 unmodified line | ||
| 148 | 153 | * @DIM_GOING_RIGHT: Algorithm is currently trying higher moderation levels |
| 149 | 154 | * @DIM_GOING_LEFT: Algorithm is currently trying lower moderation levels |
| 150 | 155 | */ |
| 151 | −enum { | |
| 156 | +enum dim_tune_state { | |
| 152 | 157 | DIM_PARKING_ON_TOP, |
| 153 | 158 | DIM_PARKING_TIRED, |
| 154 | 159 | DIM_GOING_RIGHT, |
| @@ -156,25 +161,23 @@ enum { · 1 unmodified line | ||
| 156 | 161 | }; |
| 157 | 162 | |
| 158 | 163 | /** |
| 159 | − * enum dim_stats_state | |
| 164 | + * enum dim_stats_state - DIM algorithm statistics states | |
| 160 | 165 | * |
| 161 | − * These are the DIM algorithm statistics states. | |
| 162 | 166 | * These will determine the verdict of current iteration. |
| 163 | 167 | * |
| 164 | 168 | * @DIM_STATS_WORSE: Current iteration shows worse performance than before |
| 165 | − * @DIM_STATS_WORSE: Current iteration shows same performance than before | |
| 166 | − * @DIM_STATS_WORSE: Current iteration shows better performance than before | |
| 169 | + * @DIM_STATS_SAME: Current iteration shows same performance than before | |
| 170 | + * @DIM_STATS_BETTER: Current iteration shows better performance than before | |
| 167 | 171 | */ |
| 168 | −enum { | |
| 172 | +enum dim_stats_state { | |
| 169 | 173 | DIM_STATS_WORSE, |
| 170 | 174 | DIM_STATS_SAME, |
| 171 | 175 | DIM_STATS_BETTER, |
| 172 | 176 | }; |
| 173 | 177 | |
| 174 | 178 | /** |
| 175 | − * enum dim_step_result | |
| 179 | + * enum dim_step_result - DIM algorithm step results | |
| 176 | 180 | * |
| 177 | − * These are the DIM algorithm step results. | |
| 178 | 181 | * These describe the result of a step. |
| 179 | 182 | * |
| 180 | 183 | * @DIM_STEPPED: Performed a regular step |
| @@ -182,7 +185,7 @@ enum { · 1 unmodified line | ||
| 182 | 185 | * tired parking |
| 183 | 186 | * @DIM_ON_EDGE: Stepped to the most left/right profile |
| 184 | 187 | */ |
| 185 | −enum { | |
| 188 | +enum dim_step_result { | |
| 186 | 189 | DIM_STEPPED, |
| 187 | 190 | DIM_TOO_TIRED, |
| 188 | 191 | DIM_ON_EDGE, |
| @@ -199,7 +202,7 @@ enum { · 10 unmodified lines | ||
| 199 | 202 | bool dim_on_top(struct dim *dim); |
| 200 | 203 | |
| 201 | 204 | /** |
| 202 | − * dim_turn - change profile alterning direction | |
| 205 | + * dim_turn - change profile altering direction | |
| 203 | 206 | * @dim: DIM context |
| 204 | 207 | * |
| 205 | 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 | 241 | struct dim_stats *curr_stats); |
| 239 | 242 | |
| 240 | 243 | /** |
| 241 | − * dim_update_sample - set a sample's fields with give values | |
| 244 | + * dim_update_sample - set a sample's fields with given values | |
| 242 | 245 | * @event_ctr: number of events to set |
| 243 | 246 | * @packets: number of packets to set |
| 244 | 247 | * @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 | 307 | * @end_sample: Current data measurement |
| 305 | 308 | * |
| 306 | 309 | * Called by the consumer. |
| 307 | − * This is the main logic of the algorithm, where data is processed in order to decide on next | |
| 308 | − * required action. | |
| 310 | + * This is the main logic of the algorithm, where data is processed in order | |
| 311 | + * to decide on next required action. | |
| 309 | 312 | */ |
| 310 | 313 | void net_dim(struct dim *dim, struct dim_sample end_sample); |
| 311 | 314 | |