From: Nikolay Aleksandrov <nikolay@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, andy@greyhouse.net, davem@davemloft.net,
fubar@us.ibm.com
Subject: Re: [PATCH net-next 1/5] bonding: convert to list API and replace bond's custom list
Date: Wed, 31 Jul 2013 20:44:49 +0200 [thread overview]
Message-ID: <51F95B21.5020004@redhat.com> (raw)
In-Reply-To: <20130731113717.32f48d71@nehalam.linuxnetplumber.net>
On 07/31/2013 08:37 PM, Stephen Hemminger wrote:
> On Wed, 31 Jul 2013 17:12:29 +0200
> Nikolay Aleksandrov <nikolay@redhat.com> wrote:
>
>> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>> index 390061d..80e288c 100644
>> --- a/drivers/net/bonding/bond_3ad.c
>> +++ b/drivers/net/bonding/bond_3ad.c
>> @@ -143,10 +143,13 @@ static inline struct bonding *__get_bond_by_port(struct port *port)
>> */
>> static inline struct port *__get_first_port(struct bonding *bond)
>> {
>> + struct slave *first_slave;
>> +
>> if (bond->slave_cnt == 0)
>> return NULL;
>> + first_slave = bond_first_slave(bond);
>
> As Jay said, it would be be better to have bond_first_slave return
> NULL (if no slaves), and eliminate slave_cnt. It would also fix
> a race here between slave_cnt and all slave's being removed.
>
Hi Stephen,
First off - thank you for the review.
What do you mean by eliminate slave_cnt ?
We need it for various calculations throughout the bonding.
There's no race here because read_lock(&bond->lock) is held every time this
is called and slave_cnt can change only under write_lock of the same lock,
the 3ad code is not yet converted to RCU.
Nik
next prev parent reply other threads:[~2013-07-31 18:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 15:12 [PATCH net-next 0/5] bonding: groundwork and initial conversion to RCU Nikolay Aleksandrov
2013-07-31 15:12 ` [PATCH net-next 1/5] bonding: convert to list API and replace bond's custom list Nikolay Aleksandrov
2013-07-31 18:28 ` Jay Vosburgh
2013-07-31 18:42 ` Nikolay Aleksandrov
2013-07-31 18:37 ` Stephen Hemminger
2013-07-31 18:44 ` Nikolay Aleksandrov [this message]
2013-07-31 18:56 ` Stephen Hemminger
2013-07-31 19:00 ` Nikolay Aleksandrov
2013-07-31 18:38 ` Stephen Hemminger
2013-07-31 18:49 ` Nikolay Aleksandrov
2013-07-31 15:12 ` [PATCH net-next 2/5] bonding: remove unnecessary read_locks of curr_slave_lock Nikolay Aleksandrov
2013-07-31 15:12 ` [PATCH net-next 3/5] bonding: simplify broadcast_xmit function Nikolay Aleksandrov
2013-07-31 15:12 ` [PATCH net-next 4/5] bonding: factor out slave id tx code and simplify xmit paths Nikolay Aleksandrov
2013-07-31 15:12 ` [PATCH net-next 5/5] bonding: initial RCU conversion Nikolay Aleksandrov
2013-08-01 6:46 ` Ding Tianhong
2013-08-01 7:55 ` Nikolay Aleksandrov
2013-07-31 15:27 ` [PATCH net-next 0/5] bonding: groundwork and initial conversion to RCU Eric Dumazet
2013-07-31 15:39 ` Nikolay Aleksandrov
2013-07-31 18:03 ` Jiri Pirko
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=51F95B21.5020004@redhat.com \
--to=nikolay@redhat.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/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.