From patchwork Wed Aug 7 00:06:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1143073 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jPv+xER+"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 463Bcg6Ltnz9sBF for ; Wed, 7 Aug 2019 10:06:27 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E1979D93; Wed, 7 Aug 2019 00:06:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 60418D7A for ; Wed, 7 Aug 2019 00:06:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1E05F7D2 for ; Wed, 7 Aug 2019 00:06:10 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id y15so42404385pfn.5 for ; Tue, 06 Aug 2019 17:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=++a7z44GpUDjD7gDGBIEqO1j4hxRa35cXCfeR9LNEoA=; b=jPv+xER+NpkMwmKhkfdsXAjjFE/2VZMIPf/7GtcDjaUJwAN7XxSeBB2G6El+RUD8Cq eTtDCXdgHhbCFEti03S9YybGq/NGjgXhwVDLWnI3o7m+XSLUvTlry3E4k+OMO4pEgk1y sj5hV3F+jyOpdvoy3rtif3MYdzNEKyVNkE/eV34edPpQ3zEs/J1j/XS8UkiON30Jd21i 31YTw905eYCGBfqwkQuIHzBDoPJ3EJ1prIDDZ9XMUfRTtf84gthmY3u2l3JSutx2Fj57 SEhvkeVUbSuOkzArA37pdUDVDQqGGCrRh3slixG8tjrfiBUHmRcl+fJa3Dd7fhuUMJbj tXwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=++a7z44GpUDjD7gDGBIEqO1j4hxRa35cXCfeR9LNEoA=; b=MDq3WMMm+aFhsiisERSw12+fZwnljTcZF7hku90QCbykzLq5OkS3dulb7vgbeRW6fg rPB5qwucWlvybg5Es6RsGpZWyrPfdfo0StqPnBXVDcvk492eR78mKfb0IzjaEru3XvOM O9W28SgcTW2f6+Q15jbY7qUDiZGIZXb/KisW5m0MlHUUdxF5qq/pDFAV0fYWZkBwx/Gg 1q9MEkOS1KOFwLD6Vj+yaeay+punAFZecjicNnAx3wCmdIrKplBxY54kD7Bfw5LSL1Oj aWKj2EAQjs7h+TQGtLSnsig/AHTYkkWxMpSfK/p07RhkzU1sJ0FyeV7aE+b/Dp2DSvhY CR6A== X-Gm-Message-State: APjAAAXQckKyC6EzqTIui6q2DzbI9g4ZDUFmPBsVWvn/S0uCz45g1ewu nWBFmwSfFtIPQMSAI/ZR6EQNlr8L8sY= X-Google-Smtp-Source: APXvYqyEY1+AIxktgEH0BJlvbgFywOMnavTHKKxT+cyD2NBvCf4XTAUXRK90VzqSd9uWejA81+tsMA== X-Received: by 2002:a63:e148:: with SMTP id h8mr5268059pgk.275.1565136369503; Tue, 06 Aug 2019 17:06:09 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id f197sm87506035pfa.161.2019.08.06.17.06.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Aug 2019 17:06:09 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Tue, 6 Aug 2019 17:06:05 -0700 Message-Id: <1565136365-28646-1-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] datapath: Apply bug fixes of nf_conncount for different kernel versions X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 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 --- acinclude.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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_DEFINE([HAVE_UPSTREAM_NF_CONNCOUNT])]) + [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])