aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2009-04-23 21:58:23 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-27 05:57:44 -0400
commit29112f4e248ca6941f2233f6ed96a7283a67cced (patch)
treec533716f26da78d791089598504f6d7900c3b7c4 /drivers/net/bonding
parent434e7b0d12f4e2de6686841a42bd344325b4d756 (diff)
bonding: use ethtool for link checking first
This patch only changes the order of interfaces to use for checking slave link status in bond_check_dev_link() to priorize ethtool interface. Should safe some troubles as ethtool seems to be more supported. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> drivers/net/bonding/bond_main.c | 26 ++++++++++++-------------- 1 files changed, 12 insertions(+), 14 deletions(-) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 63369b6b14d4..e4166ee9091d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -695,6 +695,18 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
695 if (bond->params.use_carrier) 695 if (bond->params.use_carrier)
696 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; 696 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
697 697
698 /* Try to get link status using Ethtool first. */
699 if (slave_dev->ethtool_ops) {
700 if (slave_dev->ethtool_ops->get_link) {
701 u32 link;
702
703 link = slave_dev->ethtool_ops->get_link(slave_dev);
704
705 return link ? BMSR_LSTATUS : 0;
706 }
707 }
708
709 /* Ethtool can't be used, fallback to MII ioclts. */
698 ioctl = slave_ops->ndo_do_ioctl; 710 ioctl = slave_ops->ndo_do_ioctl;
699 if (ioctl) { 711 if (ioctl) {
700 /* TODO: set pointer to correct ioctl on a per team member */ 712 /* TODO: set pointer to correct ioctl on a per team member */
@@ -721,20 +733,6 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
721 } 733 }
722 734
723 /* 735 /*
724 * Some drivers cache ETHTOOL_GLINK for a period of time so we only
725 * attempt to get link status from it if the above MII ioctls fail.
726 */
727 if (slave_dev->ethtool_ops) {
728 if (slave_dev->ethtool_ops->get_link) {
729 u32 link;
730
731 link = slave_dev->ethtool_ops->get_link(slave_dev);
732
733 return link ? BMSR_LSTATUS : 0;
734 }
735 }
736
737 /*
738 * If reporting, report that either there's no dev->do_ioctl, 736 * If reporting, report that either there's no dev->do_ioctl,
739 * or both SIOCGMIIREG and get_link failed (meaning that we 737 * or both SIOCGMIIREG and get_link failed (meaning that we
740 * cannot report link status). If not reporting, pretend 738 * cannot report link status). If not reporting, pretend