diff options
author | Jiri Pirko <jiri@mellanox.com> | 2016-09-26 06:52:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-28 04:48:00 -0400 |
commit | fd41b0eaa06a8a0516f9e0b0a5889035bf423784 (patch) | |
tree | bdd2565cbf373e53c32a47ff30c11e4de0028ce7 /Documentation/networking | |
parent | 347e3b28c1ba24c1ae2f30290d8247480ab9ce14 (diff) |
doc: update switchdev L3 section
This is to reflect the change of FIB offload infrastructure from
switchdev objects to FIB notifier.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking')
-rw-r--r-- | Documentation/networking/switchdev.txt | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt index 44235e83799b..2bbac05ab9e2 100644 --- a/Documentation/networking/switchdev.txt +++ b/Documentation/networking/switchdev.txt | |||
@@ -314,30 +314,29 @@ the kernel, with the device doing the FIB lookup and forwarding. The device | |||
314 | does a longest prefix match (LPM) on FIB entries matching route prefix and | 314 | does a longest prefix match (LPM) on FIB entries matching route prefix and |
315 | forwards the packet to the matching FIB entry's nexthop(s) egress ports. | 315 | forwards the packet to the matching FIB entry's nexthop(s) egress ports. |
316 | 316 | ||
317 | To program the device, the driver implements support for | 317 | To program the device, the driver has to register a FIB notifier handler |
318 | SWITCHDEV_OBJ_IPV[4|6]_FIB object using switchdev_port_obj_xxx ops. | 318 | using register_fib_notifier. The following events are available: |
319 | switchdev_port_obj_add is used for both adding a new FIB entry to the device, | 319 | FIB_EVENT_ENTRY_ADD: used for both adding a new FIB entry to the device, |
320 | or modifying an existing entry on the device. | 320 | or modifying an existing entry on the device. |
321 | FIB_EVENT_ENTRY_DEL: used for removing a FIB entry | ||
322 | FIB_EVENT_RULE_ADD, FIB_EVENT_RULE_DEL: used to propagate FIB rule changes | ||
321 | 323 | ||
322 | XXX: Currently, only SWITCHDEV_OBJ_ID_IPV4_FIB objects are supported. | 324 | FIB_EVENT_ENTRY_ADD and FIB_EVENT_ENTRY_DEL events pass: |
323 | 325 | ||
324 | SWITCHDEV_OBJ_ID_IPV4_FIB object passes: | 326 | struct fib_entry_notifier_info { |
325 | 327 | struct fib_notifier_info info; /* must be first */ | |
326 | struct switchdev_obj_ipv4_fib { /* IPV4_FIB */ | ||
327 | u32 dst; | 328 | u32 dst; |
328 | int dst_len; | 329 | int dst_len; |
329 | struct fib_info *fi; | 330 | struct fib_info *fi; |
330 | u8 tos; | 331 | u8 tos; |
331 | u8 type; | 332 | u8 type; |
332 | u32 nlflags; | ||
333 | u32 tb_id; | 333 | u32 tb_id; |
334 | } ipv4_fib; | 334 | u32 nlflags; |
335 | }; | ||
335 | 336 | ||
336 | to add/modify/delete IPv4 dst/dest_len prefix on table tb_id. The *fi | 337 | to add/modify/delete IPv4 dst/dest_len prefix on table tb_id. The *fi |
337 | structure holds details on the route and route's nexthops. *dev is one of the | 338 | structure holds details on the route and route's nexthops. *dev is one of the |
338 | port netdevs mentioned in the routes next hop list. If the output port netdevs | 339 | port netdevs mentioned in the route's next hop list. |
339 | referenced in the route's nexthop list don't all have the same switch ID, the | ||
340 | driver is not called to add/modify/delete the FIB entry. | ||
341 | 340 | ||
342 | Routes offloaded to the device are labeled with "offload" in the ip route | 341 | Routes offloaded to the device are labeled with "offload" in the ip route |
343 | listing: | 342 | listing: |
@@ -355,6 +354,8 @@ listing: | |||
355 | 12.0.0.4 via 11.0.0.9 dev sw1p2 proto zebra metric 20 offload | 354 | 12.0.0.4 via 11.0.0.9 dev sw1p2 proto zebra metric 20 offload |
356 | 192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.15 | 355 | 192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.15 |
357 | 356 | ||
357 | The "offload" flag is set in case at least one device offloads the FIB entry. | ||
358 | |||
358 | XXX: add/mod/del IPv6 FIB API | 359 | XXX: add/mod/del IPv6 FIB API |
359 | 360 | ||
360 | Nexthop Resolution | 361 | Nexthop Resolution |