diff options
author | Florian Westphal <fw@strlen.de> | 2014-07-24 10:50:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-28 01:34:36 -0400 |
commit | 3fd588eb90bfbba17091381006ecafe29c45db4a (patch) | |
tree | bd13a7188e37d038ef4a6283a8ef594e59ad25ee | |
parent | 434d305405ab86414f6ea3f261307d443a2c3506 (diff) |
inet: frag: remove lru list
no longer used.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/inet_frag.h | 32 | ||||
-rw-r--r-- | net/ieee802154/reassembly.c | 1 | ||||
-rw-r--r-- | net/ipv4/inet_fragment.c | 12 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 1 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_reasm.c | 1 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 1 |
6 files changed, 4 insertions, 44 deletions
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 68de33765705..90d21ea62c59 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -4,9 +4,6 @@ | |||
4 | #include <linux/percpu_counter.h> | 4 | #include <linux/percpu_counter.h> |
5 | 5 | ||
6 | struct netns_frags { | 6 | struct netns_frags { |
7 | struct list_head lru_list; | ||
8 | spinlock_t lru_lock; | ||
9 | |||
10 | /* The percpu_counter "mem" need to be cacheline aligned. | 7 | /* The percpu_counter "mem" need to be cacheline aligned. |
11 | * mem.count must not share cacheline with other writers | 8 | * mem.count must not share cacheline with other writers |
12 | */ | 9 | */ |
@@ -21,7 +18,6 @@ struct netns_frags { | |||
21 | struct inet_frag_queue { | 18 | struct inet_frag_queue { |
22 | spinlock_t lock; | 19 | spinlock_t lock; |
23 | struct timer_list timer; /* when will this queue expire? */ | 20 | struct timer_list timer; /* when will this queue expire? */ |
24 | struct list_head lru_list; /* lru list member */ | ||
25 | struct hlist_node list; | 21 | struct hlist_node list; |
26 | atomic_t refcnt; | 22 | atomic_t refcnt; |
27 | struct sk_buff *fragments; /* list of received fragments */ | 23 | struct sk_buff *fragments; /* list of received fragments */ |
@@ -91,8 +87,7 @@ void inet_frags_init_net(struct netns_frags *nf); | |||
91 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f); | 87 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f); |
92 | 88 | ||
93 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); | 89 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); |
94 | void inet_frag_destroy(struct inet_frag_queue *q, | 90 | void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f); |
95 | struct inet_frags *f, int *work); | ||
96 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, | 91 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, |
97 | struct inet_frags *f, void *key, unsigned int hash) | 92 | struct inet_frags *f, void *key, unsigned int hash) |
98 | __releases(&f->lock); | 93 | __releases(&f->lock); |
@@ -102,7 +97,7 @@ void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, | |||
102 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) | 97 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) |
103 | { | 98 | { |
104 | if (atomic_dec_and_test(&q->refcnt)) | 99 | if (atomic_dec_and_test(&q->refcnt)) |
105 | inet_frag_destroy(q, f, NULL); | 100 | inet_frag_destroy(q, f); |
106 | } | 101 | } |
107 | 102 | ||
108 | /* Memory Tracking Functions. */ | 103 | /* Memory Tracking Functions. */ |
@@ -145,29 +140,6 @@ static inline unsigned int sum_frag_mem_limit(struct netns_frags *nf) | |||
145 | return res; | 140 | return res; |
146 | } | 141 | } |
147 | 142 | ||
148 | static inline void inet_frag_lru_move(struct inet_frag_queue *q) | ||
149 | { | ||
150 | spin_lock(&q->net->lru_lock); | ||
151 | if (!list_empty(&q->lru_list)) | ||
152 | list_move_tail(&q->lru_list, &q->net->lru_list); | ||
153 | spin_unlock(&q->net->lru_lock); | ||
154 | } | ||
155 | |||
156 | static inline void inet_frag_lru_del(struct inet_frag_queue *q) | ||
157 | { | ||
158 | spin_lock(&q->net->lru_lock); | ||
159 | list_del_init(&q->lru_list); | ||
160 | spin_unlock(&q->net->lru_lock); | ||
161 | } | ||
162 | |||
163 | static inline void inet_frag_lru_add(struct netns_frags *nf, | ||
164 | struct inet_frag_queue *q) | ||
165 | { | ||
166 | spin_lock(&nf->lru_lock); | ||
167 | list_add_tail(&q->lru_list, &nf->lru_list); | ||
168 | spin_unlock(&nf->lru_lock); | ||
169 | } | ||
170 | |||
171 | /* RFC 3168 support : | 143 | /* RFC 3168 support : |
172 | * We want to check ECN values of all fragments, do detect invalid combinations. | 144 | * We want to check ECN values of all fragments, do detect invalid combinations. |
173 | * In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value. | 145 | * In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value. |
diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c index 9503a48556f7..b4bc7a50eccf 100644 --- a/net/ieee802154/reassembly.c +++ b/net/ieee802154/reassembly.c | |||
@@ -219,7 +219,6 @@ found: | |||
219 | return res; | 219 | return res; |
220 | } | 220 | } |
221 | 221 | ||
222 | inet_frag_lru_move(&fq->q); | ||
223 | return -1; | 222 | return -1; |
224 | err: | 223 | err: |
225 | kfree_skb(skb); | 224 | kfree_skb(skb); |
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 231ca0b40811..198a5ed7a815 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c | |||
@@ -194,8 +194,6 @@ EXPORT_SYMBOL(inet_frags_init); | |||
194 | void inet_frags_init_net(struct netns_frags *nf) | 194 | void inet_frags_init_net(struct netns_frags *nf) |
195 | { | 195 | { |
196 | init_frag_mem_limit(nf); | 196 | init_frag_mem_limit(nf); |
197 | INIT_LIST_HEAD(&nf->lru_list); | ||
198 | spin_lock_init(&nf->lru_lock); | ||
199 | } | 197 | } |
200 | EXPORT_SYMBOL(inet_frags_init_net); | 198 | EXPORT_SYMBOL(inet_frags_init_net); |
201 | 199 | ||
@@ -237,7 +235,6 @@ static inline void fq_unlink(struct inet_frag_queue *fq, struct inet_frags *f) | |||
237 | spin_unlock(&hb->chain_lock); | 235 | spin_unlock(&hb->chain_lock); |
238 | 236 | ||
239 | read_unlock(&f->lock); | 237 | read_unlock(&f->lock); |
240 | inet_frag_lru_del(fq); | ||
241 | } | 238 | } |
242 | 239 | ||
243 | void inet_frag_kill(struct inet_frag_queue *fq, struct inet_frags *f) | 240 | void inet_frag_kill(struct inet_frag_queue *fq, struct inet_frags *f) |
@@ -261,8 +258,7 @@ static inline void frag_kfree_skb(struct netns_frags *nf, struct inet_frags *f, | |||
261 | kfree_skb(skb); | 258 | kfree_skb(skb); |
262 | } | 259 | } |
263 | 260 | ||
264 | void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f, | 261 | void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f) |
265 | int *work) | ||
266 | { | 262 | { |
267 | struct sk_buff *fp; | 263 | struct sk_buff *fp; |
268 | struct netns_frags *nf; | 264 | struct netns_frags *nf; |
@@ -282,14 +278,11 @@ void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f, | |||
282 | fp = xp; | 278 | fp = xp; |
283 | } | 279 | } |
284 | sum = sum_truesize + f->qsize; | 280 | sum = sum_truesize + f->qsize; |
285 | if (work) | ||
286 | *work -= sum; | ||
287 | sub_frag_mem_limit(q, sum); | 281 | sub_frag_mem_limit(q, sum); |
288 | 282 | ||
289 | if (f->destructor) | 283 | if (f->destructor) |
290 | f->destructor(q); | 284 | f->destructor(q); |
291 | kfree(q); | 285 | kfree(q); |
292 | |||
293 | } | 286 | } |
294 | EXPORT_SYMBOL(inet_frag_destroy); | 287 | EXPORT_SYMBOL(inet_frag_destroy); |
295 | 288 | ||
@@ -333,7 +326,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf, | |||
333 | 326 | ||
334 | atomic_inc(&qp->refcnt); | 327 | atomic_inc(&qp->refcnt); |
335 | hlist_add_head(&qp->list, &hb->chain); | 328 | hlist_add_head(&qp->list, &hb->chain); |
336 | inet_frag_lru_add(nf, qp); | 329 | |
337 | spin_unlock(&hb->chain_lock); | 330 | spin_unlock(&hb->chain_lock); |
338 | read_unlock(&f->lock); | 331 | read_unlock(&f->lock); |
339 | 332 | ||
@@ -361,7 +354,6 @@ static struct inet_frag_queue *inet_frag_alloc(struct netns_frags *nf, | |||
361 | setup_timer(&q->timer, f->frag_expire, (unsigned long)q); | 354 | setup_timer(&q->timer, f->frag_expire, (unsigned long)q); |
362 | spin_lock_init(&q->lock); | 355 | spin_lock_init(&q->lock); |
363 | atomic_set(&q->refcnt, 1); | 356 | atomic_set(&q->refcnt, 1); |
364 | INIT_LIST_HEAD(&q->lru_list); | ||
365 | 357 | ||
366 | return q; | 358 | return q; |
367 | } | 359 | } |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 1f42c2e3966b..8fbeee495037 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -489,7 +489,6 @@ found: | |||
489 | } | 489 | } |
490 | 490 | ||
491 | skb_dst_drop(skb); | 491 | skb_dst_drop(skb); |
492 | inet_frag_lru_move(&qp->q); | ||
493 | return -EINPROGRESS; | 492 | return -EINPROGRESS; |
494 | 493 | ||
495 | err: | 494 | err: |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 58e32cf91c95..fb0f72a0ff31 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -349,7 +349,6 @@ found: | |||
349 | fq->q.last_in |= INET_FRAG_FIRST_IN; | 349 | fq->q.last_in |= INET_FRAG_FIRST_IN; |
350 | } | 350 | } |
351 | 351 | ||
352 | inet_frag_lru_move(&fq->q); | ||
353 | return 0; | 352 | return 0; |
354 | 353 | ||
355 | discard_fq: | 354 | discard_fq: |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index b3924b10dff3..af85551682c2 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -351,7 +351,6 @@ found: | |||
351 | } | 351 | } |
352 | 352 | ||
353 | skb_dst_drop(skb); | 353 | skb_dst_drop(skb); |
354 | inet_frag_lru_move(&fq->q); | ||
355 | return -1; | 354 | return -1; |
356 | 355 | ||
357 | discard_fq: | 356 | discard_fq: |