From patchwork Fri Nov 10 22:45:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 836957 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=) 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 3yYZqf1cyQz9sRW for ; Sat, 11 Nov 2017 09:45:18 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 84188ACA; Fri, 10 Nov 2017 22:45:15 +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 10D8FABA for ; Fri, 10 Nov 2017 22:45:14 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 65D8D1AD for ; Fri, 10 Nov 2017 22:45:13 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id b9so5379769wmh.5 for ; Fri, 10 Nov 2017 14:45:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=TywGJLafgVJMdOtjPk2a2YFLmaSkX/qJr9Cslhe7Xo8=; b=MYrh1sjKWFguzEWg851C05AA2GFr5M+FLWjp6vXZKbi3Z1/Dh/mkbaer/TUCcivVE/ iuAzkhhk1yJTKG1oD5joVDDfIz5C7S+1Ds7+xGDvQIN0zeAwCXZM3qmf1CM7WRyAoNGk ZRouA/p0ArBQl5TiSKA624HKXtORiRUFYjf0iF+Zjej1TnGn7dqmIG1ZovDyBIYygS5m auWTEQ0pcxAyUiqvvvbTHhi7hdUr5ZnjoAl1IWSEz00SDdlKPgp13F2jlxXjjPIj/2xY hcR5QtUYHZCw3O00DIVBDEK+SDCBcBfrf49q3bwAQfm4UEKsyX4z8ue4x8WruE0igB6r 8unw== X-Gm-Message-State: AJaThX6ghXFtqNt5Q8KVo31gSO3KaBgLQtAxWH4JOLFjdsodQN4+s/rD +/4GyviyqEoKPD3rt8csK7ZiZQ== X-Google-Smtp-Source: AGs4zMZu6X1tqwiQb3UYspWjz+1cRWfjDRiStehA2GuhmbpIEx5gFtH7ZJ7XbcOOrLgDSbcc+LN3qA== X-Received: by 10.80.177.182 with SMTP id m51mr2448710edd.181.1510353910989; Fri, 10 Nov 2017 14:45:10 -0800 (PST) Received: from ubuntu.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id q16sm9046937eda.87.2017.11.10.14.45.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Nov 2017 14:45:10 -0800 (PST) From: Gurucharan Shetty To: dev@openvswitch.org Date: Fri, 10 Nov 2017 14:45:05 -0800 Message-Id: <1510353905-1442-1-git-send-email-guru@ovn.org> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] ovs-ctl: Don't remember vport-* kernel modules 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 From OVS 2.8, ovs-vswitchd, when it starts, will load the kernel modules for tunnels. It has logic inside it to choose either upstream kernel module or vport-* kernel module. So, when we run 'force-reload-kmod' to upgrade to OVS 2.8 from a previous version, we do not need to remember the vport-* kernel module that was previously loaded. It is not really harmful to load vport-* kernel module though. On RHEL7.x and OVS 2.8, we use the upstream "geneve" kernel module for tunnels. But, on RHEL 7.x we have hit a bug caused by iptables startup script which tries to remove all kernel modules related to linux conntrack. It fails to unload openvswitch kernel module because it has a reference count on it. But it succeeds in unloading vport-geneve and in turn the upstream "geneve" kernel module. This causes the tunnels to go down. With this patch, we avoid the above situation, by not loading vport-geneve kernel module. ovs-vswitchd when it starts will load upstream geneve. And when "iptables stop" runs, since "geneve" has nothing to do with conntrack, it spares it. Ideally, we should fix this by incrementing the refcount on the kernel modules. Signed-off-by: Gurucharan Shetty Acked-by: William Tu --- utilities/ovs-ctl.in | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index 2e1209a..f1b01d1 100755 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -30,17 +30,9 @@ done ## start ## ## ----- ## -# Keep track of removed vports so we can reload them if needed -removed_vports="" - insert_mods () { # Try loading openvswitch again. action "Inserting openvswitch module" modprobe openvswitch - - for vport in $removed_vports; do - # Don't treat failures to load vports as fatal error - action "Inserting $vport module" modprobe $vport || true - done } insert_mod_if_required () { @@ -398,9 +390,6 @@ force_reload_kmod () { for vport in `awk '/^vport_/ { print $1 }' /proc/modules`; do action "Removing $vport module" rmmod $vport - if ! grep -q $vport /proc/modules; then - removed_vports="$removed_vports $vport" - fi done if test -e /sys/module/openvswitch; then