From patchwork Thu Sep 17 19:59:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1366395 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.136; helo=silver.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=gmcFe+wr; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BsnqH12rpz9ryj for ; Fri, 18 Sep 2020 05:59:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 70FCF2E1B3; Thu, 17 Sep 2020 19:59:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tEfhDo-dJ4Np; Thu, 17 Sep 2020 19:59:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id DF1332000F; Thu, 17 Sep 2020 19:59:16 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C5534C0859; Thu, 17 Sep 2020 19:59:16 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id D4D9FC0051 for ; Thu, 17 Sep 2020 19:59:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D0B4D875B6 for ; Thu, 17 Sep 2020 19:59:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ic7ukJqMA88F for ; Thu, 17 Sep 2020 19:59:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id 65EEE873AE for ; Thu, 17 Sep 2020 19:59:14 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id kk9so1763679pjb.2 for ; Thu, 17 Sep 2020 12:59:14 -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=WcoEPtdzbDo4erJ+Iv4ahK1eZ0EtlY2cwlsKMz9XzQ0=; b=gmcFe+wrBS2AaVigmW9I5v75Acw9j2yHal5AlMbIn80a0iDZrN0G4fDI1pjmg4n8vk ExJL5UBeTPZFGg0ASMlSr6R3YvZN4l4nGypJtQmojPcW/yX+LqPyVXnNaNk9G2krpyoW B12NWUC0GJVUE6uWmTG1l+ffIebMRTgV9Ap/pnR/qGfMiBbWTvXTGRCvojbX/8QDbuyG YImjxbx7h4W+B0N7F0++Bxu/3hZdHLvXdJYmq/ZX4evs+IxmZfx/kKHEpAzw+hKQkZWK ULtDNKj6syTFdAXT5Rcv3gkUEfBK12t3l8Jo9Px3QlEFWTlQA6OMNmZaJl4mTLr1zFfe TkcA== 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=WcoEPtdzbDo4erJ+Iv4ahK1eZ0EtlY2cwlsKMz9XzQ0=; b=Bpnhm/1ccy3SSf+M6hmGF/Iidkk8K+bCVWQjuTdQiLehTnsIJfangST3OQcseXH4B7 7+fotA8gRDyoGRyl1QQWuKoJrI7hxyLcuvmgOpB6zn3DzmUgoEbHGCfGdWgvmXH5yp3o /Kax7rfM8UkdaUGxZxtKwGGd/EyIxvCdYbB+2fEU/rvJarP0CWtGYt6TlZPmKOBwOkBE VQAIHfza6zmjN2HpO6Lzltmz+Fn7Dj241KC0EQbhMcbBDKAjc5kSI+PWNOAgC0Db7Dm8 CyCMc/2xkpu2+uaN4ZJT6rqbxjk5NCetOY4l1TANo5sV7F+psQGuZxPMy1l3974baiiN 9/Gg== X-Gm-Message-State: AOAM5319cmhfGSE9jHr0XWvJCB8Kkp1REvMyIMHVyvZT5P0NJmHg5INE eEpjD0gfabtGKCoD6rxiqK0tu5CL0nXoUw== X-Google-Smtp-Source: ABdhPJxTGmYJ/fQZZvn6noZ0uR4xPZ/ii2Ip3XXxyszh4nHWgtdzqghhzwUdL+DZMsuNoyQ3ai0g0g== X-Received: by 2002:a17:90a:cb93:: with SMTP id a19mr7766724pju.207.1600372753689; Thu, 17 Sep 2020 12:59:13 -0700 (PDT) Received: from VMware-box.domain ([97.115.183.169]) by smtp.googlemail.com with ESMTPSA id y13sm419466pgs.53.2020.09.17.12.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 12:59:13 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Thu, 17 Sep 2020 12:59:05 -0700 Message-Id: <20200917195905.10423-1-gvrose8192@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [ovs-dev] [PATCH] compat: Replace the HAVE_L4_RXHASH define with HAVE_L4_HASH 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" The skb now uses l4_hash and it is easier to check for it. Also fixes a compile error for RHEL 7.7. Signed-off-by: Greg Rose --- acinclude.m4 | 4 ++-- datapath/datapath.c | 6 +++--- datapath/linux/compat/include/linux/skbuff.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 84f344da0..d4e249dac 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -874,8 +874,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_clear_hash]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [int.skb_zerocopy(], [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], [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]) diff --git a/datapath/datapath.c b/datapath/datapath.c index 05c1e4274..c3f57f62a 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -532,10 +532,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, hash |= OVS_PACKET_HASH_SW_BIT; #endif -#ifdef HAVE_L4_RXHASH - if (skb->l4_rxhash) -#else +#ifdef HAVE_L4_HASH if (skb->l4_hash) +#else + if (skb->l4_rxhash) #endif hash |= OVS_PACKET_HASH_L4_BIT; diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h index 6d248b3ed..29253e433 100644 --- a/datapath/linux/compat/include/linux/skbuff.h +++ b/datapath/linux/compat/include/linux/skbuff.h @@ -278,7 +278,7 @@ 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_HASH) && !defined(HAVE_RHEL_OVS_HOOK) skb->l4_rxhash = 0; #endif } @@ -465,7 +465,7 @@ __skb_set_hash(struct sk_buff *skb, __u32 hash, bool is_sw, bool is_l4) #else skb->hash = hash; #endif -#if defined(HAVE_L4_RXHASH) +#if !defined(HAVE_L4_HASH) skb->l4_rxhash = is_l4; #else skb->l4_hash = is_l4;