• Home
  • Raw
  • Download

Lines Matching +full:rx +full:- +full:queues +full:- +full:to +full:- +full:use

2 Net DIM - Generic Network Dynamic Interrupt Moderation
19 Dynamic Interrupt Moderation (DIM) (in networking) refers to changing the
20 interrupt moderation configuration of a channel in order to optimize packet
21 processing. The mechanism includes an algorithm which decides if and how to
25 to the previous sample and if required, it can decide to change some of the
30 the algorithm might decide not to change anything. The configuration fields are
32 number of wanted packets per event. The Net DIM algorithm ascribes importance to
42 #. Compares it to previous sample.
43 #. Makes a decision - suggests interrupt moderation configuration fields.
47 supplied by the driver registered to Net DIM. The previous data is the new data
48 supplied to the previous iteration. The comparison step checks the difference
52 compared in a similar fashion - increase == "better" and decrease == "worse".
54 compared. Here the algorithm tries to optimize for lower interrupt rate so an
65 to stay still is made multiple times, the interval between iterations of the
66 algorithm would increase in order to reduce calculation overhead. Also, after
68 decide to verify this decision by taking a step in the other direction. This is
69 done in order to avoid getting stuck in a "deep sleep" scenario. Once a
73 The last step is to notify the registered driver that it should apply the
78 would have trouble making the correct decisions if the wrong data is supplied to
85 Registering a Network Device to DIM
89 This function is the entry point to the Net
90 DIM algorithm and has to be called every time the driver would like to check if
94 describes the state of DIM for a specific object (RX queue, TX queue,
95 other queues, etc.). This includes the current selected profile, previous data
98 which will be compared to the data sample stored in :c:type:`struct dim <dim>`
99 in order to decide on the algorithm's next
103 In order to use Net DIM from a networking driver, the driver needs to call the
104 main net_dim() function. The recommended method is to call net_dim() on each
105 interrupt. Since Net DIM has a built-in moderation and it might decide to skip
106 iterations under certain conditions, there is no need to moderate the net_dim()
107 calls as well. As mentioned above, the driver needs to provide an object of type
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.
112 bytes, packets and interrupts count. No need to perform any calculations, just
116 the driver to provide a callback function, which is called when the algorithm
117 decides to make a change in the interrupt moderation parameters. This callback
118 will be scheduled and run in a separate thread in order not to add overhead to
119 the data flow. After the work is done, Net DIM algorithm needs to be set to
120 the proper state in order to move to the next iteration.
126 The following code demonstrates how to register a driver to Net DIM. The actual
129 .. code-block:: c
133 /* Callback for net DIM to schedule on a decision to change moderation */
142 /* Signal net DIM work is done and it should move to next iteration */
143 dim->state = DIM_START_MEASURE;
150 /* A struct to hold current measured data */
154 dim_update_sample(my_entity->events,
155 my_entity->packets,
156 my_entity->bytes,
159 net_dim(&my_entity->dim, dim_sample);
168 INIT_WORK(&my_entity->dim.work, my_driver_do_dim_work);
175 .. kernel-doc:: include/linux/dim.h