Skip to content

Commit 3fde94b

Browse files
Florian Westphalummakynes
authored andcommitted
netfilter: flowtable: reorder nf_flowtable struct members
Place the read-mostly parts accessed by the datapath first. In particular, we do access ->flags member (to see if HW offload is enabled) for every single packet, but this is placed in the 5th cacheline. priority could stay where it is, but move it too to cover a hole. Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent ffb40fb commit 3fde94b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

include/net/netfilter/nf_flow_table.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ enum nf_flowtable_flags {
7474
};
7575

7676
struct nf_flowtable {
77-
struct list_head list;
78-
struct rhashtable rhashtable;
79-
int priority;
77+
unsigned int flags; /* readonly in datapath */
78+
int priority; /* control path (padding hole) */
79+
struct rhashtable rhashtable; /* datapath, read-mostly members come first */
80+
81+
struct list_head list; /* slowpath parts */
8082
const struct nf_flowtable_type *type;
8183
struct delayed_work gc_work;
82-
unsigned int flags;
8384
struct flow_block flow_block;
8485
struct rw_semaphore flow_block_lock; /* Guards flow_block */
8586
possible_net_t net;

0 commit comments

Comments
 (0)