diff options
author | stephen hemminger <stephen@networkplumber.org> | 2017-02-07 17:46:46 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-07 20:16:05 +0100 |
commit | ca6d4480f87db9d9470d3d7bbe445953fa105e57 (patch) | |
tree | d72ac5c90c2b1ea913b528a7425db874d70c270c /net/bridge/br_fdb.c | |
parent | spectrum: acl_tcam: Fix catchall prio value (diff) | |
download | linux-ca6d4480f87db9d9470d3d7bbe445953fa105e57.tar.xz linux-ca6d4480f87db9d9470d3d7bbe445953fa105e57.zip |
bridge: avoid unnecessary read of jiffies
Jiffies is volatile so read it once.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_fdb.c')
-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 5028691fa68a..5693168e88b6 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -592,13 +592,15 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, br_warn(br, "received packet on %s with own address as source address (addr:%pM, vlan:%u)\n", source->dev->name, addr, vid); } else { + unsigned long now = jiffies; + /* fastpath: update of existing entry */ if (unlikely(source != fdb->dst)) { fdb->dst = source; fdb_modified = true; } - if (jiffies != fdb->updated) - fdb->updated = jiffies; + if (now != fdb->updated) + fdb->updated = now; if (unlikely(added_by_user)) fdb->added_by_user = 1; if (unlikely(fdb_modified)) |