From: Ido Schimmel <idosch@idosch.org>
To: Arkadi Sharshevsky <arkadis@mellanox.com>
Cc: Ido Schimmel <idosch@mellanox.com>,
Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
davem@davemloft.net
Subject: Re: [PATCH net-next v2] net: bridge: Fix improper taking over HW learned FDB
Date: Fri, 28 Apr 2017 20:36:35 +0300 [thread overview]
Message-ID: <20170428173635.GA8634@splinter> (raw)
In-Reply-To: <1493397098-38756-1-git-send-email-arkadis@mellanox.com>
On Fri, Apr 28, 2017 at 07:31:38PM +0300, Arkadi Sharshevsky wrote:
> Commit 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb
> entries") added the ability to "take over an entry which was previously
> learned via HW when it shows up from a SW port".
>
> However, if an entry was learned via HW and then a control packet
> (e.g., ARP request) was trapped to the CPU, the bridge driver will
> update the entry and remove the externally learned flag, although the
> entry is still present in HW. Instead, only clear the externally learned
> flag in case of roaming.
>
> Fixes: 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb entries")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Arkadi Sharashevsky <arkadis@mellanox.com>
> Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> ---
> v1->v2
> - net-next rebase.
> ---
> net/bridge/br_fdb.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
> index de7988b..5905eb7 100644
> --- a/net/bridge/br_fdb.c
> +++ b/net/bridge/br_fdb.c
> @@ -589,16 +589,16 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
> if (unlikely(source != fdb->dst)) {
> fdb->dst = source;
> fdb_modified = true;
> + /* Take over HW learned entry */
> + if (unlikely(fdb->added_by_external_learn)) {
> + fdb->added_by_external_learn = 0;
> + fdb_modified = true;
This line is redundant. 'fdb_modified' is already set.
> + }
> }
> if (now != fdb->updated)
> fdb->updated = now;
> if (unlikely(added_by_user))
> fdb->added_by_user = 1;
> - /* Take over HW learned entry */
> - if (unlikely(fdb->added_by_external_learn)) {
> - fdb->added_by_external_learn = 0;
> - fdb_modified = true;
> - }
> if (unlikely(fdb_modified))
> fdb_notify(br, fdb, RTM_NEWNEIGH);
> }
> --
> 2.4.11
>
prev parent reply other threads:[~2017-04-28 17:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-28 16:31 [PATCH net-next v2] net: bridge: Fix improper taking over HW learned FDB Arkadi Sharshevsky
2017-04-28 17:36 ` Ido Schimmel [this message]
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=20170428173635.GA8634@splinter \
--to=idosch@idosch.org \
--cc=arkadis@mellanox.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=idosch@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.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).