From: Ding Tianhong <dingtianhong@huawei.com>
To: Nikolay Aleksandrov <nikolay@redhat.com>,
Jay Vosburgh <fubar@us.ibm.com>,
Veaceslav Falico <vfalico@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Netdev <netdev@vger.kernel.org>,
Andy Gospodarek <andy@greyhouse.net>
Subject: Re: [PATCH net-next 1/3] bonding: Set the correct value to fail_over_mac at enslavement
Date: Thu, 23 Jan 2014 10:31:50 +0800 [thread overview]
Message-ID: <52E07F16.707@huawei.com> (raw)
In-Reply-To: <52DFD3BB.5010708@redhat.com>
On 2014/1/22 22:20, Nikolay Aleksandrov wrote:
> On 01/22/2014 10:22 AM, Ding Tianhong wrote:
>> If the new slave don't support setting the MAC address, there are
>> two ways to handle this situation:
>>
>> 1). If the new slave is the first slave, set bond to the new slave's
>> MAC address, if the mode is active-backup, set fail_over_mac to
>> active, otherwise set fail_over_mac to none.
>> 2). If the new slave is not the first slave and the fail_over_mac is
>> active, it means that the slave could work normally in active-backup
>> mode, otherwise if the fail_over_mac is none, the slave could not
>> work normally for no active-backup mode, so bond could not ensalve
>> the new dev.
>>
>> Cc: Jay Vosburgh <fubar@us.ibm.com>
>> Cc: Veaceslav Falico <vfalico@redhat.com>
>> Cc: Andy Gospodarek <andy@greyhouse.net>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>> ---
>> drivers/net/bonding/bond_main.c | 12 ++++++++++--
>> 1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index 3220b48..598f100 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -1334,9 +1334,17 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
>>
>> if (slave_ops->ndo_set_mac_address == NULL) {
>> if (!bond_has_slaves(bond)) {
>> - pr_warning("%s: Warning: The first slave device specified does not support setting the MAC address. Setting fail_over_mac to active.",
>> + pr_warning("%s: Warning: The first slave device specified does not support setting the MAC address.\n",
>> bond_dev->name);
>> - bond->params.fail_over_mac = BOND_FOM_ACTIVE;
>> + if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) {
>> + bond->params.fail_over_mac = BOND_FOM_ACTIVE;
>> + pr_warning("%s: Setting fail_over_mac to active for active-backup mode.\n",
>> + bond_dev->name);
>> + } else {
>> + bond->params.fail_over_mac = BOND_FOM_NONE;
>> + pr_warning("%s: Setting fail_over_mac to none for no active-backup modes",
> At least make the warnings consistent: "... for no active-backup mode.\n".
> Also you might consider switching to pr_warn.
>
ok, thanks.
>> + bond_dev->name);
>> + }
>> } else if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) {
>> pr_err("%s: Error: The slave device specified does not support setting the MAC address, but fail_over_mac is not set to active.\n",
>> bond_dev->name);
>>
>
>
> .
>
next prev parent reply other threads:[~2014-01-23 2:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-22 9:22 [PATCH net-next 1/3] bonding: Set the correct value to fail_over_mac at enslavement Ding Tianhong
2014-01-22 14:20 ` Nikolay Aleksandrov
2014-01-23 2:31 ` Ding Tianhong [this message]
2014-01-22 20:51 ` Jay Vosburgh
2014-01-23 2:50 ` Ding Tianhong
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=52E07F16.707@huawei.com \
--to=dingtianhong@huawei.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@redhat.com \
--cc=vfalico@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).