aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2015-05-10 12:47:47 -0400
committerDavid S. Miller <davem@davemloft.net>2015-05-12 18:43:53 -0400
commit9d47c0a2d958e06322c88245749278633d333cca (patch)
tree1d431bb9c061f7af2a934c23cbb66aeec8a3c598 /net/switchdev/switchdev.c
parentebb9a03a590e2325f747be43c8db450e92509501 (diff)
switchdev: s/swdev_/switchdev_/
Turned out that "switchdev" sticks. So just unify all related terms to use this prefix. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Scott Feldman <sfeldma@gmail.com> Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com> Acked-by: Andy Gospodarek <gospo@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r--net/switchdev/switchdev.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 52613ed49a8c..b7f44a23def5 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -28,11 +28,11 @@
28int switchdev_parent_id_get(struct net_device *dev, 28int switchdev_parent_id_get(struct net_device *dev,
29 struct netdev_phys_item_id *psid) 29 struct netdev_phys_item_id *psid)
30{ 30{
31 const struct swdev_ops *ops = dev->swdev_ops; 31 const struct switchdev_ops *ops = dev->switchdev_ops;
32 32
33 if (!ops || !ops->swdev_parent_id_get) 33 if (!ops || !ops->switchdev_parent_id_get)
34 return -EOPNOTSUPP; 34 return -EOPNOTSUPP;
35 return ops->swdev_parent_id_get(dev, psid); 35 return ops->switchdev_parent_id_get(dev, psid);
36} 36}
37EXPORT_SYMBOL_GPL(switchdev_parent_id_get); 37EXPORT_SYMBOL_GPL(switchdev_parent_id_get);
38 38
@@ -46,13 +46,13 @@ EXPORT_SYMBOL_GPL(switchdev_parent_id_get);
46 */ 46 */
47int switchdev_port_stp_update(struct net_device *dev, u8 state) 47int switchdev_port_stp_update(struct net_device *dev, u8 state)
48{ 48{
49 const struct swdev_ops *ops = dev->swdev_ops; 49 const struct switchdev_ops *ops = dev->switchdev_ops;
50 struct net_device *lower_dev; 50 struct net_device *lower_dev;
51 struct list_head *iter; 51 struct list_head *iter;
52 int err = -EOPNOTSUPP; 52 int err = -EOPNOTSUPP;
53 53
54 if (ops && ops->swdev_port_stp_update) 54 if (ops && ops->switchdev_port_stp_update)
55 return ops->swdev_port_stp_update(dev, state); 55 return ops->switchdev_port_stp_update(dev, state);
56 56
57 netdev_for_each_lower_dev(dev, lower_dev, iter) { 57 netdev_for_each_lower_dev(dev, lower_dev, iter) {
58 err = switchdev_port_stp_update(lower_dev, state); 58 err = switchdev_port_stp_update(lower_dev, state);
@@ -239,17 +239,17 @@ EXPORT_SYMBOL_GPL(ndo_dflt_switchdev_port_bridge_dellink);
239 239
240static struct net_device *switchdev_get_lowest_dev(struct net_device *dev) 240static struct net_device *switchdev_get_lowest_dev(struct net_device *dev)
241{ 241{
242 const struct swdev_ops *ops = dev->swdev_ops; 242 const struct switchdev_ops *ops = dev->switchdev_ops;
243 struct net_device *lower_dev; 243 struct net_device *lower_dev;
244 struct net_device *port_dev; 244 struct net_device *port_dev;
245 struct list_head *iter; 245 struct list_head *iter;
246 246
247 /* Recusively search down until we find a sw port dev. 247 /* Recusively search down until we find a sw port dev.
248 * (A sw port dev supports swdev_parent_id_get). 248 * (A sw port dev supports switchdev_parent_id_get).
249 */ 249 */
250 250
251 if (dev->features & NETIF_F_HW_SWITCH_OFFLOAD && 251 if (dev->features & NETIF_F_HW_SWITCH_OFFLOAD &&
252 ops && ops->swdev_parent_id_get) 252 ops && ops->switchdev_parent_id_get)
253 return dev; 253 return dev;
254 254
255 netdev_for_each_lower_dev(dev, lower_dev, iter) { 255 netdev_for_each_lower_dev(dev, lower_dev, iter) {
@@ -313,7 +313,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
313 u8 tos, u8 type, u32 nlflags, u32 tb_id) 313 u8 tos, u8 type, u32 nlflags, u32 tb_id)
314{ 314{
315 struct net_device *dev; 315 struct net_device *dev;
316 const struct swdev_ops *ops; 316 const struct switchdev_ops *ops;
317 int err = 0; 317 int err = 0;
318 318
319 /* Don't offload route if using custom ip rules or if 319 /* Don't offload route if using custom ip rules or if
@@ -331,12 +331,12 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
331 dev = switchdev_get_dev_by_nhs(fi); 331 dev = switchdev_get_dev_by_nhs(fi);
332 if (!dev) 332 if (!dev)
333 return 0; 333 return 0;
334 ops = dev->swdev_ops; 334 ops = dev->switchdev_ops;
335 335
336 if (ops->swdev_fib_ipv4_add) { 336 if (ops->switchdev_fib_ipv4_add) {
337 err = ops->swdev_fib_ipv4_add(dev, htonl(dst), dst_len, 337 err = ops->switchdev_fib_ipv4_add(dev, htonl(dst), dst_len,
338 fi, tos, type, nlflags, 338 fi, tos, type, nlflags,
339 tb_id); 339 tb_id);
340 if (!err) 340 if (!err)
341 fi->fib_flags |= RTNH_F_EXTERNAL; 341 fi->fib_flags |= RTNH_F_EXTERNAL;
342 } 342 }
@@ -361,7 +361,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
361 u8 tos, u8 type, u32 tb_id) 361 u8 tos, u8 type, u32 tb_id)
362{ 362{
363 struct net_device *dev; 363 struct net_device *dev;
364 const struct swdev_ops *ops; 364 const struct switchdev_ops *ops;
365 int err = 0; 365 int err = 0;
366 366
367 if (!(fi->fib_flags & RTNH_F_EXTERNAL)) 367 if (!(fi->fib_flags & RTNH_F_EXTERNAL))
@@ -370,11 +370,11 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
370 dev = switchdev_get_dev_by_nhs(fi); 370 dev = switchdev_get_dev_by_nhs(fi);
371 if (!dev) 371 if (!dev)
372 return 0; 372 return 0;
373 ops = dev->swdev_ops; 373 ops = dev->switchdev_ops;
374 374
375 if (ops->swdev_fib_ipv4_del) { 375 if (ops->switchdev_fib_ipv4_del) {
376 err = ops->swdev_fib_ipv4_del(dev, htonl(dst), dst_len, 376 err = ops->switchdev_fib_ipv4_del(dev, htonl(dst), dst_len,
377 fi, tos, type, tb_id); 377 fi, tos, type, tb_id);
378 if (!err) 378 if (!err)
379 fi->fib_flags &= ~RTNH_F_EXTERNAL; 379 fi->fib_flags &= ~RTNH_F_EXTERNAL;
380 } 380 }