From patchwork Fri May 10 19:30:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1098303 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="Rc8qfE3T"; 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 4510gM5RV8z9s3q for ; Sat, 11 May 2019 05:30:55 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 405A7E5D; Fri, 10 May 2019 19:30:24 +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 E4216504 for ; Fri, 10 May 2019 19:30:21 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9B1FD709 for ; Fri, 10 May 2019 19:30:21 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id c6so3722296pfa.10 for ; Fri, 10 May 2019 12:30:21 -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:in-reply-to:references; bh=mWmi6sKz2fqu7iru1d/ryRK/JCeMEYZ+Y8f5MkNql4k=; b=Rc8qfE3T/G6gcdpx947gEZlAvflYOH9BRGYhStZpVdxciie9ctRoFECZEBbUxG/dHp dqErGetBtSxoDPlwKLo+RJsqKsLE2OCoilv8loRTaiyKVyfxtFAxYbkfoGQK6PhXvbFP +h2z/w0kYseVIK8atYC51R09eM61oPXF1++uvkXB26O8MjZpfr5ImT4kxfin8Yxugwd8 /N7nqp/5pgkFUHlBVZwAzJE9MJXpux7WDlIhx18In7KSOZzBjDby7InRl0I4llKaUsUc AJupUw+De5Cprvxn6QFERW2lYHj3eL75LEG7bWuUAIlnnHHdRRfdkuK3lausThThxZOr kmAw== 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:in-reply-to :references; bh=mWmi6sKz2fqu7iru1d/ryRK/JCeMEYZ+Y8f5MkNql4k=; b=BBa181RfJsyKqSBnuouop1x4XhTKPeT/wP0KlKqHVcHgTVtVCdJKOwHYw/yiAcrwmA Uuz0K9zKeNJcOCb4ws0vjfdCTcp1e7J54TYwu8+FTwPUMdkSH6NumNBCf3rAdov4J0t1 ozw9WtfLcTL2KPdsPCTXfw7IbV3u9UwsA1KMRyPeR4DknmmAZrZyaP3lNhh7rambfqCk JEo9fMdMCAkeDVG8xzyi1VrfZd890A8mRw4dCSFqVMM/9lg1zq25uuMVVpUcK1Ajsaa0 cGdwOwGj0JLp6UBMDgd7e/rvkqQ3hrExlVeZ1YQMobFdM/XpCFNfADlIJooyTGgcxDiT C6qQ== X-Gm-Message-State: APjAAAWAfdpvp/ikfGYHtSk9iVIQiwZ75TheqySGUnl3XtFknq1d62pu z4TkTbib1ZCx9VT3hwZtOSdZ9ah6 X-Google-Smtp-Source: APXvYqyrBAOWGwtYWVxNR6vSJgwn2+VPfEHAnMxZUf6Z6BLZFLSO2DmMkAq9ThqBW0dU+0wQljoMCQ== X-Received: by 2002:a63:494f:: with SMTP id y15mr1263276pgk.56.1557516620979; Fri, 10 May 2019 12:30:20 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id h13sm6423301pgk.55.2019.05.10.12.30.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 12:30:20 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Fri, 10 May 2019 12:30:08 -0700 Message-Id: <1557516614-12563-2-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> References: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> 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 1/7 v3] datapath: Handle removal of nf_conntrack_l3proto.h 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 Upstream kernel commit a0ae2562 ("netfilter: conntrack: remove l3proto abstraction") removed header file net/netfilter/nf_conntrack_l3proto.h. This patch detects it and fixes compilation errors of OVS on 4.19+ kernels. Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- acinclude.m4 | 3 +++ datapath/linux/compat/nf_conntrack_proto.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index b532a4579266..c9b744db0b94 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -926,6 +926,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_DEFINE([HAVE_KVMALLOC_ARRAY])]) OVS_GREP_IFELSE([$KSRC/include/linux/mm.h], [kvmalloc_node], [OVS_DEFINE([HAVE_KVMALLOC_NODE])]) + OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_l3proto.h], + [nf_conntrack_l3proto], + [OVS_DEFINE([HAVE_NF_CONNTRACK_L3PROATO_H])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/datapath/linux/compat/nf_conntrack_proto.c b/datapath/linux/compat/nf_conntrack_proto.c index 4ac66f61c70d..fe291dbf25e1 100644 --- a/datapath/linux/compat/nf_conntrack_proto.c +++ b/datapath/linux/compat/nf_conntrack_proto.c @@ -1,7 +1,9 @@ #include #include +#ifdef HAVE_NF_CONNTRACK_L3PROATO_H #include +#endif /* * Upstream net-next commmit 7e35ec0e8044 From patchwork Fri May 10 19:30:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1098304 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="JWTviTXc"; 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 4510h10Xg4z9s3q for ; Sat, 11 May 2019 05:31:28 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E9FA2E95; Fri, 10 May 2019 19:30:25 +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 350D4DDD for ; Fri, 10 May 2019 19:30:23 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A82C01FB for ; Fri, 10 May 2019 19:30:22 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id c13so3486722pgt.1 for ; Fri, 10 May 2019 12:30:22 -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:in-reply-to:references; bh=cuXVwUhKvTw3Cchv4wXGnrd68nsoAsJNDrgSz+2tjSo=; b=JWTviTXcF5ZsQ0E5YWC/Clwu3VhM4+PunI37uCax5SiRrr7swA7juCoMNaZqtwq7bx y6cwG/65HCnRYkTThWFZAPNOKejrCdbov/SFKAvvGFsIKlTN6QoiAqnJqlfsHdWVP4GS idbPKUyi3d/K3B3MEi3KwrQBowrQkXvecqVVLJloXS8Efni4Yrjh7G1J9jT7+G9oDF/W OyoVv7r2NkUiZhU7+tpF4eoYssWHOFqsY1SRwauzETzagRBuB/YcLtGXtolOMVzFZ2ZX rATUPyJ72GbKDjq4n7qCKWCEOUodf0uXGmLyTh3TTxB0pLSnD7SIYBKYfvb/hhMQKEDB +p0g== 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:in-reply-to :references; bh=cuXVwUhKvTw3Cchv4wXGnrd68nsoAsJNDrgSz+2tjSo=; b=d56P/dmZiOz8dprARqol/yFfD3wOjJBy+Zh1YpHV2wgi55z1/afoNlerskMOT3mJPs 0s7l0YSGE0WywIKXEqTiB3LJElVqF6E3g//UDPoYPOVsn6mS3u9yuOKSB1mof8MpeR7H vsOY+kbqCgxWClVAFMlAOSTFfuvVpUe+93KznotejHkbmbYxnpv+SOZpq0JwERkt59uq nKYK4GK0r9DVrRm7HvAdQb5vkV/gRJqEtJmymrsudBdfDVACaQy+FMOGim5iB3N6yViY 3BlfPogdqR57yfQICBRw3G/OUcfoSX5XGn3zle0vaRSXto+3ipKoR+JYaPfX/ilJtQ0d B7IQ== X-Gm-Message-State: APjAAAXC4emRAZGPdPYKfCslkGXJzq4oQOOTbIRuO3cN/i+cUrNXQLWv JwurhCyOpIbMqh9jm9WbEntf95M1 X-Google-Smtp-Source: APXvYqxwK16r2wJMXYypdIe7eAp11P65i9lgQSCiN/Ardp/fCp71G5EiyDegzSjD7iQ2/M8Wkxo36A== X-Received: by 2002:a63:5d44:: with SMTP id o4mr15903437pgm.15.1557516622004; Fri, 10 May 2019 12:30:22 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id h13sm6423301pgk.55.2019.05.10.12.30.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 12:30:21 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Fri, 10 May 2019 12:30:09 -0700 Message-Id: <1557516614-12563-3-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> References: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> 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 Cc: Florian Westphal Subject: [ovs-dev] [PATCH 2/7 v3] datapath: Pass nf_hook_state to nf_conntrack_in() 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 From: Florian Westphal Upstream Commit: commit 93e66024b0249cec81e91328c55a754efd3192e0 Author: Florian Westphal Date: Wed Sep 12 15:19:07 2018 +0200 netfilter: conntrack: pass nf_hook_state to packet and error handlers nf_hook_state contains all the hook meta-information: netns, protocol family, hook location, and so on. Instead of only passing selected information, pass a pointer to entire structure. This will allow to merge the error and the packet handlers and remove the ->new() function in followup patches. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso This patch backports the above upstream patch to OVS and fixes compiling errors on RHEL kernels. Cc: Florian Westphal Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- v1->v2: Fixed by YiHung's comments, thanks YiHung. acinclude.m4 | 5 +++++ datapath/conntrack.c | 8 ++++++-- datapath/linux/Modules.mk | 1 + datapath/linux/compat/include/linux/netfilter.h | 19 +++++++++++++++++++ .../compat/include/net/netfilter/nf_conntrack_core.h | 9 +++++++++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 datapath/linux/compat/include/linux/netfilter.h diff --git a/acinclude.m4 b/acinclude.m4 index c9b744db0b94..372be5f4dccd 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -603,6 +603,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [ndo_change_mtu], [OVS_DEFINE([HAVE_RHEL7_MAX_MTU])]) OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_state]) + OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_state], + [struct net ], [OVS_DEFINE([HAVE_NF_HOOK_STATE_NET])]) OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_register_net_hook]) OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hookfn.*nf_hook_ops], [OVS_DEFINE([HAVE_NF_HOOKFN_ARG_OPS])]) @@ -929,6 +931,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_l3proto.h], [nf_conntrack_l3proto], [OVS_DEFINE([HAVE_NF_CONNTRACK_L3PROATO_H])]) + OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_core.h], + [nf_conntrack_in], [nf_hook_state], + [OVS_DEFINE([HAVE_NF_CONNTRACK_IN_TAKES_NF_HOOK_STATE])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/datapath/conntrack.c b/datapath/conntrack.c index 52208bad3029..8c1a80308d6a 100644 --- a/datapath/conntrack.c +++ b/datapath/conntrack.c @@ -987,6 +987,11 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, struct nf_conn *ct; if (!cached) { + struct nf_hook_state state = { + .hook = NF_INET_PRE_ROUTING, + .pf = info->family, + .net = net, + }; struct nf_conn *tmpl = info->ct; int err; @@ -998,8 +1003,7 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, nf_ct_set(skb, tmpl, IP_CT_NEW); } - err = nf_conntrack_in(net, info->family, - NF_INET_PRE_ROUTING, skb); + err = nf_conntrack_in(skb, &state); if (err != NF_ACCEPT) return -ENOENT; diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk index caa2525ff0ab..ae63e3653b41 100644 --- a/datapath/linux/Modules.mk +++ b/datapath/linux/Modules.mk @@ -114,5 +114,6 @@ openvswitch_headers += \ linux/compat/include/net/erspan.h \ linux/compat/include/uapi/linux/netfilter.h \ linux/compat/include/linux/mm.h \ + linux/compat/include/linux/netfilter.h \ linux/compat/include/linux/overflow.h EXTRA_DIST += linux/compat/build-aux/export-check-whitelist diff --git a/datapath/linux/compat/include/linux/netfilter.h b/datapath/linux/compat/include/linux/netfilter.h new file mode 100644 index 000000000000..a6ed6172d49f --- /dev/null +++ b/datapath/linux/compat/include/linux/netfilter.h @@ -0,0 +1,19 @@ +#ifndef __NETFILTER_WRAPPER_H +#define __NETFILTER_WRAPPER_H + +#include_next + +#if !defined(HAVE_NF_HOOK_STATE) || !defined(HAVE_NF_HOOK_STATE_NET) +struct rpl_nf_hook_state { + unsigned int hook; + u_int8_t pf; + struct net_device *in; + struct net_device *out; + struct sock *sk; + struct net *net; + int (*okfn)(struct net *, struct sock *, struct sk_buff *); +}; +#define nf_hook_state rpl_nf_hook_state +#endif + +#endif /* __NETFILTER_WRAPPER_H */ diff --git a/datapath/linux/compat/include/net/netfilter/nf_conntrack_core.h b/datapath/linux/compat/include/net/netfilter/nf_conntrack_core.h index 7834c8c25f79..10158011fd4d 100644 --- a/datapath/linux/compat/include/net/netfilter/nf_conntrack_core.h +++ b/datapath/linux/compat/include/net/netfilter/nf_conntrack_core.h @@ -104,4 +104,13 @@ static inline bool rpl_nf_ct_delete(struct nf_conn *ct, u32 portid, int report) #define nf_ct_delete rpl_nf_ct_delete #endif /* HAVE_NF_CONN_TIMER */ +#ifndef HAVE_NF_CONNTRACK_IN_TAKES_NF_HOOK_STATE +static inline unsigned int +rpl_nf_conntrack_in(struct sk_buff *skb, const struct nf_hook_state *state) +{ + return nf_conntrack_in(state->net, state->pf, state->hook, skb); +} +#define nf_conntrack_in rpl_nf_conntrack_in +#endif /* HAVE_NF_CONNTRACK_IN_TAKES_NF_HOOK_STATE */ + #endif /* _NF_CONNTRACK_CORE_WRAPPER_H */ From patchwork Fri May 10 19:30:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1098305 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="rNzZbU6D"; 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 4510hm3Sy3z9s3q for ; Sat, 11 May 2019 05:32:08 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 97F3EE9F; Fri, 10 May 2019 19:30:26 +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 0554FE5D for ; Fri, 10 May 2019 19:30:24 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 91A0E1FB for ; Fri, 10 May 2019 19:30:23 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id l132so3729248pfc.8 for ; Fri, 10 May 2019 12:30:23 -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:in-reply-to:references; bh=1J8KkpUYBauIbBhU+RW40hBsKnISVBmBjaHkWLIlBaQ=; b=rNzZbU6DIU3yVkShYhvzioA3FqnZMPkjWPMq0cpUOdNi+bpUOwpBgUkvoI84/tv/vQ zSObvnA3c3aG038DfZpdkvHnjCZBmW9BVhKxz7ra4gi82dot7Hg6MMS5ze2hBMqG2V1A zciLWzk+O9XwxD9PhdZvCenKAkdH5nWTiDAxzhbnUHbDUArWJLnY19XP1rCsPFCtMVmd fHiMynSW3PKz3Ncj59FHAxFBmzVOfI9jaNxyOCgAHwej2rhx5MrXcjq9uGE8IiZ2Z861 yC0V/gYJVE5O8dyCIo0ZI8jQSgs/c+6ZQIXPI8aHgqMjk832WjAw1KLUiacJ5oO7xGsE PH9Q== 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:in-reply-to :references; bh=1J8KkpUYBauIbBhU+RW40hBsKnISVBmBjaHkWLIlBaQ=; b=qMzIFkKzU30ZwniEWIitK7yb4OZYk/31PjpjRJvPcom37JtRXeWzWecsQFYYiTNLG3 Ckpb6UOwTE/oMDLiLCg0klMNSf8jWC80AdHJdeCFZieULzdOCUca09X1xyBHRBoBb0ua spjx3VMTstfJfvpgmxELvtB9M4luFMUtN1AruTznTfVx3pWk5f6g8NdVN+RlfwGu1OrB wqS/AHT+hxGgp51frRas8HzyfGmmgaBKvQHCPJ7w4H2tMGhfuYKVrabiMthWEd76u/ny rpSW9S1zn0gK6+xkq5lyrMd+AgIRwTiqfoJfALFlE3P9328VtwNo183xRxrX986jzExS WVMw== X-Gm-Message-State: APjAAAWKFlJ5hl9bx37NFpJW7qCDFaZp0FgFO5yFElZx2ngyy7OM6dD5 cyguiJHD7S9uFz2yR7CIsDIM1X9Q X-Google-Smtp-Source: APXvYqzbxiq93ywSU4Fj9Wx3dEdtThA0jO3RkX2azxQEjByrxku3n72wRBhOTWEXl8o0wx5sSPjG1Q== X-Received: by 2002:a63:6e0b:: with SMTP id j11mr3134356pgc.291.1557516622963; Fri, 10 May 2019 12:30:22 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id h13sm6423301pgk.55.2019.05.10.12.30.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 12:30:22 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Fri, 10 May 2019 12:30:10 -0700 Message-Id: <1557516614-12563-4-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> References: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> 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 Cc: Florian Westphal Subject: [ovs-dev] [PATCH 3/7 v3] datapath: Use new header file net/ipv6_frag.h 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 From: Florian Westphal Upstream commit: commit 70b095c84326640eeacfd69a411db8fc36e8ab1a Author: Florian Westphal Date: Sat Jul 14 01:14:01 2018 +0200 ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module IPV6=m DEFRAG_IPV6=m CONNTRACK=y yields: net/netfilter/nf_conntrack_proto.o: In function `nf_ct_netns_do_get': net/netfilter/nf_conntrack_proto.c:802: undefined reference to `nf_defrag_ipv6_enable' net/netfilter/nf_conntrack_proto.o:(.rodata+0x640): undefined reference to `nf_conntrack_l4proto_icmpv6' Setting DEFRAG_IPV6=y causes undefined references to ip6_rhash_params ip6_frag_init and ip6_expire_frag_queue so it would be needed to force IPV6=y too. This patch gets rid of the 'followup linker error' by removing the dependency of ipv6.ko symbols from netfilter ipv6 defrag. Shared code is placed into a header, then used from both. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso This patch backports the above upstream patch to OVS. Cc: Florian Westphal Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- acinclude.m4 | 2 ++ datapath/conntrack.c | 1 + datapath/linux/Modules.mk | 1 + datapath/linux/compat/include/net/ipv6_frag.h | 8 ++++++++ 4 files changed, 12 insertions(+) create mode 100644 datapath/linux/compat/include/net/ipv6_frag.h diff --git a/acinclude.m4 b/acinclude.m4 index 372be5f4dccd..4f9aebc325ba 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -934,6 +934,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_core.h], [nf_conntrack_in], [nf_hook_state], [OVS_DEFINE([HAVE_NF_CONNTRACK_IN_TAKES_NF_HOOK_STATE])]) + OVS_GREP_IFELSE([$KSRC/include/net/ipv6_frag.h], [IP6_DEFRAG_CONNTRACK_IN], + [OVS_DEFINE([HAVE_IPV6_FRAG_H])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/datapath/conntrack.c b/datapath/conntrack.c index 8c1a80308d6a..52825a6b20fb 100644 --- a/datapath/conntrack.c +++ b/datapath/conntrack.c @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef CONFIG_NF_NAT_NEEDED #include diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk index ae63e3653b41..cbb29f1c69d0 100644 --- a/datapath/linux/Modules.mk +++ b/datapath/linux/Modules.mk @@ -86,6 +86,7 @@ openvswitch_headers += \ linux/compat/include/net/ip6_route.h \ linux/compat/include/net/ip6_tunnel.h \ linux/compat/include/net/ipv6.h \ + linux/compat/include/net/ipv6_frag.h \ linux/compat/include/net/mpls.h \ linux/compat/include/net/net_namespace.h \ linux/compat/include/net/netlink.h \ diff --git a/datapath/linux/compat/include/net/ipv6_frag.h b/datapath/linux/compat/include/net/ipv6_frag.h new file mode 100644 index 000000000000..5d1cc901bec1 --- /dev/null +++ b/datapath/linux/compat/include/net/ipv6_frag.h @@ -0,0 +1,8 @@ +#ifndef __NET_IPV6_FRAG_WRAPPER_H +#define __NET_IPV6_FRAG_WRAPPER_H + +#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) && defined(HAVE_IPV6_FRAG_H) +#include_next +#endif + +#endif /* __NET_IPV6_FRAG_WRAPPER_H */ From patchwork Fri May 10 19:30:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1098306 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="pScwQ4/y"; 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 4510jK5crFz9s3q for ; Sat, 11 May 2019 05:32:37 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 3A648EA4; Fri, 10 May 2019 19:30:27 +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 CAE8CE84 for ; Fri, 10 May 2019 19:30:24 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 7BC831FB for ; Fri, 10 May 2019 19:30:24 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id y3so3281007plp.0 for ; Fri, 10 May 2019 12:30:24 -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:in-reply-to:references; bh=gRA1IupYih5I6Iy98YhOJ7t0fZxf4Ce8Dv1dRD1RCnA=; b=pScwQ4/yizOTj8z90s0IRxGZFwG9cLi5VD/u9DNSxykolGhszoZPp38eMoq7vbQcUd u6gSMRPZExi1ZqVRweM6ZWohARS+cGSwMLKNgyxS0MO3/PhrMu6FQ4Qx9R9n/cL0KXgI 742o9FHbt5fYEzyRL4UBqJ3sIxi0z2dGrSyeOTK6XRFYjT8pxEuSg6WFhhO+cNzrmD/j comIPMQ3nRLOSJ1QgLr+NoIO0OTfg9V4JgK9JZWSwTJEWrKjdZ9QmOxUV681gS3K6pQ6 7c7CH/UdbeBij4rGJ4S1k8BPFuU3EHv7jftMV+A2A/1oDim8X/y1wNIGpak70r2gXcrW w4dg== 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:in-reply-to :references; bh=gRA1IupYih5I6Iy98YhOJ7t0fZxf4Ce8Dv1dRD1RCnA=; b=sQ5Fsb7FhtMT/2ZTJLltgM1+/WhiECzan1xWgCMUAiXh88mmxOuXJdOXvwfgav1OoR GuhxxWbO3LsPhbwAd6vGrKf93J1BV9VrVPNlB5bxOyLoZRcDBRlotP+YpLax2emTovgy T054TcoAu/bfWes1Hy3rGG7VooWXDaOzRX1ejbP9jJEpB5zNkPYN/ymsbwmU1JgcsCa4 Bq9a9v9M6s0uLbpSrNWV/2703LKeXmt/Wa2YXsuxBDsx4ANncwlKPelrs8gDyTilgPXD rndNSKCscSwSSdE5fL66hmKDI1ydc8B2pH0alnajQ6CwCs87BJkDS4kHiq0lmo3NOAJe BT/A== X-Gm-Message-State: APjAAAVitLynMgD5woI2XMxBteIfcz50nlXALw2UvMVzpxRBBFY+PpFC XnQOH9+7Kw1ubVICTUCKlvppM+KQ X-Google-Smtp-Source: APXvYqy90sve7XQpS8OS+G94lB8j1JWAEgYCEoYDPZVKIPPXvuRAnmXrXShPO3EOAdSxzh85slsHaQ== X-Received: by 2002:a17:902:e407:: with SMTP id ci7mr15162621plb.219.1557516623909; Fri, 10 May 2019 12:30:23 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id h13sm6423301pgk.55.2019.05.10.12.30.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 12:30:23 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Fri, 10 May 2019 12:30:11 -0700 Message-Id: <1557516614-12563-5-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> References: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> 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 4/7 v3] datapath: Fix conntrack_count related compilation errors 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 This patch fixes the compilation errors of OVS on 4.19+ kernels. Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- datapath/linux/compat/include/net/netfilter/nf_conntrack_count.h | 4 ++-- datapath/linux/compat/nf_conncount.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/datapath/linux/compat/include/net/netfilter/nf_conntrack_count.h b/datapath/linux/compat/include/net/netfilter/nf_conntrack_count.h index fd536f3e1854..614017309efe 100644 --- a/datapath/linux/compat/include/net/netfilter/nf_conntrack_count.h +++ b/datapath/linux/compat/include/net/netfilter/nf_conntrack_count.h @@ -2,6 +2,8 @@ #define _NF_CONNTRACK_COUNT_WRAPPER_H #include +#include +#include #ifdef HAVE_UPSTREAM_NF_CONNCOUNT #include_next @@ -16,8 +18,6 @@ static inline void rpl_nf_conncount_modexit(void) } #else -#include -#include #define CONFIG_NETFILTER_CONNCOUNT 1 struct nf_conncount_data; diff --git a/datapath/linux/compat/nf_conncount.c b/datapath/linux/compat/nf_conncount.c index 0bee96274b00..eeae440f872d 100644 --- a/datapath/linux/compat/nf_conncount.c +++ b/datapath/linux/compat/nf_conncount.c @@ -13,6 +13,8 @@ * only ignore TIME_WAIT or gone connections * (C) CC Computer Consultants GmbH, 2007 */ +#ifndef HAVE_UPSTREAM_NF_CONNCOUNT + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include #include @@ -138,7 +140,7 @@ static bool conn_free(struct nf_conncount_list *list, if (list->count == 0) { spin_unlock(&list->list_lock); - return free_entry; + return free_entry; } list->count--; @@ -635,3 +637,5 @@ void rpl_nf_conncount_modexit(void) kmem_cache_destroy(conncount_conn_cachep); kmem_cache_destroy(conncount_rb_cachep); } + +#endif /* HAVE_UPSTREAM_NF_CONNCOUNT */ From patchwork Fri May 10 19:30:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1098307 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="ZV9oH8jc"; 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 4510jy47hVz9s3q for ; Sat, 11 May 2019 05:33:10 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 21F4DEB7; Fri, 10 May 2019 19:30:28 +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 F06A9E96 for ; Fri, 10 May 2019 19:30:25 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 98CAB1FB for ; Fri, 10 May 2019 19:30:25 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id g9so3280015plm.6 for ; Fri, 10 May 2019 12:30:25 -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:in-reply-to:references; bh=x41a51GzKUI5G169KRpXwM2oYMLYdF9GbSAJUETqzfM=; b=ZV9oH8jc/3rc9Xck2tAkWfUNFXl1JsMjLiIt23x8CIXw8Nd2Ppx3NRXFcSJcKNm64L GYGdN8rt1Pg/37PbV164eaCHF4BRV7WXKvKC4idTyJCns1/9Q1HwlHn/EebIA9zh5OpS 388jOeOU1NUFZzXh5wTPt+JUSNvUQJECF0ObOXxqbwQwPTV3J5eMgbWjV3BChQSOiMwY p2Czn2b3KHMyaWPu/jIePEa5BMrwuPmecpFhkeHsay5W9kLnNaNVM2vlmgyoId6ED34j QDga1oMuzlVFxdRW+nDDgQnMHgSQ2rJSGV+46WNDbWO+FtMwom9EwrF1c6jhtkwo/ANj TURg== 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:in-reply-to :references; bh=x41a51GzKUI5G169KRpXwM2oYMLYdF9GbSAJUETqzfM=; b=ZPl2Mk0j2arPjyGWA/iLQe8OYRdAuBiXWvI01TQy3tDi0qDtTjEWidcHsyCQt7xLaS APKK26LN6sEizIMof3E1RrmSylT2in1QfTXxjKEUknBaYYtCD45EvAg2b/SaJNe+nQ9b DV3KlY8c9KRn6yCOSAm8jc3ijtF328BxPiMRexwkz22YCcMpDyMVxy2vdGUBwndbXJuy eB+XeLTnbroZaydPl5jXAvFO1mx60HG1rh351GIz4T9f4YTHytn+upMuwl6xxOEF4m+s ojRlo4iKtEz4V3A4HIaSajMKeDcMkTATE7uo0Otzey2WLq/Mongs/XB6ZX3TgTh1F2Xp 7xYQ== X-Gm-Message-State: APjAAAWykZsMAywRn/ujqZzzKLUazGohbUzuSZAyiCJ0Ii9uqYCGCtN5 osGsGZWZWnGrtJhHI6vrYz3wPB8+ X-Google-Smtp-Source: APXvYqy8rZYnbgmimzWDvdQtsucAXjFPgCgwxG4KAztz5aWWUwnphmn3Of3W5zrsKdQ0/NCf5/6gSA== X-Received: by 2002:a17:902:b489:: with SMTP id y9mr14864011plr.70.1557516624857; Fri, 10 May 2019 12:30:24 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id h13sm6423301pgk.55.2019.05.10.12.30.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 12:30:24 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Fri, 10 May 2019 12:30:12 -0700 Message-Id: <1557516614-12563-6-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> References: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> 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 Cc: Florian Westphal Subject: [ovs-dev] [PATCH 5/7 v3] openvswitch: use nf_ct_get_tuplepr, invert_tuplepr 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 From: Florian Westphal Upstream commit: commit 60e3be94e6a1c5162a0763c9aafb5190b2b1fdce Author: Florian Westphal Date: Mon Jun 25 17:55:32 2018 +0200 openvswitch: use nf_ct_get_tuplepr, invert_tuplepr These versions deal with the l3proto/l4proto details internally. It removes only caller of nf_ct_get_tuple, so make it static. After this, l3proto->get_l4proto() can be removed in a followup patch. Signed-off-by: Florian Westphal Acked-by: Pravin B Shelar Signed-off-by: Pablo Neira Ayuso This patch backports the above upstream kernel patch to OVS. Cc: Florian Westphal Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- v1->v2: Fixed nf_ct_invert_tuplepr by YiHung's comments, Thanks YiHung. datapath/conntrack.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/datapath/conntrack.c b/datapath/conntrack.c index 52825a6b20fb..292febb3c83e 100644 --- a/datapath/conntrack.c +++ b/datapath/conntrack.c @@ -646,23 +646,12 @@ static struct nf_conn * ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone, u8 l3num, struct sk_buff *skb, bool natted) { - const struct nf_conntrack_l3proto *l3proto; - const struct nf_conntrack_l4proto *l4proto; struct nf_conntrack_tuple tuple; struct nf_conntrack_tuple_hash *h; struct nf_conn *ct; - unsigned int dataoff; - u8 protonum; - l3proto = __nf_ct_l3proto_find(l3num); - if (l3proto->get_l4proto(skb, skb_network_offset(skb), &dataoff, - &protonum) <= 0) { - pr_debug("ovs_ct_find_existing: Can't get protonum\n"); - return NULL; - } - l4proto = __nf_ct_l4proto_find(l3num, protonum); - if (!nf_ct_get_tuple(skb, skb_network_offset(skb), dataoff, l3num, - protonum, net, &tuple, l3proto, l4proto)) { + if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb), l3num, + net, &tuple)) { pr_debug("ovs_ct_find_existing: Can't get tuple\n"); return NULL; } @@ -671,7 +660,7 @@ ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone, if (natted) { struct nf_conntrack_tuple inverse; - if (!nf_ct_invert_tuple(&inverse, &tuple, l3proto, l4proto)) { + if (!nf_ct_invert_tuplepr(&inverse, &tuple)) { pr_debug("ovs_ct_find_existing: Inversion failed!\n"); return NULL; } From patchwork Fri May 10 19:30:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1098308 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="O+dZcW1t"; 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 4510kS5yZ3z9s7h for ; Sat, 11 May 2019 05:33:36 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B1A2EEC6; Fri, 10 May 2019 19:30:28 +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 47600EA6 for ; Fri, 10 May 2019 19:30:27 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E77FC1FB for ; Fri, 10 May 2019 19:30:26 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id g9so3280039plm.6 for ; Fri, 10 May 2019 12:30:26 -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:in-reply-to:references; bh=jBkqbD/W8Y3fTLv4w8xkMae32s6BEwFHclTkhRkhBHs=; b=O+dZcW1tmbrHP+n//40rDgMsur/Gkd9XPJeEH4WbV/l7zJKwz1YgQmUbGu/28P+dUn iQsoLtrGf5DLwOJn/oP3Qf8xWFz0T/IsLBRblowS+zMIi3vgYa9XY0ccUOME5kxPpQCv Xf4Y752pr0WtaobtsGT4hhovwb20VX1RS3Xgaml9WHRmEC7pKbBoicdtnjZ4oUB+v9GK GG/DSXBp/9b3jNNlaHwQgWXRuygXcMxkr0KfgM9LXWJudwU1xUlQUpfmWk0RtMumdLIH DLFDgrilYMPrnjEwVTE94PbfNzmU491Ry8JwapicOrvfb1wRk2PScmfTQmpf9vUnaiAU +yZQ== 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:in-reply-to :references; bh=jBkqbD/W8Y3fTLv4w8xkMae32s6BEwFHclTkhRkhBHs=; b=trcwn/GG1X8BKtbUD1TD+MF9H+FgrTWSihAmXUVQ7qVWrTY9cAJOOEUWRmJ9Eci53z /opL5xRtIMz0JpcdAKrw1i40+qFSyCvjyGdgatHIMACEFFoIAL3rj+3RF3QyT/NSXhbU YN6YgySP+hMmEIHFDuEnwo5hurjA55fU7kEcwkCGZT8CoQjr0nrkYGQfGcbV8RshrvrQ zFZAa/svfgQKjZdH0Gia7G6xMyC6XugtkMFgnYIlsYww3nCkLX4UBx5bUhUAeDq7sRbT QPk09LMjqgFODSYboHErjM6lxkgaQHmzpmnRFM59z3HHh5jG9y8Lnq8VwIB1ul5qJGTZ 5tLw== X-Gm-Message-State: APjAAAUyP3O1vEhTxJTruh2JQqn+JCW14F33vGOBi/nseLX7IDuzO7JH JUI1f0G8c5ErwhOJildVpo465PyD X-Google-Smtp-Source: APXvYqzMWWOx0HnIQdb5GkVSrjd0DONIwRBWR2YuiVoZCbyarYJiXS1AekWWh2rnrSD23BITumDVwg== X-Received: by 2002:a17:902:3064:: with SMTP id u91mr15473264plb.181.1557516626236; Fri, 10 May 2019 12:30:26 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id h13sm6423301pgk.55.2019.05.10.12.30.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 12:30:25 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Fri, 10 May 2019 12:30:13 -0700 Message-Id: <1557516614-12563-7-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> References: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> 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 Cc: Gao Feng Subject: [ovs-dev] [PATCH 6/7 v3] netfilter: Remove useless param helper of nf_ct_helper_ext_add 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 From: Gao Feng Upstream commit: commit 440534d3c56be04abfb26850ee882d19d223557a Author: Gao Feng Date: Mon Jul 9 18:06:33 2018 +0800 netfilter: Remove useless param helper of nf_ct_helper_ext_add The param helper of nf_ct_helper_ext_add is useless now, then remove it now. Signed-off-by: Gao Feng Signed-off-by: Pablo Neira Ayuso This patch backports the above upstream patch to OVS. Cc: Gao Feng Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- v1->v2: Rebase previous patch's changes. acinclude.m4 | 3 +++ .../linux/compat/include/net/netfilter/nf_conntrack_helper.h | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 4f9aebc325ba..878c2f6d40f2 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -936,6 +936,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_DEFINE([HAVE_NF_CONNTRACK_IN_TAKES_NF_HOOK_STATE])]) OVS_GREP_IFELSE([$KSRC/include/net/ipv6_frag.h], [IP6_DEFRAG_CONNTRACK_IN], [OVS_DEFINE([HAVE_IPV6_FRAG_H])]) + OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_helper.h], + [nf_ct_helper_ext_add], [nf_conntrack_helper], + [OVS_DEFINE([HAVE_NF_CT_HELPER_EXT_ADD_TAKES_HELPER])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/datapath/linux/compat/include/net/netfilter/nf_conntrack_helper.h b/datapath/linux/compat/include/net/netfilter/nf_conntrack_helper.h index 19c35cd95f6f..b6a3d0bf75b3 100644 --- a/datapath/linux/compat/include/net/netfilter/nf_conntrack_helper.h +++ b/datapath/linux/compat/include/net/netfilter/nf_conntrack_helper.h @@ -9,4 +9,14 @@ static inline void nf_conntrack_helper_put(struct nf_conntrack_helper *helper) { } #endif +#ifndef HAVE_NF_CT_HELPER_EXT_ADD_TAKES_HELPER +static inline struct nf_conn_help * +rpl_nf_ct_helper_ext_add(struct nf_conn *ct, + struct nf_conntrack_helper *helper, gfp_t gfp) +{ + return nf_ct_helper_ext_add(ct, gfp); +} +#define nf_ct_helper_ext_add rpl_nf_ct_helper_ext_add +#endif /* HAVE_NF_CT_HELPER_EXT_ADD_TAKES_HELPER */ + #endif /* _NF_CONNTRACK_HELPER_WRAPPER_H */ From patchwork Fri May 10 19:30:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1098309 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="J/VY6GDm"; 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 4510kx0dLFz9sBK for ; Sat, 11 May 2019 05:34:01 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 66653ED3; Fri, 10 May 2019 19:30:31 +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 2E3F2EB9 for ; Fri, 10 May 2019 19:30:28 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C7E191FB for ; Fri, 10 May 2019 19:30:27 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id 10so3734731pfo.5 for ; Fri, 10 May 2019 12:30:27 -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:in-reply-to:references; bh=LH3HMKwLB2uzCvC7LZAvVUgn1JOzaCg76qIvuWpoXek=; b=J/VY6GDmuMLfajT8kk2iPpSrJwSzRBtmSwdGDzulwuVaE7SCZcWbRr+j9FcdpBaZ6g BTtYeG2+lQm81XFLuGbWlnAATX6IvSQAYvPtjzr1hl1BJAlK0cxhdM/KjTrnBFtFXV0n hRbzPDfgE/iO0o5U33e+iniApuN0mP+G1+GBzrzKsakYFDka2qm4oM5nqJuPVdayPGQP yj4W4ob+NwrFBjwltMOeIdVxEVPWvgffmCDcXOSETPWmXK/7dJpj6IuwBwqVQGQT6PoC uRYgj0zrx8hbrs4YPpf2MKfaGfxgA4iCm369xF+Zp/928sh/pBTuQpBDMzZfid2Xa79B bplg== 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:in-reply-to :references; bh=LH3HMKwLB2uzCvC7LZAvVUgn1JOzaCg76qIvuWpoXek=; b=T/OWDtG2T6DMg2e/KC/5rxNUZ4Yq0RY5vT9s5CQ5O2QENLDE6XtHv4FiSDpDEDo/K1 Il6rr5NP7AUNqjcGl/q2Byc1T1t4HzplMQC5RWi3q5KAYhWg36bpYiTOC4FOj9/0KMac neT0Oz8RiI0/0fUy9msIVQgS92mM4OGI4iH+cjJGwJsB8/j/frPWUjBddsWCxO0xe0wK 2VTGc4sXBB3szQ1IskmGfXW8sFGXLMnBH/5eA/7z9pTLeOEMfmYQc+jVms4CaW7Uux7K aQ/DMXeUz+bc4IeqQFQ6eljIDzqChfJQSL4njpUF7SnXSq/zTGHC+KgP5/UmOiVHYPhm tqJw== X-Gm-Message-State: APjAAAX0OoCZy3Ps3wNK3hLPQJcgRqPG08pM3XLC/6XMpVKN1icuo8Mn 0YfcYNAj95tyYnVSSTYECFfDIB2V X-Google-Smtp-Source: APXvYqyaSQ8Ww0XsyrTUGGsD6hn4siM1mqVi4vMfqC9f5QGWfbQZQbfuKgl9P5AwoXVEFamv1Olwvg== X-Received: by 2002:a62:1d83:: with SMTP id d125mr16435941pfd.74.1557516627173; Fri, 10 May 2019 12:30:27 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id h13sm6423301pgk.55.2019.05.10.12.30.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 12:30:26 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Fri, 10 May 2019 12:30:14 -0700 Message-Id: <1557516614-12563-8-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> References: <1557516614-12563-1-git-send-email-pkusunyifeng@gmail.com> 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 7/7 v3] datapath: Support kernel version 4.19.x and 4.20.x 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 This patch updated acinclude.m4 so that OVS can be compiled on 4.19.x and 4.20.x kernels. This patch also updated travis files so that latest kernel versions are used during travis test builds. Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- .travis.yml | 18 ++++++++++-------- NEWS | 2 ++ acinclude.m4 | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 468c39ecd505..765692f7a2b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,19 +31,21 @@ env: - TESTSUITE=1 KERNEL=3.16.54 - TESTSUITE=1 OPTS="--enable-shared" - BUILD_ENV="-m32" OPTS="--disable-ssl" - - KERNEL=3.16.54 DPDK=1 OPTS="--enable-shared" - - KERNEL=3.16.54 TESTSUITE=1 DPDK=1 - - KERNEL=3.16.54 DPDK_SHARED=1 - - KERNEL=3.16.54 DPDK_SHARED=1 OPTS="--enable-shared" + - KERNEL=3.16.65 DPDK=1 OPTS="--enable-shared" + - KERNEL=3.16.65 TESTSUITE=1 DPDK=1 + - KERNEL=3.16.65 DPDK_SHARED=1 + - KERNEL=3.16.65 DPDK_SHARED=1 OPTS="--enable-shared" + - KERNEL=4.20.17 + - KERNEL=4.19.37 - KERNEL=4.18.20 - KERNEL=4.17.19 - KERNEL=4.16.18 - KERNEL=4.15.18 - - KERNEL=4.14.111 - - KERNEL=4.9.149 - - KERNEL=4.4.148 + - KERNEL=4.14.114 + - KERNEL=4.9.171 + - KERNEL=4.4.179 - KERNEL=3.19.8 - - KERNEL=3.16.57 + - KERNEL=3.16.65 - TESTSUITE=1 LIBS=-ljemalloc matrix: diff --git a/NEWS b/NEWS index 293531db0615..3b4160c27834 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,8 @@ Post-v2.11.0 members of the same transport zone(s). - New QoS type "linux-netem" on Linux. - Added support for TLS Server Name Indication (SNI). + - Linux datapath: + * Support for the kernel versions 4.19.x and 4.20.x. v2.11.0 - 19 Feb 2019 diff --git a/acinclude.m4 b/acinclude.m4 index 878c2f6d40f2..f8fc5bcd7b4c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -151,10 +151,10 @@ AC_DEFUN([OVS_CHECK_LINUX], [ AC_MSG_RESULT([$kversion]) if test "$version" -ge 4; then - if test "$version" = 4 && test "$patchlevel" -le 18; then + if test "$version" = 4 && test "$patchlevel" -le 20; then : # Linux 4.x else - AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.18.x is not supported (please refer to the FAQ for advice)]) + AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.20.x is not supported (please refer to the FAQ for advice)]) fi elif test "$version" = 3 && test "$patchlevel" -ge 10; then : # Linux 3.x