aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2018-09-21 18:27:39 -0400
committerDavid S. Miller <davem@davemloft.net>2018-09-24 00:55:24 -0400
commit93f62ad5e83a13e0c224dfca5ef40f90c09aad51 (patch)
treed875da6a6989846ee0288c68c9cc1ed9fd0f2dbc /drivers/net/bonding
parentac3d9dd034e565df2c034ab2ca71f0a9f69153c1 (diff)
bonding: use netpoll_poll_dev() helper
We want to allow NAPI drivers to no longer provide ndo_poll_controller() method, as it has been proven problematic. team driver must not look at its presence, but instead call netpoll_poll_dev() which factorize the needed actions. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Jay Vosburgh <j.vosburgh@gmail.com> Cc: Veaceslav Falico <vfalico@gmail.com> Cc: Andy Gospodarek <andy@greyhouse.net> Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a764a83f99da..0d87e11e7f1d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -971,16 +971,13 @@ static void bond_poll_controller(struct net_device *bond_dev)
971 struct slave *slave = NULL; 971 struct slave *slave = NULL;
972 struct list_head *iter; 972 struct list_head *iter;
973 struct ad_info ad_info; 973 struct ad_info ad_info;
974 struct netpoll_info *ni;
975 const struct net_device_ops *ops;
976 974
977 if (BOND_MODE(bond) == BOND_MODE_8023AD) 975 if (BOND_MODE(bond) == BOND_MODE_8023AD)
978 if (bond_3ad_get_active_agg_info(bond, &ad_info)) 976 if (bond_3ad_get_active_agg_info(bond, &ad_info))
979 return; 977 return;
980 978
981 bond_for_each_slave_rcu(bond, slave, iter) { 979 bond_for_each_slave_rcu(bond, slave, iter) {
982 ops = slave->dev->netdev_ops; 980 if (!bond_slave_is_up(slave))
983 if (!bond_slave_is_up(slave) || !ops->ndo_poll_controller)
984 continue; 981 continue;
985 982
986 if (BOND_MODE(bond) == BOND_MODE_8023AD) { 983 if (BOND_MODE(bond) == BOND_MODE_8023AD) {
@@ -992,11 +989,7 @@ static void bond_poll_controller(struct net_device *bond_dev)
992 continue; 989 continue;
993 } 990 }
994 991
995 ni = rcu_dereference_bh(slave->dev->npinfo); 992 netpoll_poll_dev(slave->dev);
996 if (down_trylock(&ni->dev_lock))
997 continue;
998 ops->ndo_poll_controller(slave->dev);
999 up(&ni->dev_lock);
1000 } 993 }
1001} 994}
1002 995