From patchwork Mon May 20 23:58:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1102480 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="PBiCIXKv"; 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 457G820CnNz9s55 for ; Tue, 21 May 2019 09:58:57 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 57915BA0; Mon, 20 May 2019 23:58:54 +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 7A3498DC for ; Mon, 20 May 2019 23:58:52 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 79226D0 for ; Mon, 20 May 2019 23:58:51 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id h17so7570200pgv.0 for ; Mon, 20 May 2019 16:58:51 -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=EniC8Fcs0VKYoTw8VCmIBUOcWtyKTg7fpWK3ZvJn9FA=; b=PBiCIXKvlFbP5UavxpwqyxtSDCVn8Pyw4mnL83hF6ZZroI8HtvSwOmNOMXCypUeUXh uCjEP22pGMlYp8JGntpXrqvX7sWuECLtYystPA69VqiznUqHMtU3yaATmSr1MEFtHRSX LPmWYh+G8XvdyYJ7ITa9TC+BxA1jZfVhjYVipiziTEIaorzTx/MLYC6TQWSSvwq8ykDd bpwR1+pENraI0AdzMa8gDkFaZeB2TxV9Go2f+f03WGb9fr6K5sS5omDV0tdTWSAXQOc/ GOXQ2qN+t3CwOT/ksittGxNVXkKbkSMRIb4jfnezvO7zgvFaVjRxXKaBLp2W4rACUbj9 X1Ow== 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=EniC8Fcs0VKYoTw8VCmIBUOcWtyKTg7fpWK3ZvJn9FA=; b=lSuT7BUa523i2laKVIainJtF/qYMhq793tz5ug91pnZWu00Tg8LvDWTA7auatNHSVF U2JZKeUY6D+i+2UEDk4D1cQuEgWf0ZEPwcFHPE3DNMogn5tBU8ArMwp58XeQokzCewtG dIw3yYPL8U1ULzr+X4WopIMIrW8PJbVAh6uU+hbFZoGXkZfPiRZq5z2c3icqRDQcIF4c iZFKHJ//z6kT8jLhH8bsZOEmTOIOmwa5Yep7JH7QhxL4OVuTwA5OxWu/Hk8S5RYZHRWj jAiOD7eQv3gUPwj08fHmH75ZZ7/ATl1pzD5mYGZBkmBs/flefpDEXfpTOWJe4g+UypAN 8VGg== X-Gm-Message-State: APjAAAXcq/gszd/jMRTjFHzYhJPUY0zbxxr+y+j1XbQwehZ3kzZMfXss /fFMFUymWGGick2B0smQUZidDGq4 X-Google-Smtp-Source: APXvYqzV1w3nXiEUHuDD8a0w1Fpt0B9d63vy3HLwQo7PjT6bJSOWNydzpo5yFpO8TjMih2yYRHaeFw== X-Received: by 2002:aa7:8c12:: with SMTP id c18mr85345645pfd.194.1558396730745; Mon, 20 May 2019 16:58:50 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id e6sm31658900pfl.115.2019.05.20.16.58.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 16:58:49 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org, i.maximets@samsung.com Date: Mon, 20 May 2019 16:58:43 -0700 Message-Id: <1558396723-2843-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: Fix build errors for 4.9.172+ kernels 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 4.9.172+ kernel backported upstream patch 70b095c843266 ("ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module") and this caused compilation errors of OVS kernel module. This patch fixes it by checking and using new functions introduced by the upstream patch. Travis tests passed at https://travis-ci.org/yifsun/ovs-travis/builds/535047469 with latest Linux kernel version. Signed-off-by: Yifeng Sun Reported-by: Ilya Maximets --- datapath/linux/compat/nf_conntrack_reasm.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/datapath/linux/compat/nf_conntrack_reasm.c b/datapath/linux/compat/nf_conntrack_reasm.c index 9d77d982712c..ac5ec6dd30ab 100644 --- a/datapath/linux/compat/nf_conntrack_reasm.c +++ b/datapath/linux/compat/nf_conntrack_reasm.c @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -138,8 +139,12 @@ static void nf_ct_frag6_expire(unsigned long data) #ifdef HAVE_INET_FRAGS_RND ip6_expire_frag_queue(net, fq, &nf_frags); #else +#ifdef HAVE_IPV6_FRAG_H + ip6frag_expire_frag_queue(net, fq); +#else ip6_expire_frag_queue(net, fq); #endif +#endif /* HAVE_INET_FRAGS_RND */ } #ifdef HAVE_INET_FRAGS_RND @@ -673,6 +678,16 @@ static struct pernet_operations nf_ct_net_ops = { .exit = nf_ct_net_exit, }; +#ifdef HAVE_IPV6_FRAG_H +static const struct rhashtable_params nfct_rhash_params = { + .head_offset = offsetof(struct inet_frag_queue, node), + .hashfn = ip6frag_key_hashfn, + .obj_hashfn = ip6frag_obj_hashfn, + .obj_cmpfn = ip6frag_obj_cmpfn, + .automatic_shrinking = true, +}; +#endif + int rpl_nf_ct_frag6_init(void) { int ret = 0; @@ -684,9 +699,14 @@ int rpl_nf_ct_frag6_init(void) nf_frags.hashfn = nf_hashfn; nf_frags.match = ip6_frag_match; #else +#ifdef HAVE_IPV6_FRAG_H + nf_frags.rhash_params = nfct_rhash_params; + nf_frags.constructor = ip6frag_init; +#else nf_frags.rhash_params = ip6_rhash_params; -#endif nf_frags.constructor = ip6_frag_init; +#endif +#endif /* HAVE_INET_FRAGS_RND */ nf_frags.destructor = NULL; nf_frags.qsize = sizeof(struct frag_queue); nf_frags.frag_expire = nf_ct_frag6_expire;