netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Varka Bhadram <varkabhadram@gmail.com>
To: Veaceslav Falico <vfalico@gmail.com>, netdev@vger.kernel.org
Cc: Jay Vosburgh <j.vosburgh@gmail.com>,
	Andy Gospodarek <andy@greyhouse.net>
Subject: Re: [PATCH net-next] bonding: permit enslaving interfaces without set_mac support
Date: Tue, 15 Jul 2014 17:15:34 +0530	[thread overview]
Message-ID: <53C5145E.5040908@gmail.com> (raw)
In-Reply-To: <1405423561-9114-1-git-send-email-vfalico@gmail.com>

On 07/15/2014 04:56 PM, Veaceslav Falico wrote:
> Currently we exit if the slave isn't the first slave, doesn't support mac
> address setting and fail_over_mac isn't FOM_ACTIVE. It's wrong because we
> only require ndo_set_mac_address in case bonding is in active-backup mode
> and FOM isn't FOM_ACTIVE.
>
> To fix this - only exit with an error if we're in a/b mode and have
> fail_over_mac != FOM_ACTIVE.
>
> Also, maintain current behaviour on the first slave (forcibly change fom to
> FOM_ACTIVE) to not break anyone's configuration.
>
> CC: Jay Vosburgh <j.vosburgh@gmail.com>
> CC: Andy Gospodarek <andy@greyhouse.net>
> Signed-off-by: Veaceslav Falico <vfalico@gmail.com>
> ---
>   drivers/net/bonding/bond_main.c | 19 ++++++++++---------
>   1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 09dc3ef..e0a33b5 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1298,19 +1298,20 @@ 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_warn("%s: Warning: The first slave device specified does not support setting the MAC address\n",
> -				bond_dev->name);
> -			if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) {
> +		pr_warn("%s: Warning: The slave device specified does not support setting the MAC address\n",
> +			bond_dev->name);

netdev_warn() instead of pr_warn()... We are having net_device object?

> +		if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP &&
> +		    bond->params.fail_over_mac != BOND_FOM_ACTIVE) {
> +			if (!bond_has_slaves(bond)) {
>   				bond->params.fail_over_mac = BOND_FOM_ACTIVE;
>   				pr_warn("%s: Setting fail_over_mac to active for active-backup mode\n",
>   					bond_dev->name);
> +			} else {
> +				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);

netdev_err()...?

> +				res = -EOPNOTSUPP;
> +				goto err_undo_flags;
>   			}
> -		} 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);
> -			res = -EOPNOTSUPP;
> -			goto err_undo_flags;
>   		}
>   	}
>   

-- 
Regards,
Varka Bhadram.

  reply	other threads:[~2014-07-15 11:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 11:26 [PATCH net-next] bonding: permit enslaving interfaces without set_mac support Veaceslav Falico
2014-07-15 11:45 ` Varka Bhadram [this message]
2014-07-15 11:59   ` Veaceslav Falico
2014-07-16  5:55 ` David Miller
2014-07-17 19:21 ` Jay Vosburgh
2014-07-17 19:31   ` 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=53C5145E.5040908@gmail.com \
    --to=varkabhadram@gmail.com \
    --cc=andy@greyhouse.net \
    --cc=j.vosburgh@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vfalico@gmail.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).