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>
This commit is contained in:
Nikolay Aleksandrov 2019-11-01 14:46:39 +02:00 committed by David S. Miller
parent 31f1155bdc
commit 58ec1ea637
1 changed files with 4 additions and 2 deletions

View File

@ -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;