aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2016-09-26 06:52:34 -0400
committerDavid S. Miller <davem@davemloft.net>2016-09-28 04:48:00 -0400
commitfd41b0eaa06a8a0516f9e0b0a5889035bf423784 (patch)
treebdd2565cbf373e53c32a47ff30c11e4de0028ce7 /Documentation/networking
parent347e3b28c1ba24c1ae2f30290d8247480ab9ce14 (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.txt27
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
314does a longest prefix match (LPM) on FIB entries matching route prefix and 314does a longest prefix match (LPM) on FIB entries matching route prefix and
315forwards the packet to the matching FIB entry's nexthop(s) egress ports. 315forwards the packet to the matching FIB entry's nexthop(s) egress ports.
316 316
317To program the device, the driver implements support for 317To program the device, the driver has to register a FIB notifier handler
318SWITCHDEV_OBJ_IPV[4|6]_FIB object using switchdev_port_obj_xxx ops. 318using register_fib_notifier. The following events are available:
319switchdev_port_obj_add is used for both adding a new FIB entry to the device, 319FIB_EVENT_ENTRY_ADD: used for both adding a new FIB entry to the device,
320or modifying an existing entry on the device. 320 or modifying an existing entry on the device.
321FIB_EVENT_ENTRY_DEL: used for removing a FIB entry
322FIB_EVENT_RULE_ADD, FIB_EVENT_RULE_DEL: used to propagate FIB rule changes
321 323
322XXX: Currently, only SWITCHDEV_OBJ_ID_IPV4_FIB objects are supported. 324FIB_EVENT_ENTRY_ADD and FIB_EVENT_ENTRY_DEL events pass:
323 325
324SWITCHDEV_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
336to add/modify/delete IPv4 dst/dest_len prefix on table tb_id. The *fi 337to add/modify/delete IPv4 dst/dest_len prefix on table tb_id. The *fi
337structure holds details on the route and route's nexthops. *dev is one of the 338structure holds details on the route and route's nexthops. *dev is one of the
338port netdevs mentioned in the routes next hop list. If the output port netdevs 339port netdevs mentioned in the route's next hop list.
339referenced in the route's nexthop list don't all have the same switch ID, the
340driver is not called to add/modify/delete the FIB entry.
341 340
342Routes offloaded to the device are labeled with "offload" in the ip route 341Routes offloaded to the device are labeled with "offload" in the ip route
343listing: 342listing:
@@ -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
357The "offload" flag is set in case at least one device offloads the FIB entry.
358
358XXX: add/mod/del IPv6 FIB API 359XXX: add/mod/del IPv6 FIB API
359 360
360Nexthop Resolution 361Nexthop Resolution