From patchwork Thu Aug 16 13:19:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 958547 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="cZ6bFytU"; 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 41rvlf6nwkz9s8f for ; Fri, 17 Aug 2018 04:20:46 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D8BC4D63; Thu, 16 Aug 2018 18:20:43 +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 2B708D5E for ; Thu, 16 Aug 2018 18:20:43 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C64167C8 for ; Thu, 16 Aug 2018 18:20:42 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id b11-v6so2389266pfo.3 for ; Thu, 16 Aug 2018 11:20:42 -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=9mt+s8Og9SAvHSkkvN+QcELyJOYcBpunRCkI24XKN5s=; b=cZ6bFytUnI2dyFO/BOkou9vwdSS5d35mlo3RSwDqpNspGmViuMaXMa0QYOIsLGhARa OX8UyCtAp2uNSjc183jJNtGWbtbrcfbyrQOC9jJn2MCLntVKAD1Flbt0VKPTAic8bbv9 6i1pSupwPZaceVa/+nw0Oq7qfRKzP776breuy/BFeeUYVAZ7iEB6SLUd240OK1OayWln bPRxx5VDLiy7QYNXw5qOsFtFvJYMwGAJiNKYou5FezsSoT2ZXuYmWuxIraXUgPqqyEkE EsqtnrEjjFc+lCOQQF1AEu+IqSehRIK/RsXaMVqr5Y5pe1nj8ZVEM2hMrv3YKZ8NjdVc Qz1w== 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=9mt+s8Og9SAvHSkkvN+QcELyJOYcBpunRCkI24XKN5s=; b=NdzjHRtdaGCGKcp9+ZvCxs/lmuobSaqXCpBq0criDBC44L/HQe5C+ohQQLVC6TYyhZ TWdFRi/7ecMk3Qwo2ij97BZMDUqRWIYKnHj7gyi1US3C6JWakLj+U44IL6UB5t8Aq2YU 6rroa2kk9fdr2uPYAaboVnQMm7vVsQQz/DwchQkcyc/jDx7epbuQocx0Gm33S4gxSELH aap8ZO4ZJaXS+BgXhHEfYA5tS27XPOtqTuCgYY9mmwlfRgfO02nh42uZWMULb8226aq8 PJGKq+mSYhybhxLYO2JfswVPTxei37X+KefBObeWjuv32eTIlkk/etkVqfpV0+vMEExn hhWA== X-Gm-Message-State: AOUpUlES7JgxaQZPGOhYWHypyYjR+++tt+QhENzw+gFCjuwzYbyqjx/U TrlnQese9lGRD/EArW6GYaux2nrj X-Google-Smtp-Source: AA+uWPy9VKVXDP3IGeAEGaCxYFlDlwJf6adb8o8z2IK2gseh1LEoHFjuvsN+sc80412Wnvgu+3BMSw== X-Received: by 2002:a62:429c:: with SMTP id h28-v6mr8698610pfd.51.1534443642192; Thu, 16 Aug 2018 11:20:42 -0700 (PDT) Received: from yfsovs.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id 1-v6sm63970402pfm.145.2018.08.16.11.20.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 11:20:41 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Thu, 16 Aug 2018 06:19:39 -0700 Message-Id: <1534425579-3785-1-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DATE_IN_PAST_03_06, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v2] porting: Add fixes to support kernel 4.15.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 enables OVS kernel module to run on kernel 4.15.x. Two conntrack-related tests failed: - conntrack - multiple zones, local - conntrack - multi-stage pipeline, local This might be due to conntrack policy changes for packets coming from local ports on kernel 4.15. More survey will be done later. Signed-off-by: Greg Rose Signed-off-by: Yifeng Sun Tested-by: Greg Rose Reviewed-by: Greg Rose v2: Add travis and documentation from Greg. .travis.yml | 10 +++++----- Documentation/faq/releases.rst | 2 +- acinclude.m4 | 6 ++++-- datapath/linux/compat/vxlan.c | 10 ++++++++++ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4d7bbd8..998b33d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,11 +35,11 @@ env: - BUILD_ENV="-m32" OPTS="--disable-ssl" - KERNEL=3.16.54 DPDK=1 - KERNEL=3.16.54 DPDK=1 OPTS="--enable-shared" - - KERNEL=4.14.47 - - KERNEL=4.9.105 - - KERNEL=4.4.135 - - KERNEL=4.1.52 - - KERNEL=3.16.56 + - KERNEL=4.15.18 + - KERNEL=4.14.63 + - KERNEL=4.9.120 + - KERNEL=4.4.148 + - KERNEL=3.16.57 - TESTSUITE=1 LIBS=-ljemalloc matrix: diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst index 50ca5f6..54c4b54 100644 --- a/Documentation/faq/releases.rst +++ b/Documentation/faq/releases.rst @@ -67,7 +67,7 @@ Q: What Linux kernel versions does each Open vSwitch release work with? 2.7.x 3.10 to 4.9 2.8.x 3.10 to 4.12 2.9.x 3.10 to 4.13 - 2.10.x 3.10 to 4.14 + 2.10.x 3.10 to 4.15 ============ ============== Open vSwitch userspace should also work with the Linux kernel module built diff --git a/acinclude.m4 b/acinclude.m4 index 6e7ea4c..9fffe9c 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 14; then + if test "$version" = 4 && test "$patchlevel" -le 15; then : # Linux 4.x else - AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.14.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.15.x is not supported (please refer to the FAQ for advice)]) fi elif test "$version" = 3 && test "$patchlevel" -ge 10; then : # Linux 3.x @@ -883,6 +883,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [void.*ndo_get_stats64], [OVS_DEFINE([HAVE_VOID_NDO_GET_STATS64])]) + OVS_GREP_IFELSE([$KSRC/include/linux/timer.h], [init_timer_deferrable], + [OVS_DEFINE([HAVE_INIT_TIMER_DEFERRABLE])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c index 8f5a921..b38a7be 100644 --- a/datapath/linux/compat/vxlan.c +++ b/datapath/linux/compat/vxlan.c @@ -1275,9 +1275,15 @@ netdev_tx_t rpl_vxlan_xmit(struct sk_buff *skb) EXPORT_SYMBOL_GPL(rpl_vxlan_xmit); /* Walk the forwarding table and purge stale entries */ +#ifdef HAVE_INIT_TIMER_DEFERRABLE static void vxlan_cleanup(unsigned long arg) { struct vxlan_dev *vxlan = (struct vxlan_dev *) arg; +#else +static void vxlan_cleanup(struct timer_list *t) +{ + struct vxlan_dev *vxlan = from_timer(vxlan, t, age_timer); +#endif unsigned long next_timer = jiffies + FDB_AGE_INTERVAL; unsigned int h; @@ -1638,9 +1644,13 @@ static void vxlan_setup(struct net_device *dev) INIT_LIST_HEAD(&vxlan->next); spin_lock_init(&vxlan->hash_lock); +#ifdef HAVE_INIT_TIMER_DEFERRABLE init_timer_deferrable(&vxlan->age_timer); vxlan->age_timer.function = vxlan_cleanup; vxlan->age_timer.data = (unsigned long) vxlan; +#else + timer_setup(&vxlan->age_timer, vxlan_cleanup, TIMER_DEFERRABLE); +#endif vxlan->cfg.dst_port = htons(vxlan_port);