Skip to content

Commit

Permalink
fib_rules: reorder struct fib_rules fields
Browse files Browse the repository at this point in the history
Move refcnt, pref, suppress_ifgroup, suppress_prefixlen out of first
cache line, as they are not used in fast path.

Make sure ctarget & fr_net are in first cache line.

(Assuming 64 bit arches and 64 bytes cache lines)

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Aug 3, 2013
1 parent 73f5698 commit fba3679
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions include/net/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@

struct fib_rule {
struct list_head list;
atomic_t refcnt;
int iifindex;
int oifindex;
u32 mark;
u32 mark_mask;
u32 pref;
u32 flags;
u32 table;
int suppress_ifgroup;
int suppress_prefixlen;
u8 action;
/* 3 bytes hole, try to use */
u32 target;
struct fib_rule __rcu *ctarget;
struct net *fr_net;

atomic_t refcnt;
u32 pref;
int suppress_ifgroup;
int suppress_prefixlen;
char iifname[IFNAMSIZ];
char oifname[IFNAMSIZ];
struct rcu_head rcu;
struct net * fr_net;
};

struct fib_lookup_arg {
Expand Down

0 comments on commit fba3679

Please sign in to comment.