All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizefan@huawei.com>
To: Wangyufen <wangyufen@huawei.com>
Cc: <netdev@vger.kernel.org>, <zhangdianfang@huawei.com>
Subject: Re: [PATCH v2] bonding:fix speed unknown,lacp bonding failed
Date: Tue, 9 Jul 2013 09:42:40 +0800	[thread overview]
Message-ID: <51DB6A90.3010108@huawei.com> (raw)
In-Reply-To: <1373331122-10052-1-git-send-email-wangyufen@huawei.com>

On 2013/7/9 8:52, Wangyufen wrote:
> From: "Wang Yufen" <wangyufen@huawei.com>
> 
> We bonded nic using LACP mode repeatedly, occasionally LACP bonding failed,
> because a slave nic port speed was unknown. But when we used ethtool to 
> check the slave NIC status, the nic status was normal,speed was 10000Mb/s.
> 	
> Bonding get the NIC speed from NIC drivers,just when enslave nic 
> and receive NETDEV_CHANGE event.We call bond_update_speed_duplex to 
> update speed and duplex when miimon inspect slave link is OK and slave 
> speed is unknown.
> 	

Normally one should explain the changes from v1 to v2.

> 	
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
> ---
>  drivers/net/bonding/bond_main.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index f975696..4ccc173 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -2301,8 +2301,22 @@ static int bond_miimon_inspect(struct bonding *bond)
>  
>  		switch (slave->link) {
>  		case BOND_LINK_UP:
> -			if (link_state)
> +			if (link_state) {
> +				if (slave->speed == SPEED_UNKNOWN) {
> +					rtnl_lock();

You should have CCed those who made comments to your previous version, and that's
Ben here.

"bond_update_sleep_duplex() must not be called in atomic context."

You didn't address his comment.

> +					bond_update_speed_duplex(slave);
> +					if (slave->speed != SPEED_UNKNOWN

Firstly you checked slave->speed == SPEED_UNKNOWN, and now slave->speed != SPEED_UNKNOWN ??

> +					&& bond->params.mode
> +					== BOND_MODE_8023AD) {

The codingstyle is awful...

if (slave->speed != SPEED_UNKNOWN &&
    bond->params.mode == BOND_MODE_8023AD) {
	...

Even if it breaks 80 chars limit a bit.

> +						bond_3ad_adapter_speed_changed(
> +						slave);

ditto,

> +						bond_3ad_adapter_duplex_changed(
> +						slave);

ditto

> +					}
> +					rtnl_unlock();
> +				}
>  				continue;
> +			}
>  
>  			slave->link = BOND_LINK_FAIL;
>  			slave->delay = bond->params.downdelay;
> 

  reply	other threads:[~2013-07-09  1:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09  0:52 [PATCH v2] bonding:fix speed unknown,lacp bonding failed Wangyufen
2013-07-09  1:42 ` Li Zefan [this message]
2013-07-09 13:43 ` [v2] " Veaceslav Falico

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=51DB6A90.3010108@huawei.com \
    --to=lizefan@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=wangyufen@huawei.com \
    --cc=zhangdianfang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.