diff options
author | Ido Schimmel <idosch@mellanox.com> | 2019-08-17 09:28:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-17 15:40:09 -0400 |
commit | 9e087457048884c57c51a32b52d8aa1d9b0d7385 (patch) | |
tree | 05c12d161dd31549585d1bdc732cc9c9caf2a051 | |
parent | da58f90f11f597520f226caff1d3cfc115abedc9 (diff) |
Documentation: Add description of netdevsim traps
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/networking/devlink-trap-netdevsim.rst | 20 | ||||
-rw-r--r-- | Documentation/networking/devlink-trap.rst | 11 | ||||
-rw-r--r-- | Documentation/networking/index.rst | 1 | ||||
-rw-r--r-- | drivers/net/netdevsim/dev.c | 3 |
4 files changed, 35 insertions, 0 deletions
diff --git a/Documentation/networking/devlink-trap-netdevsim.rst b/Documentation/networking/devlink-trap-netdevsim.rst new file mode 100644 index 000000000000..b721c9415473 --- /dev/null +++ b/Documentation/networking/devlink-trap-netdevsim.rst | |||
@@ -0,0 +1,20 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ====================== | ||
4 | Devlink Trap netdevsim | ||
5 | ====================== | ||
6 | |||
7 | Driver-specific Traps | ||
8 | ===================== | ||
9 | |||
10 | .. list-table:: List of Driver-specific Traps Registered by ``netdevsim`` | ||
11 | :widths: 5 5 90 | ||
12 | |||
13 | * - Name | ||
14 | - Type | ||
15 | - Description | ||
16 | * - ``fid_miss`` | ||
17 | - ``exception`` | ||
18 | - When a packet enters the device it is classified to a filtering | ||
19 | indentifier (FID) based on the ingress port and VLAN. This trap is used | ||
20 | to trap packets for which a FID could not be found | ||
diff --git a/Documentation/networking/devlink-trap.rst b/Documentation/networking/devlink-trap.rst index dbc7a3e00fd8..fe4f6e149623 100644 --- a/Documentation/networking/devlink-trap.rst +++ b/Documentation/networking/devlink-trap.rst | |||
@@ -162,6 +162,17 @@ be added to the following table: | |||
162 | - Traps packets that the device decided to drop because they could not be | 162 | - Traps packets that the device decided to drop because they could not be |
163 | enqueued to a transmission queue which is full | 163 | enqueued to a transmission queue which is full |
164 | 164 | ||
165 | Driver-specific Packet Traps | ||
166 | ============================ | ||
167 | |||
168 | Device drivers can register driver-specific packet traps, but these must be | ||
169 | clearly documented. Such traps can correspond to device-specific exceptions and | ||
170 | help debug packet drops caused by these exceptions. The following list includes | ||
171 | links to the description of driver-specific traps registered by various device | ||
172 | drivers: | ||
173 | |||
174 | * :doc:`/devlink-trap-netdevsim` | ||
175 | |||
165 | Generic Packet Trap Groups | 176 | Generic Packet Trap Groups |
166 | ========================== | 177 | ========================== |
167 | 178 | ||
diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 86a814e4d450..37eabc17894c 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst | |||
@@ -15,6 +15,7 @@ Contents: | |||
15 | dsa/index | 15 | dsa/index |
16 | devlink-info-versions | 16 | devlink-info-versions |
17 | devlink-trap | 17 | devlink-trap |
18 | devlink-trap-netdevsim | ||
18 | ieee802154 | 19 | ieee802154 |
19 | kapi | 20 | kapi |
20 | z8530book | 21 | z8530book |
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index d07bbf0ab627..c217049552f7 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c | |||
@@ -323,6 +323,9 @@ struct nsim_trap_data { | |||
323 | spinlock_t trap_lock; /* Protects trap_items_arr */ | 323 | spinlock_t trap_lock; /* Protects trap_items_arr */ |
324 | }; | 324 | }; |
325 | 325 | ||
326 | /* All driver-specific traps must be documented in | ||
327 | * Documentation/networking/devlink-trap-netdevsim.rst | ||
328 | */ | ||
326 | enum { | 329 | enum { |
327 | NSIM_TRAP_ID_BASE = DEVLINK_TRAP_GENERIC_ID_MAX, | 330 | NSIM_TRAP_ID_BASE = DEVLINK_TRAP_GENERIC_ID_MAX, |
328 | NSIM_TRAP_ID_FID_MISS, | 331 | NSIM_TRAP_ID_FID_MISS, |