From patchwork Mon Jun 4 20:14:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 925209 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="EztE8UVo"; 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 4105kt1T2Qz9rxs for ; Tue, 5 Jun 2018 06:14:45 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D699FCC7; Mon, 4 Jun 2018 20:14: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 99871CC3 for ; Mon, 4 Jun 2018 20:14:42 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5F4C36FA for ; Mon, 4 Jun 2018 20:14:42 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id x9-v6so16577013pfm.2 for ; Mon, 04 Jun 2018 13:14: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=z2edr73XYblRXGtH9lAgGxXLCrVecJ6W5lrS6H85A88=; b=EztE8UVo1P7yWxfgLKiJTx906lcXxGPQhy6H83gDMZc8BI8j3zmko1SGSFhUXH6Tgu BaYP2LCBYnIBXqIOr+OPTxTi+4Gr9tbFVSTm8JjRQserl6Wk+/nRX57kQ9Ox7n6sX3gN EhodfdOOeRoz+xkf4CRjnln9bWjsvLts5myWVivgyOvkfez/yovN5FnCVQSUfzrc10qu wi+KRLI65c0LAI7te5aaoYEOX70gVpJDqKgCyJ7gvgAyRWgWTFvpyy4gn/9vQJAVLrMt FRyde2PH8mEe1W4HJiIlYMpsgiz4RtNiJCBHwxJZ7+44DTxeZ4sgBz7ZGsb5CJvpfe96 njuA== 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=z2edr73XYblRXGtH9lAgGxXLCrVecJ6W5lrS6H85A88=; b=lzaHzVAcMUrztM4xD+QV6jSAUc+mNBRZuYpL7H43vwluG59R+wsr/PmOi3w7HodG3B Ri6p9blTB/XL6GlU3QFQvP0nv0iCebBhZgfD7ES+5zGGyT2F7u+wqJLo4NoOWYu4/A2O rkwnBE50jtM0fUCeQcv9my6olXy0Ibfr/cuscjd3WOZFxsjteWhP0yQ9PSwrOwT0b33y 8fEW79hdETcgBf35UkSiRtYOC1+plxFKRKCngKcqzlM9TVtBD5d8WdeBAcnuGMBQwa7q jHRfcGWkBw/AYkyBqbjSYajsX8ahmAd5fAwyJh8CFD4DGsqMvONgqBBPQbdJb+oOs5DG iOpQ== X-Gm-Message-State: ALKqPwfDdwWjZZlTfS+nPSE29rnJP6XBqwFM/ZW6COWbFN/rgF4VZa54 PV3GI+O6nr+0XNdvuhbfdn3Pog== X-Google-Smtp-Source: ADUXVKINVcAKJeTVaZVBcXUVPGbzNYFMlzGJ9cqc4Go49o4uOD0WwxN0XMSg90rR+qH9Hwi333WAHA== X-Received: by 2002:a63:7b4e:: with SMTP id k14-v6mr18287042pgn.261.1528143281733; Mon, 04 Jun 2018 13:14:41 -0700 (PDT) Received: from gizo.domain ([97.115.155.245]) by smtp.gmail.com with ESMTPSA id t3-v6sm13831083pfk.161.2018.06.04.13.14.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 13:14:41 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Mon, 4 Jun 2018 13:14:36 -0700 Message-Id: <1528143278-982-1-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,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 1/3] Revert "dpif: Ensure ERSPAN GRE support" 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 reverts commit 8929c55287abae37efeac1e8876e6b3c2ccad0b9. This is the wrong direction for the solution to the ip_gre/gre kernel module conflicts. Signed-off-by: Greg Rose Acked-by: William Tu --- lib/dpif-netlink-rtnl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c index 197cfb6..bec3fce 100644 --- a/lib/dpif-netlink-rtnl.c +++ b/lib/dpif-netlink-rtnl.c @@ -45,8 +45,8 @@ VLOG_DEFINE_THIS_MODULE(dpif_netlink_rtnl); #ifndef IFLA_GRE_MAX #define IFLA_GRE_MAX 0 #endif -#if IFLA_GRE_MAX < 24 -#define IFLA_GRE_ERSPAN_HWID 24 +#if IFLA_GRE_MAX < 18 +#define IFLA_GRE_COLLECT_METADATA 18 #endif #ifndef IFLA_GENEVE_MAX @@ -74,7 +74,7 @@ static const struct nl_policy vxlan_policy[] = { [IFLA_VXLAN_GPE] = { .type = NL_A_FLAG, .optional = true }, }; static const struct nl_policy gre_policy[] = { - [IFLA_GRE_ERSPAN_HWID] = { .type = NL_A_U16 }, + [IFLA_GRE_COLLECT_METADATA] = { .type = NL_A_FLAG }, }; static const struct nl_policy geneve_policy[] = { [IFLA_GENEVE_COLLECT_METADATA] = { .type = NL_A_FLAG }, @@ -207,7 +207,7 @@ dpif_netlink_rtnl_gre_verify(const struct netdev_tunnel_config OVS_UNUSED *tnl, err = rtnl_policy_parse(kind, reply, gre_policy, gre, ARRAY_SIZE(gre_policy)); if (!err) { - if (!nl_attr_get_u16(gre[IFLA_GRE_ERSPAN_HWID])) { + if (!nl_attr_get_flag(gre[IFLA_GRE_COLLECT_METADATA])) { err = EINVAL; } } @@ -328,7 +328,7 @@ dpif_netlink_rtnl_create(const struct netdev_tunnel_config *tnl_cfg, case OVS_VPORT_TYPE_ERSPAN: case OVS_VPORT_TYPE_IP6ERSPAN: case OVS_VPORT_TYPE_IP6GRE: - nl_msg_put_u16(&request, IFLA_GRE_ERSPAN_HWID, 0xdead); + nl_msg_put_flag(&request, IFLA_GRE_COLLECT_METADATA); break; case OVS_VPORT_TYPE_GENEVE: nl_msg_put_flag(&request, IFLA_GENEVE_COLLECT_METADATA); From patchwork Mon Jun 4 20:14:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 925210 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="i+m3cdrX"; 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 4105lH3DT4z9rxs for ; Tue, 5 Jun 2018 06:15:07 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C7B2ECD8; Mon, 4 Jun 2018 20:14:44 +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 673F5CCD for ; Mon, 4 Jun 2018 20:14:43 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 33B256FA for ; Mon, 4 Jun 2018 20:14:43 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id d2-v6so4314867pga.13 for ; Mon, 04 Jun 2018 13:14:43 -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=hXzHdk+jJvuY1PWgld1Y1+9HjBi4BJrL9eS8nQ8yVMw=; b=i+m3cdrXQqkolJyCdynHGkRWRdpA/b+SnwexodibzL+8psaKRVOdcsuYbSfTpepjAP RHHdTSnAqAn/uiafiF77dSWpU3maFLztcz9KqvrS71uswQ17txVGW10XmWtKO1lN93mA Ssqh3zEWf6pUIrqmbTTSx10t0T5XSb2+up+ewdWaOFb2vTxKcTMkaOXD6fCI89Gl2R1T ushGB2Z+j8xVJD73wwPgPTvY6UpsEkN6u40xGdb1aAu5jXcUSGcfsU1BJpD1OLGy5+Ej ElnLCcx5+pcj0tr++7pBHqNdCRZqiU5liqoSPmZXwQ+xaS1kDPQhoZcXqOHoUPWbB7BY T6Wg== 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=hXzHdk+jJvuY1PWgld1Y1+9HjBi4BJrL9eS8nQ8yVMw=; b=pcSw4k20U7uDiwZ7LT+70QxzdGM95yB8gpJGuW4ET0DB3JAn79ObhcH+Fi6CCbkSgW Qt4X//5igeteqIAqV4DHcoHJ8eNeaLqH7iH4mcGhq5zV5Phu0QibQw+DnvGkqFpE7rUX zdf4IimAPJjeMmCopHcOE7Nqh37MxsE0PmKPX/YB6FoodXj489QWf58KRiEvE876ppTB rAU2Py7iqZdpwuhIaBvjxRxsnNmvHrKxcrU5MlQFHhZftjV4u9wIrmsjzkOP6g3lYliq AlooKFhCW90bgB6QxXhJqOwgX3i0SKKGNBYrTgsPYvVDcB2UrN190kbjhQ2Hln1QmBnA VrtQ== X-Gm-Message-State: ALKqPweH/HLmO3TOD5njKZa+o2MhY5/dzVzLUMV+TAomfWs93OGYSEj9 Pi++e2ZBfDsC3spRYWkoEYBvww== X-Google-Smtp-Source: ADUXVKKOaA5zI5+YQ65WsS5+vjjsFm2A4OXKZEwMwvAWnXY4gctRLXtisdDoRq4/SaFLu7GQQsZ41w== X-Received: by 2002:a63:721c:: with SMTP id n28-v6mr10807115pgc.96.1528143282564; Mon, 04 Jun 2018 13:14:42 -0700 (PDT) Received: from gizo.domain ([97.115.155.245]) by smtp.gmail.com with ESMTPSA id t3-v6sm13831083pfk.161.2018.06.04.13.14.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 13:14:42 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Mon, 4 Jun 2018 13:14:37 -0700 Message-Id: <1528143278-982-2-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1528143278-982-1-git-send-email-gvrose8192@gmail.com> References: <1528143278-982-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,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 2/3] Revert "utilities/ovs-ctl: Force removal of ip_gre/gre" 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 reverts commit 2bdd1f3d96a86bea6bdb8788f23ec7dd99b289e3. Rather than attempting to force the removal of the ip_gre/gre kernel modules, which often fails because they're in use, we will add a patch that does not cause the openvswitch kernel module to fail to load when the ip_gre/gre protocol entry points are already claimed. Signed-off-by: Greg Rose Acked-by: William Tu --- utilities/ovs-lib.in | 8 -------- 1 file changed, 8 deletions(-) diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 5ba4f8b..4c3ad0f 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in @@ -622,14 +622,6 @@ force_reload_kmod () { action "Removing $vport module" rmmod $vport done - if test -e /sys/module/ip_gre; then - action "Forcing removal of ip_gre module" rmmod ip_gre - fi - - if test -e /sys/module/gre; then - action "Forcing removal of gre module" rmmod gre - fi - if test -e /sys/module/openvswitch; then action "Removing openvswitch module" rmmod openvswitch fi From patchwork Mon Jun 4 20:14:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 925211 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="Okp/9W3T"; 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 4105lv6ljGz9rxs for ; Tue, 5 Jun 2018 06:15:39 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 141DBD0D; Mon, 4 Jun 2018 20:14:47 +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 A29FCCE1 for ; Mon, 4 Jun 2018 20:14:44 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4114A6FA for ; Mon, 4 Jun 2018 20:14:44 +0000 (UTC) Received: by mail-pl0-f66.google.com with SMTP id c23-v6so9077535plz.12 for ; Mon, 04 Jun 2018 13:14:44 -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=iJWYDSve6YZb57PFM/lTfXuzA53Q1Y2rEpERdgiep5E=; b=Okp/9W3ThZoUz8sSinMWollsRtKo5m2HpH8AmguCMrK3V8TDS3niWGnTUoonk1t8Cs D0DiRxxTGnSdi724ZUVAgD8mMGEjcm+Y8Bi2Ri/IXnq1g3V5izMXKUeO/wN29G1tUwjR 91qXrQ8dvhGIRDRdOPjHBf8jKZK3MhuexJ7Poe4f72bMb+6STftdUmlzSPxc0/zYAdaP xzqKIJjC5tDKilqf6R2c3GKwn3Iy6BJR0N1RqAuGXfmfwkLr/Q/tmHvwJM9wKKd5E5HB MUeAIoY5YJOR26rVorxK1WBSvN4aweYIdLoMpOP8d/0t9pRmG1IsMJNerw3ySxny1ziE MSBg== 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=iJWYDSve6YZb57PFM/lTfXuzA53Q1Y2rEpERdgiep5E=; b=bi3NGhOHhvf6oIV1jNvMYhNR0sGu6SuxCKEz3qzib9hcvaMor4lqzN4J4qpfLnGVUr XgFQMU7rt6K4LR5dw+K1SrimdtuT9+Ot01xz7uy+ulNt0n9wsZzB66nbN+dEhwCuQ/Fm CGrXI4+mscot+J0KyE0HfEF1PD4ohhHqM+5Baf7kydcudxMDoFGpvNLYFKkQIbYtxe7V zW9zYmHnRJc3FrnVcnGmBGEb2iQ/q6zWScsLlllyHl4YenP4726Txi3hS+For6+TrDQI 54D86+GJvKT+OnIVMB2MjN9XkHBe9KXFi6VUoViriQNUoxirU25pOXJa2BkALmKM1cFv z2ww== X-Gm-Message-State: ALKqPwcB2ThcQCy7XAWOgKXs7QLjQf0yyjY902OBvSdCC+0SOCcUYL7B gTBg21l2AaCe+i7iU8iHQojzLA== X-Google-Smtp-Source: ADUXVKLEwLiDH6fgPAscXwX0ILJYn+cv6hOztH5gCPSw+oD2l5piPL4biiN5YvRkEdlEsIcbvD7bXg== X-Received: by 2002:a17:902:1703:: with SMTP id i3-v6mr23428749pli.263.1528143283632; Mon, 04 Jun 2018 13:14:43 -0700 (PDT) Received: from gizo.domain ([97.115.155.245]) by smtp.gmail.com with ESMTPSA id t3-v6sm13831083pfk.161.2018.06.04.13.14.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 13:14:42 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Mon, 4 Jun 2018 13:14:38 -0700 Message-Id: <1528143278-982-3-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1528143278-982-1-git-send-email-gvrose8192@gmail.com> References: <1528143278-982-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,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 3/3] datapath: Do not fail to load on gre protocol conflict 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 The ERSPAN feature depends on the gre kernel module so on systems where the ERSPAN feature isn't supported the openvswitch kernel module would attempt to grab the ipv4 GRE protocol entry point and would fail to load if it could not. This patch modifies openvswitch to not fail to load when the gre kernel module is loaded and instead it will print a warning message to the kernel system log indicating that the ERSPAN feature may not be available. We need this patch because users are experiencing failures due to the conflicts and high priority bugs are resulting. Signed-off-by: Greg Rose Acked-by: William Tu --- datapath/linux/compat/gre.c | 2 +- datapath/vport.c | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/datapath/linux/compat/gre.c b/datapath/linux/compat/gre.c index 7f2b545..2b14c5a 100644 --- a/datapath/linux/compat/gre.c +++ b/datapath/linux/compat/gre.c @@ -127,7 +127,7 @@ int rpl_gre_init(void) if (inet_add_protocol(&net_gre_protocol, IPPROTO_GRE) < 0) { pr_err("can't add protocol\n"); - return -EAGAIN; + return -EEXIST; } return 0; } diff --git a/datapath/vport.c b/datapath/vport.c index 73dd778..56096ef 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -42,6 +42,7 @@ #include "vport-internal_dev.h" static LIST_HEAD(vport_ops_list); +static bool compat_gre_loaded = false; /* Protected by RCU read lock for reading, ovs_mutex for writing. */ static struct hlist_head *dev_table; @@ -64,9 +65,17 @@ int ovs_vport_init(void) err = lisp_init_module(); if (err) goto err_lisp; - err = ipgre_init(); - if (err) - goto err_ipgre; + err = gre_init(); + if (err && err != -EEXIST) + goto err_gre; + else if (err == -EEXIST) + pr_warn("Cannot take GRE protocol entry - The ERSPAN feature may not be supported\n"); + else { + err = ipgre_init(); + if (err && err != -EEXIST) + goto err_ipgre; + compat_gre_loaded = true; + } err = ip6gre_init(); if (err) goto err_ip6gre; @@ -82,12 +91,8 @@ int ovs_vport_init(void) err = ovs_stt_init_module(); if (err) goto err_stt; - err = gre_init(); - if (err) - goto err_gre; return 0; -err_gre: ovs_stt_cleanup_module(); err_stt: vxlan_cleanup_module(); @@ -100,6 +105,8 @@ err_ip6_tunnel: err_ip6gre: ipgre_fini(); err_ipgre: + gre_exit(); +err_gre: lisp_cleanup_module(); err_lisp: kfree(dev_table); @@ -113,13 +120,15 @@ err_lisp: */ void ovs_vport_exit(void) { - gre_exit(); + if (compat_gre_loaded) { + gre_exit(); + ipgre_fini(); + } ovs_stt_cleanup_module(); vxlan_cleanup_module(); geneve_cleanup_module(); ip6_tunnel_cleanup(); ip6gre_fini(); - ipgre_fini(); lisp_cleanup_module(); kfree(dev_table); }