@@ -58,7 +58,7 @@ struct inet_frag_bucket {
struct inet_frags {
struct inet_frag_bucket hash[INETFRAGS_HASHSZ];
- rwlock_t lock; /* Rebuild lock */
+// rwlock_t lock; /* Rebuild lock */
u32 rnd;
int qsize;
int secret_interval;
@@ -35,8 +35,11 @@ static void inet_frag_secret_rebuild(unsigned long dummy)
unsigned long now = jiffies;
int i;
+ //HACK don't rebuild
+ return;
+
/* Per bucket lock NOT needed here, due to write lock protection */
- write_lock(&f->lock);
+// write_lock(&f->lock);
get_random_bytes(&f->rnd, sizeof(u32));
for (i = 0; i < INETFRAGS_HASHSZ; i++) {
@@ -59,7 +62,7 @@ static void inet_frag_secret_rebuild(unsigned long dummy)
}
}
}
- write_unlock(&f->lock);
+// write_unlock(&f->lock);
mod_timer(&f->secret_timer, now + f->secret_interval);
}
@@ -74,7 +77,7 @@ void inet_frags_init(struct inet_frags *f)
spin_lock_init(&hb->chain_lock);
INIT_HLIST_HEAD(&hb->chain);
}
- rwlock_init(&f->lock);
+// rwlock_init(&f->lock);
f->rnd = (u32) ((num_physpages ^ (num_physpages>>7)) ^
(jiffies ^ (jiffies >> 6)));
@@ -115,14 +118,14 @@ static inline void fq_unlink(struct inet_frag_queue *fq, struct inet_frags *f)
struct inet_frag_bucket *hb;
unsigned int hash;
- read_lock(&f->lock);
+ //read_lock(&f->lock);
hash = f->hashfn(fq);
hb = &f->hash[hash];
spin_lock_bh(&hb->chain_lock);
hlist_del(&fq->list);
spin_unlock_bh(&hb->chain_lock);
- read_unlock(&f->lock);
+ //read_unlock(&f->lock);
inet_frag_lru_del(fq);
}
@@ -249,7 +252,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,
#endif
unsigned int hash;
- read_lock(&f->lock); /* Protects against hash rebuild */
+ //read_lock(&f->lock); /* Protects against hash rebuild */
/*
* While we stayed w/o the lock other CPU could update
* the rnd seed, so we need to re-calculate the hash
@@ -268,7 +271,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,
if (qp->net == nf && f->match(qp, arg)) {
atomic_inc(&qp->refcnt);
spin_unlock_bh(&hb->chain_lock);
- read_unlock(&f->lock);
+ //read_unlock(&f->lock);
qp_in->last_in |= INET_FRAG_COMPLETE;
inet_frag_put(qp_in, f);
return qp;
@@ -282,7 +285,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,
atomic_inc(&qp->refcnt);
hlist_add_head(&qp->list, &hb->chain);
spin_unlock_bh(&hb->chain_lock);
- read_unlock(&f->lock);
+ //read_unlock(&f->lock);
inet_frag_lru_add(nf, qp);
return qp;
}
@@ -342,12 +345,12 @@ struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
if (q->net == nf && f->match(q, key)) {
atomic_inc(&q->refcnt);
spin_unlock_bh(&hb->chain_lock);
- read_unlock(&f->lock);
+ //read_unlock(&f->lock);
return q;
}
}
spin_unlock_bh(&hb->chain_lock);
- read_unlock(&f->lock);
+ //read_unlock(&f->lock);
return inet_frag_create(nf, f, key);
}
@@ -289,7 +289,7 @@ static inline struct ipq *ip_find(struct net *net, struct iphdr *iph, u32 user)
arg.iph = iph;
arg.user = user;
- read_lock(&ip4_frags.lock);
+ //read_lock(&ip4_frags.lock);
hash = ipqhashfn(iph->id, iph->saddr, iph->daddr, iph->protocol);
q = inet_frag_find(&net->ipv4.frags, &ip4_frags, &arg, hash);
@@ -175,7 +175,7 @@ static inline struct frag_queue *fq_find(struct net *net, __be32 id,
arg.src = src;
arg.dst = dst;
- read_lock_bh(&nf_frags.lock);
+ //read_lock_bh(&nf_frags.lock);
hash = inet6_hash_frag(id, src, dst, nf_frags.rnd);
q = inet_frag_find(&net->nf_frag.frags, &nf_frags, &arg, hash);
@@ -193,7 +193,7 @@ fq_find(struct net *net, __be32 id, const struct in6_addr *src, const struct in6
arg.src = src;
arg.dst = dst;
- read_lock(&ip6_frags.lock);
+ //read_lock(&ip6_frags.lock);
hash = inet6_hash_frag(id, src, dst, ip6_frags.rnd);
q = inet_frag_find(&net->ipv6.frags, &ip6_frags, &arg, hash);