diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2019-11-01 14:46:39 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-01 10:32:43 -0700 |
commit | 58ec1ea637ca2230c69d6972985ba619366c688b (patch) | |
tree | c3ba126a35c3ac10579e7a6ff9b990526448ce51 /net/bridge | |
parent | 31f1155bdc26aabd8de4bdf25e1c9ce9dbb21ff5 (diff) | |
download | linux-58ec1ea637ca2230c69d6972985ba619366c688b.tar.gz linux-58ec1ea637ca2230c69d6972985ba619366c688b.tar.bz2 linux-58ec1ea637ca2230c69d6972985ba619366c688b.zip |
net: bridge: fdb: restore unlikely() when taking over externally added entries
Taking over hw-learned entries is not a likely scenario so restore the
unlikely() use for the case of SW taking over externally learned
entries.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_fdb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 7500c84fc675..284b3662d234 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -587,8 +587,10 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, fdb->dst = source; fdb_modified = true; /* Take over HW learned entry */ - test_and_clear_bit(BR_FDB_ADDED_BY_EXT_LEARN, - &fdb->flags); + if (unlikely(test_bit(BR_FDB_ADDED_BY_EXT_LEARN, + &fdb->flags))) + clear_bit(BR_FDB_ADDED_BY_EXT_LEARN, + &fdb->flags); } if (now != fdb->updated) fdb->updated = now; |