netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: wpan@redhat.com
Cc: netdev@vger.kernel.org, fubar@us.ibm.com, andy@greyhouse.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bonding:update speed/duplex for NETDEV_CHANGE
Date: Tue, 01 Nov 2011 17:53:23 -0400 (EDT)	[thread overview]
Message-ID: <20111101.175323.1446639403785720039.davem@davemloft.net> (raw)
In-Reply-To: <9765cb601d0b4330cf7775ec3cd6b9e1ea13c71e.1320117071.git.wpan@redhat.com>

From: Weiping Pan <wpan@redhat.com>
Date: Tue,  1 Nov 2011 11:20:48 +0800

> Zheng Liang(lzheng@redhat.com) found a bug that if we config bonding with
> arp monitor, sometimes bonding driver cannot get the speed and duplex from
> its slaves, it will assume them to be 100Mb/sec and Full, please see
> /proc/net/bonding/bond0.
> But there is no such problem when uses miimon.
> 
> (Take igb for example)
> I find that the reason is that after dev_open() in bond_enslave(),
> bond_update_speed_duplex() will call igb_get_settings()
> , but in that function,
> it runs ethtool_cmd_speed_set(ecmd, -1); ecmd->duplex = -1;
> because igb get an error value of status.
> So even dev_open() is called, but the device is not really ready to get its
> settings.
> 
> Maybe it is safe for us to call igb_get_settings() only after
> this message shows up, that is "igb: p4p1 NIC Link is Up 1000 Mbps Full Duplex,
> Flow Control: RX".
> 
> So I prefer to update the speed and duplex for a slave when reseices
> NETDEV_CHANGE/NETDEV_UP event.
> 
> Changelog
> V2:
> 1 remove the "fake 100/Full" logic in bond_update_speed_duplex(),
>   set speed and duplex to -1 when it gets error value of speed and duplex.
> 2 delete the warning in bond_enslave() if bond_update_speed_duplex() returns
>   error.
> 3 make bond_info_show_slave() handle bad values of speed and duplex.
> 
> Signed-off-by: Weiping Pan <wpan@redhat.com>

Looks good, applied, thanks!

      reply	other threads:[~2011-11-01 21:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31  2:53 When can a net device get its setting correctly ? WeipingPan
2011-10-31 14:19 ` [PATCH] bonding:update speed/duplex for NETDEV_CHANGE Weiping Pan
2011-10-31 18:15   ` Ben Hutchings
2011-10-31 20:32     ` Jay Vosburgh
2011-10-31 20:48       ` Ben Hutchings
2011-10-31 21:23         ` Jay Vosburgh
2011-10-31 22:41           ` Ben Hutchings
2011-11-01  3:20       ` Weiping Pan
2011-11-01 21:53         ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111101.175323.1446639403785720039.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andy@greyhouse.net \
    --cc=fubar@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wpan@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).