diff options
| author | Florian Westphal <fw@strlen.de> | 2017-04-20 03:54:22 -0400 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-04-26 03:30:22 -0400 |
| commit | 54044b1f0204da158a6a395bd02b63bb02ffff98 (patch) | |
| tree | 253f70f735091ea2e9490f1c93e58d6e05fc0ed3 /include/net | |
| parent | 495dcb56d09ddb63afe30e799af41876c3f061cc (diff) | |
netfilter: conntrack: remove prealloc support
It was used by the nat extension, but since commit
7c9664351980 ("netfilter: move nat hlist_head to nf_conn") its only needed
for connections that use MASQUERADE target or a nat helper.
Also it seems a lot easier to preallocate a fixed size instead.
With default settings, conntrack first adds ecache extension (sysctl
defaults to 1), so we get 40(ct extension header) + 24 (ecache) == 64 byte
on x86_64 for initial allocation.
Followup patches can constify the extension structs and avoid
the initial zeroing of the entire extension area.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/netfilter/nf_conntrack_extend.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 5fc908dc9f32..dd776bf9e2fa 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
| @@ -88,21 +88,15 @@ static inline void nf_ct_ext_free(struct nf_conn *ct) | |||
| 88 | /* Add this type, returns pointer to data or NULL. */ | 88 | /* Add this type, returns pointer to data or NULL. */ |
| 89 | void *nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp); | 89 | void *nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp); |
| 90 | 90 | ||
| 91 | #define NF_CT_EXT_F_PREALLOC 0x0001 | ||
| 92 | |||
| 93 | struct nf_ct_ext_type { | 91 | struct nf_ct_ext_type { |
| 94 | /* Destroys relationships (can be NULL). */ | 92 | /* Destroys relationships (can be NULL). */ |
| 95 | void (*destroy)(struct nf_conn *ct); | 93 | void (*destroy)(struct nf_conn *ct); |
| 96 | 94 | ||
| 97 | enum nf_ct_ext_id id; | 95 | enum nf_ct_ext_id id; |
| 98 | 96 | ||
| 99 | unsigned int flags; | ||
| 100 | |||
| 101 | /* Length and min alignment. */ | 97 | /* Length and min alignment. */ |
| 102 | u8 len; | 98 | u8 len; |
| 103 | u8 align; | 99 | u8 align; |
| 104 | /* initial size of nf_ct_ext. */ | ||
| 105 | u8 alloc_size; | ||
| 106 | }; | 100 | }; |
| 107 | 101 | ||
| 108 | int nf_ct_extend_register(struct nf_ct_ext_type *type); | 102 | int nf_ct_extend_register(struct nf_ct_ext_type *type); |
