[ovs-dev] datapath: Apply bug fixes of nf_conncount for different kernel versions
diff mbox series

Message ID 1565136365-28646-1-git-send-email-pkusunyifeng@gmail.com
State New
Headers show
  • [ovs-dev] datapath: Apply bug fixes of nf_conncount for different kernel versions
Related show

Commit Message

Yifeng Sun Aug. 7, 2019, 12:06 a.m. UTC
In upstream kernel, there are several critical bug fixes for nf_conncount
between 5c789e1 ("netfilter: nf_conncount: Add list lock and gc worker,
and RCU for init tree search") and c78e781 ("netfilter: nf_conncount:
replace CONNCOUNT_LOCK_SLOTS with CONNCOUNT_SLOTS"). This fixes are
already backported to OVS datapath.

This patch helps OVS datapath to always choose bug-fixed nf_conncount code.
If kernel already has these fixes, then kernel's nf_conncount is being used.
Otherwise, OVS falls back to use compat nf_conncount functions.

This patch is suggested by YiHung Wei.

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
 acinclude.m4 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff mbox series

diff --git a/acinclude.m4 b/acinclude.m4
index f8e856d3303f..f0e38898b17a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -713,7 +713,9 @@  AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_nat.h], [nf_nat_range2])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_seqadj.h], [nf_ct_seq_adjust])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_count.h], [nf_conncount_gc_list],
+                  [OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_count.h],
+                                   [int nf_conncount_add],
+                                   [], [OVS_DEFINE([HAVE_UPSTREAM_NF_CONNCOUNT])])])
   OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32])
   OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32_max])