From: Veaceslav Falico <vfalico@gmail.com>
To: Vlad Yasevich <vyasevich@gmail.com>
Cc: netdev@vger.kernel.org, Jay Vosburgh <j.vosburgh@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>
Subject: Re: [PATCH net-next 2/2] bonding: remove alb_set_mac_address()
Date: Thu, 22 May 2014 17:56:19 +0200 [thread overview]
Message-ID: <20140522155619.GA321@mikrodark.usersys.redhat.com> (raw)
In-Reply-To: <537E17A5.8070604@gmail.com>
On Thu, May 22, 2014 at 11:28:37AM -0400, Vlad Yasevich wrote:
>On 05/22/2014 09:12 AM, Veaceslav Falico wrote:
>> Currently it's called only from bond_alb_set_mac_address(), which is called
>> only for ALB mode, and it does nothing in case the mode is ALB. So,
>> basically, it's a no-op. All the needed functionality (modifying the active
>> slave's mac address, per example) is handled by the
>> bond_alb_set_mac_address() itself.
>>
>> So remove it, as it's not needed.
>
>From the comments and code, it seems like it should be called for TLB
>mode as well as it does that weird half-setting of the address that
>TLB seems to want. Is that not needed any more?
It's still needed, but neither before my patch, nor after it works. The
whole "save src mac address in dev->dev_addr" approach is wrong, and should
be fixed - I'm working on it, and in the meanwhile cleaning the codebase.
Basically, I see no point in fixing this code that never (at least till the
beginning of this git tree) worked considering that we'll go away
from it completely in the nearest future.
OTOH, it'll be a basic fix (and then, anyway, removed ;) ), so I can send a
v2 with it.
>
>-vlad
>
>>
>> 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_alb.c | 61 ------------------------------------------
>> 1 file changed, 61 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
>> index 965518b..1d772b5 100644
>> --- a/drivers/net/bonding/bond_alb.c
>> +++ b/drivers/net/bonding/bond_alb.c
>> @@ -1256,62 +1256,6 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
>> return 0;
>> }
>>
>> -/**
>> - * alb_set_mac_address
>> - * @bond:
>> - * @addr:
>> - *
>> - * In TLB mode all slaves are configured to the bond's hw address, but set
>> - * their dev_addr field to different addresses (based on their permanent hw
>> - * addresses).
>> - *
>> - * For each slave, this function sets the interface to the new address and then
>> - * changes its dev_addr field to its previous value.
>> - *
>> - * Unwinding assumes bond's mac address has not yet changed.
>> - */
>> -static int alb_set_mac_address(struct bonding *bond, void *addr)
>> -{
>> - struct slave *slave, *rollback_slave;
>> - struct list_head *iter;
>> - struct sockaddr sa;
>> - char tmp_addr[ETH_ALEN];
>> - int res;
>> -
>> - if (BOND_MODE(bond) == BOND_MODE_ALB)
>> - return 0;
>> -
>> - bond_for_each_slave(bond, slave, iter) {
>> - /* save net_device's current hw address */
>> - ether_addr_copy(tmp_addr, slave->dev->dev_addr);
>> -
>> - res = dev_set_mac_address(slave->dev, addr);
>> -
>> - /* restore net_device's hw address */
>> - ether_addr_copy(slave->dev->dev_addr, tmp_addr);
>> -
>> - if (res)
>> - goto unwind;
>> - }
>> -
>> - return 0;
>> -
>> -unwind:
>> - memcpy(sa.sa_data, bond->dev->dev_addr, bond->dev->addr_len);
>> - sa.sa_family = bond->dev->type;
>> -
>> - /* unwind from head to the slave that failed */
>> - bond_for_each_slave(bond, rollback_slave, iter) {
>> - if (rollback_slave == slave)
>> - break;
>> - ether_addr_copy(tmp_addr, rollback_slave->dev->dev_addr);
>> - dev_set_mac_address(rollback_slave->dev, &sa);
>> - ether_addr_copy(rollback_slave->dev->dev_addr, tmp_addr);
>> - }
>> -
>> - return res;
>> -}
>> -
>> /************************ exported alb funcions ************************/
>>
>> int bond_alb_initialize(struct bonding *bond)
>> @@ -1777,15 +1721,10 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
>> struct bonding *bond = netdev_priv(bond_dev);
>> struct sockaddr *sa = addr;
>> struct slave *swap_slave;
>> - int res;
>>
>> if (!is_valid_ether_addr(sa->sa_data))
>> return -EADDRNOTAVAIL;
>>
>> - res = alb_set_mac_address(bond, addr);
>> - if (res)
>> - return res;
>> -
>> memcpy(bond_dev->dev_addr, sa->sa_data, bond_dev->addr_len);
>>
>> /* If there is no curr_active_slave there is nothing else to do.
>>
>
next prev parent reply other threads:[~2014-05-22 15:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-22 13:12 [PATCH net-next 0/2] bonding: remove rlb_enabled and alb_set_mac_address() Veaceslav Falico
2014-05-22 13:12 ` [PATCH net-next 1/2] bonding: remove rlb_enabled and use mode == ALB instead Veaceslav Falico
2014-05-22 13:12 ` [PATCH net-next 2/2] bonding: remove alb_set_mac_address() Veaceslav Falico
2014-05-22 14:36 ` Or Gerlitz
2014-05-22 14:57 ` Veaceslav Falico
2014-05-23 6:38 ` Or Gerlitz
2014-05-22 15:28 ` Vlad Yasevich
2014-05-22 15:56 ` Veaceslav Falico [this message]
2014-05-22 18:37 ` Jay Vosburgh
2014-05-22 21:22 ` [PATCH net-next 0/2] bonding: remove rlb_enabled and alb_set_mac_address() David Miller
2014-07-06 13:56 ` Or Gerlitz
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=20140522155619.GA321@mikrodark.usersys.redhat.com \
--to=vfalico@gmail.com \
--cc=andy@greyhouse.net \
--cc=j.vosburgh@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vyasevich@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).