]> git.proxmox.com Git - mirror_ovs.git/commitdiff
compat: Properly handle fragment lru.
authorJoe Stringer <joe@ovn.org>
Mon, 1 Aug 2016 20:58:38 +0000 (13:58 -0700)
committerJoe Stringer <joe@ovn.org>
Tue, 2 Aug 2016 01:17:14 +0000 (18:17 -0700)
In kernels <=3.16 there is an LRU for managing fragment queues for IPv4
and IPv6. Because the backport code comes from more recent upstream
versions of Linux, this LRU management was missing from ip_frag_queue()
and nf_ct_frag6_queue().

Fixes: 595e069a0634 ("compat: Backport IPv4 reassembly.")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
acinclude.m4
datapath/linux/compat/include/net/inet_frag.h
datapath/linux/compat/ip_fragment.c
datapath/linux/compat/nf_conntrack_reasm.c

index 7a714b2cb624e929f4b14ba1febccbd480d4d35e..49f0781bf184589bb3b6b1a8b1d2fd011270406e 100644 (file)
@@ -435,6 +435,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
                         [rwlock])
   OVS_FIND_FIELD_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frag_queue],
                         [list_evictor])
+  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frag_lru_move])
   OVS_GREP_IFELSE([$KSRC/include/net/inetpeer.h], [vif],
                   [OVS_DEFINE([HAVE_INETPEER_VIF_SUPPORT])])
 
index 332b1a6db950a5fd37c6d4dadc3bdd5cd3325ba9..c37bc845896e925444fd19f5be5818473b5fe932 100644 (file)
@@ -23,6 +23,12 @@ static inline bool inet_frag_evicting(struct inet_frag_queue *q)
 }
 #endif /* HAVE_INET_FRAG_EVICTING */
 
+/* Upstream commit 3fd588eb90bf ("inet: frag: remove lru list") dropped this
+ * function, but we call it from our compat code. Provide a noop version. */
+#ifndef HAVE_INET_FRAG_LRU_MOVE
+#define inet_frag_lru_move(q)
+#endif
+
 #ifndef HAVE_CORRECT_MRU_HANDLING
 static inline void rpl_sub_frag_mem_limit(struct netns_frags *nf, int i)
 {
index e707c607fb306a7b94b15dd86960a7c4ac3867f7..b0f5d0e4c411555dfd100d91fdba15d167a72a46 100644 (file)
@@ -552,6 +552,7 @@ found:
        }
 
        skb_dst_drop(skb);
+       inet_frag_lru_move(&qp->q);
        return -EINPROGRESS;
 
 err:
index a66d00f8065e4fd30b3864b0d2732e105dcfba36..e633443d16e08e2aa69237e86430e522ca4ec2a1 100644 (file)
@@ -285,6 +285,7 @@ found:
                qp_flags(fq) |= INET_FRAG_FIRST_IN;
        }
 
+       inet_frag_lru_move(&fq->q);
        return 0;
 
 discard_fq: