From patchwork Tue Oct 20 17:07:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1385097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.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.a=rsa-sha256 header.s=20161025 header.b=jWU7OfUN; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CG0RZ41LRz9sPB for ; Wed, 21 Oct 2020 04:07:22 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B789887374; Tue, 20 Oct 2020 17:07:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1QfUYROraq-v; Tue, 20 Oct 2020 17:07:20 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 1B0C887366; Tue, 20 Oct 2020 17:07:20 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E7ECAC0895; Tue, 20 Oct 2020 17:07:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 922F1C0052 for ; Tue, 20 Oct 2020 17:07:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7DEAC87238 for ; Tue, 20 Oct 2020 17:07:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bzpBcqJzTFl8 for ; Tue, 20 Oct 2020 17:07:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by hemlock.osuosl.org (Postfix) with ESMTPS id EB3D887236 for ; Tue, 20 Oct 2020 17:07:15 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id r10so1352026plx.3 for ; Tue, 20 Oct 2020 10:07: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:in-reply-to:references; bh=5l7VFl0JcJ1v4oCbZgJ7PREaYimeUMyc5RmS6MHTG68=; b=jWU7OfUN5f3KZvgTdcmbTnRDEnIkBoChtKMFUL9vugf7+EFGxvoiChTp1jecZSuTRK yzWpQQNYgTmneiBFcp3sxbZCVeotUiigkEd0bwWEKGm3vQHgmeDXhmgDxyiPyoSlG0hh tioUwQdDkiu+8rqhUVq3bQo11BLb0zKJD1cr9pqhT1w/7bYbE9YlsBJx5ZpncLka7yc3 M8BQ8/pr+PkFOWInBp870TK0CoFXXA5QggYdOqI+UGOWhNItURzly/c6WJVYFbDvPUfX pMwrVn5xN4BxuXgqo2ab+XLJjRqoQaMRupjO9+ixqBy9R1U7rA0OcQnVyfJVZ1vWgAbb u8Ag== 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=5l7VFl0JcJ1v4oCbZgJ7PREaYimeUMyc5RmS6MHTG68=; b=AgTJW7gLZLdXytyccI+5zImTLvJ6tzgw74ksGswFQvDF0lg6P2PZ7zejdRwrRFGudo 6ORc8RqQSex1dm8FKJxhcEZKgYy+7WzoR7MFrDhz8o3vA22CA3sI83mBGj+Gh9GEfcaY 7HQtOSh8HZj8A6gTqyB2HeeZRFxdDnR/QhY/S3YF1hx2vi5DuJXxmTi2b4E07ad1yJbC whK4Qwz9BHZlImGQe0xyxw7vnIrerPyXpe3o0C8iFpPanKLqpvCvDZe1/Q5x63/x8dcR hEl0zhhXymtdi7ntW//bE7ya1DiYKrEGxVbJi97VocXAn7dKTN3/1VPEsUCW2ovolQFW 540A== X-Gm-Message-State: AOAM531Qg8QyYj5ZGrjthC5OXHmkfUkEOZMiYnaY79ZXWuChhax0H+91 pzNkm90AE0kgDNhOL7qTR/aKq/ZZMqk= X-Google-Smtp-Source: ABdhPJzJZp1f0+dyhXd6hK2SOtkorpk07ZB4fPK/kCawWk/NJARseotoUAi3DQPvE6d209q8Sn/SXA== X-Received: by 2002:a17:902:a5c5:b029:d5:dc92:49e7 with SMTP id t5-20020a170902a5c5b02900d5dc9249e7mr927429plq.25.1603213635267; Tue, 20 Oct 2020 10:07:15 -0700 (PDT) Received: from VMware-box.domain (97-115-80-55.ptld.qwest.net. [97.115.80.55]) by smtp.googlemail.com with ESMTPSA id w4sm2449670pjh.50.2020.10.20.10.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 10:07:14 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Tue, 20 Oct 2020 10:07:04 -0700 Message-Id: <20201020170705.30946-2-gvrose8192@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201020170705.30946-1-gvrose8192@gmail.com> References: <20201020170705.30946-1-gvrose8192@gmail.com> Cc: fbl@sysclose.org, i.maximets@ovn.org Subject: [ovs-dev] [PATCH 1/2] compat: Fix build issue on RHEL 7.7 X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" RHEL 7.7 has a KABI fixup in struct sk_buff to backport the member name change of l4_rxhash to l4_hash. This exposed a couple of issues in patch 8063e0958780 which was intended to remove support for kernels older than 3.10. Remove stale code and add a compat level check to detect the change. This fixes a compile error on RHEL 7.7. Fixes: 8063e0958780 ("datapath: Drop support for kernel older than 3.10") Signed-off-by: Greg Rose --- acinclude.m4 | 4 ++-- datapath/datapath.c | 2 +- datapath/linux/compat/include/linux/percpu.h | 6 ------ datapath/linux/compat/include/linux/skbuff.h | 4 +++- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 1460289ca..8e80d7930 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -879,6 +879,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_DEFINE([HAVE_SKB_ZEROCOPY])]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u8.*l4_rxhash], [OVS_DEFINE([HAVE_L4_RXHASH])]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u8.*l4_hash], + [OVS_DEFINE([HAVE_L4_HASH])]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_ensure_writable]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_vlan_pop]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [__skb_vlan_pop]) @@ -975,8 +977,6 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/net/sock.h], [sk_no_check_tx]) OVS_GREP_IFELSE([$KSRC/include/linux/udp.h], [no_check6_tx]) - OVS_GREP_IFELSE([$KSRC/include/linux/utsrelease.h], [el6], - [OVS_DEFINE([HAVE_RHEL6_PER_CPU])]) OVS_FIND_PARAM_IFELSE([$KSRC/include/net/protocol.h], [udp_add_offload], [net], [OVS_DEFINE([HAVE_UDP_ADD_OFFLOAD_TAKES_NET])]) diff --git a/datapath/datapath.c b/datapath/datapath.c index 52a59f135..09fb3b1fc 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -529,7 +529,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, hash |= OVS_PACKET_HASH_SW_BIT; #endif -#ifdef HAVE_L4_RXHASH +#if defined(HAVE_L4_RXHASH) && !defined(HAVE_L4_HASH) if (skb->l4_rxhash) #else if (skb->l4_hash) diff --git a/datapath/linux/compat/include/linux/percpu.h b/datapath/linux/compat/include/linux/percpu.h index 7c346aa31..a039142e2 100644 --- a/datapath/linux/compat/include/linux/percpu.h +++ b/datapath/linux/compat/include/linux/percpu.h @@ -7,12 +7,6 @@ #define this_cpu_ptr(ptr) per_cpu_ptr(ptr, smp_processor_id()) #endif -#ifdef HAVE_RHEL6_PER_CPU -#undef this_cpu_read -#undef this_cpu_inc -#undef this_cpu_dec -#endif - #if !defined this_cpu_read #define this_cpu_read(ptr) percpu_read(ptr) #endif diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h index 204ce5497..94479f57b 100644 --- a/datapath/linux/compat/include/linux/skbuff.h +++ b/datapath/linux/compat/include/linux/skbuff.h @@ -278,8 +278,10 @@ static inline void skb_clear_hash(struct sk_buff *skb) #ifdef HAVE_RXHASH skb->rxhash = 0; #endif -#if defined(HAVE_L4_RXHASH) && !defined(HAVE_RHEL_OVS_HOOK) +#if defined(HAVE_L4_RXHASH) && !defined(HAVE_L4_HASH) skb->l4_rxhash = 0; +#else + skb->l4_hash = 0; #endif } #endif