Skip to content

Commit ef7d5c7

Browse files
idoschdavem330
authored andcommitted
Documentation: Add description of packet trap policers
Extend devlink-trap documentation with information about packet trap policers. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1e8c661 commit ef7d5c7

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎Documentation/networking/devlink/devlink-trap.rst‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,32 @@ narrow. The description of these groups must be added to the following table:
287287
- Contains packet traps for packets that were dropped by the device during
288288
ACL processing
289289

290+
Packet Trap Policers
291+
====================
292+
293+
As previously explained, the underlying device can trap certain packets to the
294+
CPU for processing. In most cases, the underlying device is capable of handling
295+
packet rates that are several orders of magnitude higher compared to those that
296+
can be handled by the CPU.
297+
298+
Therefore, in order to prevent the underlying device from overwhelming the CPU,
299+
devices usually include packet trap policers that are able to police the
300+
trapped packets to rates that can be handled by the CPU.
301+
302+
The ``devlink-trap`` mechanism allows capable device drivers to register their
303+
supported packet trap policers with ``devlink``. The device driver can choose
304+
to associate these policers with supported packet trap groups (see
305+
:ref:`Generic-Packet-Trap-Groups`) during its initialization, thereby exposing
306+
its default control plane policy to user space.
307+
308+
Device drivers should allow user space to change the parameters of the policers
309+
(e.g., rate, burst size) as well as the association between the policers and
310+
trap groups by implementing the relevant callbacks.
311+
312+
If possible, device drivers should implement a callback that allows user space
313+
to retrieve the number of packets that were dropped by the policer because its
314+
configured policy was violated.
315+
290316
Testing
291317
=======
292318

0 commit comments

Comments
 (0)