From patchwork Fri May 31 21:58: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: 1108596 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="La5ytd0P"; 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 45FyzC3cCqz9sNR for ; Sat, 1 Jun 2019 07:59:34 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id F155819A3; Fri, 31 May 2019 21:59:30 +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 970B8199D for ; Fri, 31 May 2019 21:58:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0920C7D2 for ; Fri, 31 May 2019 21:58:15 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id v11so4746275pgl.5 for ; Fri, 31 May 2019 14:58:15 -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=JUJDwGOKdYhdNLxCpRlx9p9Lfa9xqwLP/yuuSjZCLLA=; b=La5ytd0PGSoQ6oI6fedsAPs7oZ8Gu3kEVjMEyDsFjcuU/22g7xbMHzW05q0UzfEWQt 6wT3TR5U15RS8+50C6yYykftVNpLA09tGrzdPZ36rGt/1OdL1w7GdbozOMSqQM77jAOh KMC9q9Lhqmerz0qeEeNKJzGyZXiq5fGLr4aPEFjH9fkrU++NhUbg3KhjexwRt0fvurRS 3HR+cFIb14NPOjjJjQ9QA4qb+YymcZqKOCZ8DGJqSHrrweoxhjomirXqJOOM1u2fhfll xJqKKXhUfsxEWhoxwk2MTziae/5Fyc/abf7jgtUQ4b3Ow6lyzEYjo/vWb3J3LlCksf29 HP5g== 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=JUJDwGOKdYhdNLxCpRlx9p9Lfa9xqwLP/yuuSjZCLLA=; b=V1Xs6wNnm/+ZHmTUglUzx96M2JLQxqRooPdFYxLUSBs/fRyxzZYNRZUmrP6UA6yE8t nrLSLK57Gsve9E0WHxvN0nfFMrLR2JT9Jm05Y0h32XpOYsbAVh6hGG4xXJ/X/MmFO8MN EjKw57N7k6mzxNOMpGf/o+5m276aVSuyZYlmw+AfDFR7EXSSg3X5OpGtce4e1CtgjC2X viVnED37V9EnrBCTeQRrHjxQRiblmkZboviQtclRPXf1iPB2eaHO9gheM6Zq8twWE/Wk 8Xezv9D8lXK7UW6zsIT5wkOKISd37s851B7TWE25VvwiZUuci85kgWhoyOf53UogIjRO wZjg== X-Gm-Message-State: APjAAAVxvGHQ2wARmOx6WfDqYaL/CXyqqRdoYiVFCyfXqALCOW0K9r4X +Os5G70btjkMKtwDYmwqAxg5nEqYjJ0= X-Google-Smtp-Source: APXvYqwccccxUHo/0in4QTqaTymN+pAHx87a8YTrADGbXVKAtkK/74ysSVHpkkrFvWXz8TuTUqhOPg== X-Received: by 2002:a63:18e:: with SMTP id 136mr11718440pgb.277.1559339895114; Fri, 31 May 2019 14:58:15 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id m8sm6584796pje.14.2019.05.31.14.58.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 31 May 2019 14:58:14 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Fri, 31 May 2019 14:58:09 -0700 Message-Id: <1559339889-10053-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] rhel7.6: Support kmod build and load for mulitple 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 RHEL 7.6's new kernel 3.10.0-957.12.1.el7 introduced some ABI changes. This leads to an issue that OVS kernel module built against kernels newer than 12.1 cannot be loaded on systems running kernels older than 12.1, vice versa. By inspecting datapath/linux/openvswitch.mod.c, signatures of the following kernel functions have changed in 3.10.0-957.12.1.el7: nf_ct_get_tuple nf_ct_invert_tuplepr __nf_ct_l4proto_find This patch enables OVS to build kernel modules against multiple kernel versions and enables RHEL 7.6 system to load the compatible module at runtime. make rpm-fedora-kmod \ RPMBUILD_OPT='-D "kversion 3.10.0-957.10.1.el7.x86_64 \ 3.10.0-957.12.1.el7.x86_64"' Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- rhel/openvswitch-kmod-fedora.spec.in | 9 +++++---- rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh | 11 +++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/rhel/openvswitch-kmod-fedora.spec.in b/rhel/openvswitch-kmod-fedora.spec.in index dfa6f237f82d..92d763f5695b 100644 --- a/rhel/openvswitch-kmod-fedora.spec.in +++ b/rhel/openvswitch-kmod-fedora.spec.in @@ -12,8 +12,8 @@ # Use the kversion macro such as # RPMBUILD_OPT='-D "kversion 3.10.0-693.1.1.el7.x86_64 3.10.0-693.17.1.el7.x86_64"' # to build package for mulitple kernel versions in the same package -# This only works for kernel 3.10.0 major revision 693 (RHEL 7.4) -# and major revision 327 (RHEL 7.2) +# This only works for kernel 3.10.0 major revision 957 (RHEL 7.6), +# major revision 693 (RHEL 7.4) and major revision 327 (RHEL 7.2). # By default, build against the current running kernel version #%define kernel 3.1.5-1.fc16.x86_64 #define kernel %{kernel_source} @@ -91,8 +91,9 @@ if grep -qs "suse" /etc/os-release; then %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh fi elif [ "$mainline_major" = "3" ] && [ "$mainline_minor" = "10" ]; then - if [ "$major_rev" = "327" ] || [ "$major_rev" = "693" ]; then - # For RHEL 7.2 and 7.4 + if [ "$major_rev" = "327" ] || [ "$major_rev" = "693" ] || \ + [ "$major_rev" = "957" ]; then + # For RHEL 7.2, 7.4 and 7.6 if [ -x "%{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh" ]; then %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh fi diff --git a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh index 9c9f230b70d7..2cd8e5c80ef4 100644 --- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh +++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh @@ -17,11 +17,17 @@ # This script is intended to be used on the following kernels. # - 3.10.0 major revision 327 (RHEL 7.2) # - 3.10.0 major revision 693 (RHEL 7.4) +# - 3.10.0 major revision 957 (RHEL 7.6) # - 4.4.x, x >= 73 (SLES 12 SP3) # - 4.12.x, x >= 14 (SLES 12 SP4). # It is packaged in the openvswitch kmod RPM and run in the post-install # scripts. # +# For kernel 3.10.0-957, +# due to some backward incompatible changes introduced in minor revision 12.1, +# kernel modules built against kernels newer than 12.1 cannot be loaded on +# system running kernels older than 12.1, vice versa. +# # For kernel 3.10.0-693, # due to some backward incompatible changes introduced in minor revision 17.1, # kernel modules built against kernels newer than 17.1 cannot be loaded on @@ -79,6 +85,11 @@ if [ "$mainline_major" = "3" ] && [ "$mainline_minor" = "10" ]; then comp_ver=11 ver_offset=4 installed_ver="$minor_rev" + elif [ "$major_rev" = "957" ]; then +# echo "rhel76" + comp_ver=10 + ver_offset=4 + installed_ver="$minor_rev" fi elif [ "$mainline_major" = "4" ] && [ "$mainline_minor" = "4" ]; then if [ "$mainline_patch" -ge "73" ]; then