lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51D69B2C.4040102@huawei.com>
Date:	Fri, 5 Jul 2013 18:08:44 +0800
From:	wangyufen <wangyufen@...wei.com>
To:	Veaceslav Falico <darkmag@...il.com>
CC:	netdev <netdev@...r.kernel.org>, <lizefan@...wei.com>,
	<zhangdianfang@...wei.com>
Subject: Re: [PATCH] bonding:fix speed unknown,lacp bonding failed

On 2013/7/5 17:20, Veaceslav Falico wrote:
> On Fri, Jul 5, 2013 at 8:32 AM, Wangyufen <wangyufen@...wei.com> wrote:
>> From: "Wang Yufen" <wangyufen@...wei.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@...wei.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@...r.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
> --
> Best regards,
> Veaceslav Falico
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ