Lines Matching full:dim
2 Net DIM - Generic Network Dynamic Interrupt Moderation
19 Dynamic Interrupt Moderation (DIM) (in networking) refers to changing the
23 runtime data sampled from the system. Net DIM is such a mechanism. In each
28 samples is also measured. Net DIM compares the current and the previous data and
32 number of wanted packets per event. The Net DIM algorithm ascribes importance to
36 Net DIM Algorithm
39 Each iteration of the Net DIM algorithm follows these steps:
47 supplied by the driver registered to Net DIM. The previous data is the new data
58 certain percentage. Also, since Net DIM does not measure anything by itself, it
75 the Net DIM API and provided by the registered driver.
77 As you can see, Net DIM itself does not actively interact with the system. It
85 Registering a Network Device to DIM
88 Net DIM API exposes the main function net_dim().
90 DIM algorithm and has to be called every time the driver would like to check if
92 data structures: :c:type:`struct dim <dim>` and
93 :c:type:`struct dim_sample <dim_sample>`. :c:type:`struct dim <dim>`
94 describes the state of DIM for a specific object (RX queue, TX queue,
98 which will be compared to the data sample stored in :c:type:`struct dim <dim>`
103 In order to use Net DIM from a networking driver, the driver needs to call the
105 interrupt. Since Net DIM has a built-in moderation and it might decide to skip
108 :c:type:`struct dim <dim>` to the net_dim() function call. It is advised for
109 each entity using Net DIM to hold a :c:type:`struct dim <dim>` as part of its
110 data structure and use it as the main Net DIM API object.
115 The net_dim() call itself does not return anything. Instead Net DIM relies on
119 the data flow. After the work is done, Net DIM algorithm needs to be set to
126 The following code demonstrates how to register a driver to Net DIM. The actual
131 #include <linux/dim.h>
133 /* Callback for net DIM to schedule on a decision to change moderation */
136 /* Get struct dim from struct work_struct */
137 struct dim *dim = container_of(work, struct dim,
142 /* Signal net DIM work is done and it should move to next iteration */
143 dim->state = DIM_START_MEASURE;
158 /* Call net DIM */
159 net_dim(&my_entity->dim, dim_sample);
168 INIT_WORK(&my_entity->dim.work, my_driver_do_dim_work);
173 Tuning DIM
176 Net DIM serves a range of network devices and delivers excellent acceleration
177 benefits. Yet, it has been observed that some preset configurations of DIM may
180 outcomes of DIM-enabled network devices, related to a mismatch in profiles.
182 To address this issue, Net DIM introduces a per-device control to modify and
189 You can use ethtool to modify the current RX DIM profile where all
209 If the network device does not support specific fields of DIM profiles,
214 Dynamic Interrupt Moderation (DIM) library API
217 .. kernel-doc:: include/linux/dim.h