From: Benjamin Poirier <bpoirier@nvidia.com>
To: Jay Vosburgh <jay.vosburgh@canonical.com>
Cc: netdev@vger.kernel.org, Veaceslav Falico <vfalico@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Jiri Pirko <jiri@resnulli.us>, Shuah Khan <shuah@kernel.org>,
Jonathan Toppins <jtoppins@redhat.com>,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net v2 1/3] net: bonding: Unsync device addresses on ndo_stop
Date: Mon, 5 Sep 2022 18:19:35 +0900 [thread overview]
Message-ID: <YxW/J+1GX4iN0bfU@d3> (raw)
In-Reply-To: <27922.1662143320@famine>
On 2022-09-02 11:28 -0700, Jay Vosburgh wrote:
> Benjamin Poirier <bpoirier@nvidia.com> wrote:
>
> Repeating a couple of questions that I suspect were missed the
> first time around:
Thanks for repeating, I did miss the other questions, sorry.
[...]
> >@@ -2171,12 +2169,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
> > dev_uc_sync_multiple(slave_dev, bond_dev);
> > netif_addr_unlock_bh(bond_dev);
> >
> >- if (BOND_MODE(bond) == BOND_MODE_8023AD) {
> >- /* add lacpdu mc addr to mc list */
> >- u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR;
> >-
> >+ if (BOND_MODE(bond) == BOND_MODE_8023AD)
> > dev_mc_add(slave_dev, lacpdu_multicast);
> >- }
> > }
>
> Just to make sure I'm clear (not missing something in the
> churn), the above changes regarding lacpdu_multicast have no functional
> impact, correct? They appear to move lacpdu_multicast to global scope
> for use in the change just below.
Yes, that's right - no functional impact. I'll split that to a separate
patch to make it clearer.
> > bond->slave_cnt++;
> >@@ -4211,6 +4205,9 @@ static int bond_open(struct net_device *bond_dev)
> > /* register to receive LACPDUs */
> > bond->recv_probe = bond_3ad_lacpdu_recv;
> > bond_3ad_initiate_agg_selection(bond, 1);
> >+
> >+ bond_for_each_slave(bond, slave, iter)
> >+ dev_mc_add(slave->dev, lacpdu_multicast);
> > }
>
> After this change, am I understanding correctly that both
> bond_enslave() and bond_open() will call dev_mc_add() for
> lacpdu_multicast? Since dev_mc_add() -> __dev_mc_add() calls
> __hw_addr_add_ex() with sync=false and exclusive=false, could that allow
> us to end up with two references for lacpdu_multicast?
You are correct once again. When enslaving to an up bond (case in the
selftest), it is ok, but when enslaving to a down bond and then setting
it up, there is a double add.
Thanks for the review. I'll send a v3.
next prev parent reply other threads:[~2022-09-05 9:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-02 1:45 [PATCH net v2 0/3] Unsync addresses from ports when stopping aggregated devices Benjamin Poirier
2022-09-02 1:45 ` [PATCH net v2 1/3] net: bonding: Unsync device addresses on ndo_stop Benjamin Poirier
2022-09-02 18:28 ` Jay Vosburgh
2022-09-05 9:19 ` Benjamin Poirier [this message]
2022-09-02 1:45 ` [PATCH net v2 2/3] net: team: " Benjamin Poirier
2022-09-02 1:45 ` [PATCH net v2 3/3] net: Add tests for bonding and team address list management Benjamin Poirier
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=YxW/J+1GX4iN0bfU@d3 \
--to=bpoirier@nvidia.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jay.vosburgh@canonical.com \
--cc=jiri@resnulli.us \
--cc=jtoppins@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@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).