aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_frag.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-01-30 19:25:51 -0500
committerPaul Mackerras <paulus@samba.org>2008-01-30 19:25:51 -0500
commitbd45ac0c5daae35e7c71138172e63df5cf644cf6 (patch)
tree5eb5a599bf6a9d7a8a34e802db932aa9e9555de4 /include/net/inet_frag.h
parent4eece4ccf997c0e6d8fdad3d842e37b16b8d705f (diff)
parent5bdeae46be6dfe9efa44a548bd622af325f4bdb4 (diff)
Merge branch 'linux-2.6'
Diffstat (limited to 'include/net/inet_frag.h')
-rw-r--r--include/net/inet_frag.h33
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
4struct 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
4struct inet_frag_queue { 15struct 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
23struct inet_frags_ctl {
24 int high_thresh;
25 int low_thresh;
26 int timeout;
27 int secret_interval;
28};
29
30struct inet_frags { 35struct 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 {
51void inet_frags_init(struct inet_frags *); 53void inet_frags_init(struct inet_frags *);
52void inet_frags_fini(struct inet_frags *); 54void inet_frags_fini(struct inet_frags *);
53 55
56void inet_frags_init_net(struct netns_frags *nf);
57void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f);
58
54void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); 59void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f);
55void inet_frag_destroy(struct inet_frag_queue *q, 60void inet_frag_destroy(struct inet_frag_queue *q,
56 struct inet_frags *f, int *work); 61 struct inet_frags *f, int *work);
57int inet_frag_evictor(struct inet_frags *f); 62int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f);
58struct inet_frag_queue *inet_frag_find(struct inet_frags *f, void *key, 63struct 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
61static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) 66static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)
62{ 67{