diff options
author | Scott Feldman <sfeldma@gmail.com> | 2015-03-06 00:21:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-06 00:24:58 -0500 |
commit | 5e8d90497d65f528c54015644095ace6e330fd8e (patch) | |
tree | 468da27cdb259f0f7b6163598b824895041f0865 | |
parent | 4586f1bb911ce219a4bc1c2a9d6eee2e058b2b51 (diff) |
switchdev: add IPv4 fib ndo ops wrappers
Add IPv4 fib ndo wrapper funcs and stub them out for now.
Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/switchdev.h | 19 | ||||
-rw-r--r-- | net/switchdev/switchdev.c | 39 |
2 files changed, 58 insertions, 0 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h index cfcdac2e5d25..8d2ac663325a 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h | |||
@@ -51,6 +51,11 @@ int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev, | |||
51 | struct nlmsghdr *nlh, u16 flags); | 51 | struct nlmsghdr *nlh, u16 flags); |
52 | int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev, | 52 | int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev, |
53 | struct nlmsghdr *nlh, u16 flags); | 53 | struct nlmsghdr *nlh, u16 flags); |
54 | int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi, | ||
55 | u8 tos, u8 type, u32 tb_id); | ||
56 | int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi, | ||
57 | u8 tos, u8 type, u32 tb_id); | ||
58 | |||
54 | #else | 59 | #else |
55 | 60 | ||
56 | static inline int netdev_switch_parent_id_get(struct net_device *dev, | 61 | static inline int netdev_switch_parent_id_get(struct net_device *dev, |
@@ -109,6 +114,20 @@ static inline int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device * | |||
109 | return 0; | 114 | return 0; |
110 | } | 115 | } |
111 | 116 | ||
117 | static inline int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, | ||
118 | struct fib_info *fi, | ||
119 | u8 tos, u8 type, u32 tb_id) | ||
120 | { | ||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | static inline int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, | ||
125 | struct fib_info *fi, | ||
126 | u8 tos, u8 type, u32 tb_id) | ||
127 | { | ||
128 | return 0; | ||
129 | } | ||
130 | |||
112 | #endif | 131 | #endif |
113 | 132 | ||
114 | #endif /* _LINUX_SWITCHDEV_H_ */ | 133 | #endif /* _LINUX_SWITCHDEV_H_ */ |
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 8c1e558db118..3c090f8d071b 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/mutex.h> | 14 | #include <linux/mutex.h> |
15 | #include <linux/notifier.h> | 15 | #include <linux/notifier.h> |
16 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
17 | #include <net/ip_fib.h> | ||
17 | #include <net/switchdev.h> | 18 | #include <net/switchdev.h> |
18 | 19 | ||
19 | /** | 20 | /** |
@@ -225,3 +226,41 @@ int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev, | |||
225 | return ret; | 226 | return ret; |
226 | } | 227 | } |
227 | EXPORT_SYMBOL(ndo_dflt_netdev_switch_port_bridge_dellink); | 228 | EXPORT_SYMBOL(ndo_dflt_netdev_switch_port_bridge_dellink); |
229 | |||
230 | /** | ||
231 | * netdev_switch_fib_ipv4_add - Add IPv4 route entry to switch | ||
232 | * | ||
233 | * @dst: route's IPv4 destination address | ||
234 | * @dst_len: destination address length (prefix length) | ||
235 | * @fi: route FIB info structure | ||
236 | * @tos: route TOS | ||
237 | * @type: route type | ||
238 | * @tb_id: route table ID | ||
239 | * | ||
240 | * Add IPv4 route entry to switch device. | ||
241 | */ | ||
242 | int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi, | ||
243 | u8 tos, u8 type, u32 tb_id) | ||
244 | { | ||
245 | return 0; | ||
246 | } | ||
247 | EXPORT_SYMBOL(netdev_switch_fib_ipv4_add); | ||
248 | |||
249 | /** | ||
250 | * netdev_switch_fib_ipv4_del - Delete IPv4 route entry from switch | ||
251 | * | ||
252 | * @dst: route's IPv4 destination address | ||
253 | * @dst_len: destination address length (prefix length) | ||
254 | * @fi: route FIB info structure | ||
255 | * @tos: route TOS | ||
256 | * @type: route type | ||
257 | * @tb_id: route table ID | ||
258 | * | ||
259 | * Delete IPv4 route entry from switch device. | ||
260 | */ | ||
261 | int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi, | ||
262 | u8 tos, u8 type, u32 tb_id) | ||
263 | { | ||
264 | return 0; | ||
265 | } | ||
266 | EXPORT_SYMBOL(netdev_switch_fib_ipv4_del); | ||