Skip to content

Commit 3fd588e

Browse files
Florian Westphaldavem330
authored andcommitted
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>
1 parent 434d305 commit 3fd588e

6 files changed

Lines changed: 4 additions & 44 deletions

File tree

‎include/net/inet_frag.h‎

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#include <linux/percpu_counter.h>
55

66
struct netns_frags {
7-
struct list_head lru_list;
8-
spinlock_t lru_lock;
9-
107
/* The percpu_counter "mem" need to be cacheline aligned.
118
* mem.count must not share cacheline with other writers
129
*/
@@ -21,7 +18,6 @@ struct netns_frags {
2118
struct inet_frag_queue {
2219
spinlock_t lock;
2320
struct timer_list timer; /* when will this queue expire? */
24-
struct list_head lru_list; /* lru list member */
2521
struct hlist_node list;
2622
atomic_t refcnt;
2723
struct sk_buff *fragments; /* list of received fragments */
@@ -91,8 +87,7 @@ void inet_frags_init_net(struct netns_frags *nf);
9187
void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f);
9288

9389
void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f);
94-
void inet_frag_destroy(struct inet_frag_queue *q,
95-
struct inet_frags *f, int *work);
90+
void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f);
9691
struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
9792
struct inet_frags *f, void *key, unsigned int hash)
9893
__releases(&f->lock);
@@ -102,7 +97,7 @@ void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q,
10297
static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)
10398
{
10499
if (atomic_dec_and_test(&q->refcnt))
105-
inet_frag_destroy(q, f, NULL);
100+
inet_frag_destroy(q, f);
106101
}
107102

108103
/* Memory Tracking Functions. */
@@ -145,29 +140,6 @@ static inline unsigned int sum_frag_mem_limit(struct netns_frags *nf)
145140
return res;
146141
}
147142

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-
171143
/* RFC 3168 support :
172144
* We want to check ECN values of all fragments, do detect invalid combinations.
173145
* In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value.

‎net/ieee802154/reassembly.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ static int lowpan_frag_queue(struct lowpan_frag_queue *fq,
219219
return res;
220220
}
221221

222-
inet_frag_lru_move(&fq->q);
223222
return -1;
224223
err:
225224
kfree_skb(skb);

‎net/ipv4/inet_fragment.c‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ EXPORT_SYMBOL(inet_frags_init);
194194
void inet_frags_init_net(struct netns_frags *nf)
195195
{
196196
init_frag_mem_limit(nf);
197-
INIT_LIST_HEAD(&nf->lru_list);
198-
spin_lock_init(&nf->lru_lock);
199197
}
200198
EXPORT_SYMBOL(inet_frags_init_net);
201199

@@ -237,7 +235,6 @@ static inline void fq_unlink(struct inet_frag_queue *fq, struct inet_frags *f)
237235
spin_unlock(&hb->chain_lock);
238236

239237
read_unlock(&f->lock);
240-
inet_frag_lru_del(fq);
241238
}
242239

243240
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,
261258
kfree_skb(skb);
262259
}
263260

264-
void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f,
265-
int *work)
261+
void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f)
266262
{
267263
struct sk_buff *fp;
268264
struct netns_frags *nf;
@@ -282,14 +278,11 @@ void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f,
282278
fp = xp;
283279
}
284280
sum = sum_truesize + f->qsize;
285-
if (work)
286-
*work -= sum;
287281
sub_frag_mem_limit(q, sum);
288282

289283
if (f->destructor)
290284
f->destructor(q);
291285
kfree(q);
292-
293286
}
294287
EXPORT_SYMBOL(inet_frag_destroy);
295288

@@ -333,7 +326,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,
333326

334327
atomic_inc(&qp->refcnt);
335328
hlist_add_head(&qp->list, &hb->chain);
336-
inet_frag_lru_add(nf, qp);
329+
337330
spin_unlock(&hb->chain_lock);
338331
read_unlock(&f->lock);
339332

@@ -361,7 +354,6 @@ static struct inet_frag_queue *inet_frag_alloc(struct netns_frags *nf,
361354
setup_timer(&q->timer, f->frag_expire, (unsigned long)q);
362355
spin_lock_init(&q->lock);
363356
atomic_set(&q->refcnt, 1);
364-
INIT_LIST_HEAD(&q->lru_list);
365357

366358
return q;
367359
}

‎net/ipv4/ip_fragment.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
489489
}
490490

491491
skb_dst_drop(skb);
492-
inet_frag_lru_move(&qp->q);
493492
return -EINPROGRESS;
494493

495494
err:

‎net/ipv6/netfilter/nf_conntrack_reasm.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb,
349349
fq->q.last_in |= INET_FRAG_FIRST_IN;
350350
}
351351

352-
inet_frag_lru_move(&fq->q);
353352
return 0;
354353

355354
discard_fq:

‎net/ipv6/reassembly.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
351351
}
352352

353353
skb_dst_drop(skb);
354-
inet_frag_lru_move(&fq->q);
355354
return -1;
356355

357356
discard_fq:

0 commit comments

Comments
 (0)