All of lore.kernel.org
 help / color / mirror / Atom feed
From: wangyufen <wangyufen@huawei.com>
To: Veaceslav Falico <darkmag@gmail.com>
Cc: netdev <netdev@vger.kernel.org>, <lizefan@huawei.com>,
	<zhangdianfang@huawei.com>
Subject: Re: [PATCH] bonding:fix speed unknown,lacp bonding failed
Date: Fri, 5 Jul 2013 18:08:44 +0800	[thread overview]
Message-ID: <51D69B2C.4040102@huawei.com> (raw)
In-Reply-To: <CAE3RKN=dy8t0W-pvq7yro643i-0AZziOw+7BQ5fc4z7JquC__Q@mail.gmail.com>

On 2013/7/5 17:20, Veaceslav Falico wrote:
> On Fri, Jul 5, 2013 at 8:32 AM, Wangyufen <wangyufen@huawei.com> 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.
> 
> Can you give a bit more details on how did you test? And which nic was it?
> 
> I've tried to reproduce it with with while :; do echo +/- >
> /sys/.../bonding/slaves; done
> but failed.
> 

that is my test script:
# !/bin/sh

function bond_enable()
{
        echo -vpa0 >/sys/class/net/bonding_masters
        sleep 2
        echo +vpa0 > /sys/class/net/bonding_masters
        echo 4 > /sys/class/net/vpa0/bonding/mode
        echo 1 > /sys/class/net/vpa0/bonding/xmit_hash_policy
        ifconfig vpa0 up
        sleep 1
        echo +eth0 > /sys/class/net/vpa0/bonding/slaves
        echo +eth5 > /sys/class/net/vpa0/bonding/slaves
        echo +eth7 > /sys/class/net/vpa0/bonding/slaves
        echo +eth9 > /sys/class/net/vpa0/bonding/slaves
        sleep 2
}

for((i=0;i<5000;i++))
do
        bond_enable

        j=0
        while [ $j -lt 10 ]
        do
                sleep 0.5
                ifconfig vpa0 192.168.13.8/24
                out=`ifconfig | grep "192.168.13.8"`
                if [ -n "$out" ];then
                        break
                fi
                ((j++))
        done
        out1=`ping 192.168.13.8 -c 4`
        out2=`cat /proc/net/bonding/vpa0 | grep "Number of ports: 4"`
        if [ -n "$out1" -a -n "$out2" ];then
                echo $i PASS >> dep002.log
        else
                echo "out1 is $out1, out2 is $out2" >>dep002.log
                echo $i FAIL >> dep002.log
                exit 0
        fi
done

>>
>> 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.
>>
>>
>> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
>> ---
>>  drivers/net/bonding/bond_main.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index f975696..d288a98 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -2301,8 +2301,11 @@ 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)
>> +                                       bond_update_speed_duplex(slave);
>>                                 continue;
>> +                       }
>>
>>                         slave->link = BOND_LINK_FAIL;
>>                         slave->delay = bond->params.downdelay;
>> --
>> 1.8.0
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
> --
> Best regards,
> Veaceslav Falico
> 
> 

  reply	other threads:[~2013-07-05 10:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-05  6:32 [PATCH] bonding:fix speed unknown,lacp bonding failed Wangyufen
2013-07-05  8:40 ` David Miller
2013-07-05 10:10   ` wangyufen
2013-07-05  9:20 ` Veaceslav Falico
2013-07-05 10:08   ` wangyufen [this message]
2013-07-05 14:54 ` Ben Hutchings

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=51D69B2C.4040102@huawei.com \
    --to=wangyufen@huawei.com \
    --cc=darkmag@gmail.com \
    --cc=lizefan@huawei.com \
    --cc=netdev@vger.kernel.org \
    --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.