diff options
Diffstat (limited to 'include/net/inet_frag.h')
-rw-r--r-- | include/net/inet_frag.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 954def408975..7374251b9787 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -1,8 +1,20 @@ | |||
1 | #ifndef __NET_FRAG_H__ | 1 | #ifndef __NET_FRAG_H__ |
2 | #define __NET_FRAG_H__ | 2 | #define __NET_FRAG_H__ |
3 | 3 | ||
4 | struct netns_frags { | ||
5 | int nqueues; | ||
6 | atomic_t mem; | ||
7 | struct list_head lru_list; | ||
8 | |||
9 | /* sysctls */ | ||
10 | int timeout; | ||
11 | int high_thresh; | ||
12 | int low_thresh; | ||
13 | }; | ||
14 | |||
4 | struct inet_frag_queue { | 15 | struct inet_frag_queue { |
5 | struct hlist_node list; | 16 | struct hlist_node list; |
17 | struct netns_frags *net; | ||
6 | struct list_head lru_list; /* lru list member */ | 18 | struct list_head lru_list; /* lru list member */ |
7 | spinlock_t lock; | 19 | spinlock_t lock; |
8 | atomic_t refcnt; | 20 | atomic_t refcnt; |
@@ -20,23 +32,13 @@ struct inet_frag_queue { | |||
20 | 32 | ||
21 | #define INETFRAGS_HASHSZ 64 | 33 | #define INETFRAGS_HASHSZ 64 |
22 | 34 | ||
23 | struct inet_frags_ctl { | ||
24 | int high_thresh; | ||
25 | int low_thresh; | ||
26 | int timeout; | ||
27 | int secret_interval; | ||
28 | }; | ||
29 | |||
30 | struct inet_frags { | 35 | struct inet_frags { |
31 | struct list_head lru_list; | ||
32 | struct hlist_head hash[INETFRAGS_HASHSZ]; | 36 | struct hlist_head hash[INETFRAGS_HASHSZ]; |
33 | rwlock_t lock; | 37 | rwlock_t lock; |
34 | u32 rnd; | 38 | u32 rnd; |
35 | int nqueues; | ||
36 | int qsize; | 39 | int qsize; |
37 | atomic_t mem; | 40 | int secret_interval; |
38 | struct timer_list secret_timer; | 41 | struct timer_list secret_timer; |
39 | struct inet_frags_ctl *ctl; | ||
40 | 42 | ||
41 | unsigned int (*hashfn)(struct inet_frag_queue *); | 43 | unsigned int (*hashfn)(struct inet_frag_queue *); |
42 | void (*constructor)(struct inet_frag_queue *q, | 44 | void (*constructor)(struct inet_frag_queue *q, |
@@ -51,12 +53,15 @@ struct inet_frags { | |||
51 | void inet_frags_init(struct inet_frags *); | 53 | void inet_frags_init(struct inet_frags *); |
52 | void inet_frags_fini(struct inet_frags *); | 54 | void inet_frags_fini(struct inet_frags *); |
53 | 55 | ||
56 | void inet_frags_init_net(struct netns_frags *nf); | ||
57 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f); | ||
58 | |||
54 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); | 59 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); |
55 | void inet_frag_destroy(struct inet_frag_queue *q, | 60 | void inet_frag_destroy(struct inet_frag_queue *q, |
56 | struct inet_frags *f, int *work); | 61 | struct inet_frags *f, int *work); |
57 | int inet_frag_evictor(struct inet_frags *f); | 62 | int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f); |
58 | struct inet_frag_queue *inet_frag_find(struct inet_frags *f, void *key, | 63 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, |
59 | unsigned int hash); | 64 | struct inet_frags *f, void *key, unsigned int hash); |
60 | 65 | ||
61 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) | 66 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) |
62 | { | 67 | { |