inet: frag: remove lru list
[deliverable/linux.git] / net / ipv4 / ip_fragment.c
index 586e6aaf9e6e46afd6fa9c345fe17d747b1aa16e..8fbeee49503784546c7bd640198c7342734a47d2 100644 (file)
@@ -86,11 +86,6 @@ static inline u8 ip4_frag_ecn(u8 tos)
 
 static struct inet_frags ip4_frags;
 
-int ip_frag_nqueues(struct net *net)
-{
-       return net->ipv4.frags.nqueues;
-}
-
 int ip_frag_mem(struct net *net)
 {
        return sum_frag_mem_limit(&net->ipv4.frags);
@@ -109,7 +104,7 @@ static unsigned int ipqhashfn(__be16 id, __be32 saddr, __be32 daddr, u8 prot)
        net_get_random_once(&ip4_frags.rnd, sizeof(ip4_frags.rnd));
        return jhash_3words((__force u32)id << 16 | prot,
                            (__force u32)saddr, (__force u32)daddr,
-                           ip4_frags.rnd) & (INETFRAGS_HASHSZ - 1);
+                           ip4_frags.rnd);
 }
 
 static unsigned int ip4_hashfn(const struct inet_frag_queue *q)
@@ -177,18 +172,6 @@ static void ipq_kill(struct ipq *ipq)
        inet_frag_kill(&ipq->q, &ip4_frags);
 }
 
-/* Memory limiting on fragments.  Evictor trashes the oldest
- * fragment queue until we are back under the threshold.
- */
-static void ip_evictor(struct net *net)
-{
-       int evicted;
-
-       evicted = inet_frag_evictor(&net->ipv4.frags, &ip4_frags, false);
-       if (evicted)
-               IP_ADD_STATS_BH(net, IPSTATS_MIB_REASMFAILS, evicted);
-}
-
 /*
  * Oops, a fragment queue timed out.  Kill it and send an ICMP reply.
  */
@@ -207,7 +190,8 @@ static void ip_expire(unsigned long arg)
 
        ipq_kill(qp);
 
-       IP_INC_STATS_BH(net, IPSTATS_MIB_REASMTIMEOUT);
+       if (!(qp->q.last_in & INET_FRAG_EVICTED))
+               IP_INC_STATS_BH(net, IPSTATS_MIB_REASMTIMEOUT);
        IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS);
 
        if ((qp->q.last_in & INET_FRAG_FIRST_IN) && qp->q.fragments != NULL) {
@@ -505,7 +489,6 @@ found:
        }
 
        skb_dst_drop(skb);
-       inet_frag_lru_move(&qp->q);
        return -EINPROGRESS;
 
 err:
@@ -655,9 +638,6 @@ int ip_defrag(struct sk_buff *skb, u32 user)
        net = skb->dev ? dev_net(skb->dev) : dev_net(skb_dst(skb)->dev);
        IP_INC_STATS_BH(net, IPSTATS_MIB_REASMREQDS);
 
-       /* Start by cleaning up the memory. */
-       ip_evictor(net);
-
        /* Lookup (or create) queue header */
        if ((qp = ip_find(net, ip_hdr(skb), user)) != NULL) {
                int ret;
This page took 0.025361 seconds and 5 git commands to generate.