Skip to content

Commit

Permalink
net: bridge: mdb: arrange internal structs so fast-path fields are close
Browse files Browse the repository at this point in the history
Before this patch we'd need 2 cache lines for fast-path, now all used
fields are in the first cache line.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Nikolay Aleksandrov authored and Jakub Kicinski committed Sep 7, 2020
1 parent bb1416a commit 6ec0d0e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions net/bridge/br_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,27 @@ struct net_bridge_fdb_entry {
struct net_bridge_port_group {
struct net_bridge_port *port;
struct net_bridge_port_group __rcu *next;
struct hlist_node mglist;
struct rcu_head rcu;
struct timer_list timer;
struct br_ip addr;
unsigned char eth_addr[ETH_ALEN] __aligned(2);
unsigned char flags;

struct timer_list timer;
struct hlist_node mglist;

struct rcu_head rcu;
};

struct net_bridge_mdb_entry {
struct rhash_head rhnode;
struct net_bridge *br;
struct net_bridge_port_group __rcu *ports;
struct rcu_head rcu;
struct timer_list timer;
struct br_ip addr;
bool host_joined;

struct timer_list timer;
struct hlist_node mdb_node;

struct rcu_head rcu;
};

struct net_bridge_port {
Expand Down

0 comments on commit 6ec0d0e

Please sign in to comment.