From patchwork Fri Oct 6 11:08:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 822731 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 3y83276LWGz9t2Z for ; Sat, 7 Oct 2017 08:39:42 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 5E85EACB; Fri, 6 Oct 2017 21:39:40 +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 2CD22A59 for ; Fri, 6 Oct 2017 21:39:39 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9680F151 for ; Fri, 6 Oct 2017 21:39:38 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id i23so17713516pfi.2 for ; Fri, 06 Oct 2017 14:39:38 -0700 (PDT) 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=SWqBOesRtVvtQGXBjinDHJZo3X3+BxDmLjhpfEO0LwQ=; b=e+7saz+LBZs16G7Uetf/Q8B/TV1wXslKZYhVHSPdeUF1E5mLpi+GE/oeWNipOOCTf6 Nsn08jNQBaFl4+evDoiMqJqEKUECRQfUzCYGnKmCV2GIRWytiLhC85uajwCgLw9Qzwt0 RGzhE/fJYZiDY2KseylnkvhR7QKw1fRBoy8X1U2RAXizlXPsGuEijeqrq7C8lEZ1FoUU wnpxqgb8Z2vk1BgQcYeEsxhMGipRiG5UcuXOIBMWOGwK62JW4Dc5b+UG0UEPRPGGqC2M UitX6gGQ8l4nv5KNdWhwc3RT18OG5k/CmqSnf36rGZeLr0+C2y8thvg58LbAsYUaEhjk UI+A== X-Gm-Message-State: AMCzsaVSbk2N2W4uUqb0Rar4YFO+Ai7wsBtJB3JWZol3UIa/GlYN6mKx vhNs9tzEuE7qoixXfmo1gvtxpw== X-Google-Smtp-Source: AOwi7QD0YkN4kl18bWNwJcLjM04i6Ty5NWlG5wGgydq7uDYeoUzXi9VQv65LmvvaEjEWBHr6CzN/6A== X-Received: by 10.99.117.65 with SMTP id f1mr3135932pgn.104.1507325977824; Fri, 06 Oct 2017 14:39:37 -0700 (PDT) Received: from ubuntu.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id b7sm3991707pge.79.2017.10.06.14.39.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Oct 2017 14:39:36 -0700 (PDT) From: Gurucharan Shetty To: dev@openvswitch.org Date: Fri, 6 Oct 2017 04:08:22 -0700 Message-Id: <1507288103-16077-1-git-send-email-guru@ovn.org> X-Mailer: git-send-email 1.9.1 X-Spam-Status: No, score=1.6 required=5.0 tests=DATE_IN_PAST_06_12, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 1/2] ovs-ctl.in: Call 'hostname -f' after vswitchd starts. 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 Currently we call 'hostname -f' when ovs-vswitchd is not running. If you are using ovs-vswitchd to provide your primary networking, then 'hostname -f' will "hang" till it times out. On the system this issue was discovered, this was as long as 40 seconds. This is a problem during OVS restarts or upgrades. This commit calls 'hostname -f' after ovs-vswitchd has started. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- utilities/ovs-ctl.in | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index dc1d02c..97c3c09 100755 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -75,6 +75,12 @@ ovs_vsctl () { ovs-vsctl --no-wait "$@" } +set_hostname () { + # 'hostname -f' needs network connectivity to work. So we should + # call this only after ovs-vswitchd is running. + ovs_vsctl set Open_vSwitch . external-ids:hostname=$(hostname -f) +} + set_system_ids () { set ovs_vsctl set Open_vSwitch . @@ -108,8 +114,6 @@ set_system_ids () { esac set "$@" external-ids:system-id="\"$SYSTEM_ID\"" - set "$@" external-ids:hostname="\"$(hostname -f)\"" - set "$@" external-ids:rundir="\"$rundir\"" if test X"$SYSTEM_TYPE" != X; then @@ -382,6 +386,7 @@ force_reload_kmod () { else log_warning_msg "Failed to save configuration, not replacing kernel module" start_forwarding + set_hostname add_managers exit 1 fi @@ -405,6 +410,7 @@ force_reload_kmod () { # Start vswitchd by asking it to wait till flow restore is finished. flow_restore_wait start_forwarding || return 1 + set_hostname # Restore saved flows and inform vswitchd that we are done. restore_flows @@ -438,6 +444,7 @@ restart () { # Start vswitchd by asking it to wait till flow restore is finished. flow_restore_wait start_forwarding || return 1 + set_hostname # Restore saved flows and inform vswitchd that we are done. restore_flows @@ -695,6 +702,7 @@ case $command in start) start_ovsdb || exit 1 start_forwarding || exit 1 + set_hostname add_managers ;; stop) From patchwork Fri Oct 6 11:08:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 822732 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 3y832p4J7Fz9t2Z for ; Sat, 7 Oct 2017 08:40:18 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 3A3FFB75; Fri, 6 Oct 2017 21:39:41 +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 210E0A59 for ; Fri, 6 Oct 2017 21:39:40 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id CCB11433 for ; Fri, 6 Oct 2017 21:39:39 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id a7so17703239pfj.5 for ; Fri, 06 Oct 2017 14:39:39 -0700 (PDT) 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:in-reply-to :references; bh=Xp6wN1H3ZVIddJN82pqqwsedc2IzuRG7ImeAuJ2OuWo=; b=R1N8GXh5TiNb+wgqXIX0GH9iv47rEHDiU3U6neUVG08TYJOS+UYTh6R8BwN1iv/fAW c+DQf813OJEnnppUqzw8R7dFoNYbksuT34De3KggT6/kD8mpTNR1/8xZb+cksRAq4bnV urjx742yrJA65T6A0WUin2V3z65IaCQv+WidovUxxy0MwQh9nuPeZNQSvlMvp256ost8 vjangaHzWM0i64VLKMy+JiK8OXBBMmJD0pYYx+Ssk3IHm34s5esnAacOvPoVgB+DtWsX BH1pJsRLjzdxD3nfwDpZarYBSmjpMimgtISuH6YSvopFOUlVefK7gWJGWcOI9oyY1CT3 h7mA== X-Gm-Message-State: AMCzsaUR08+HHzuz7dRZnHeGgFtQdMlppT4U9HAbMOzLhRafWLt9ddzG GSkHmieLInSSCwypJY7g2ayseg== X-Google-Smtp-Source: AOwi7QDn7keS/eEcVlNcMJy4KnwI/ZgyTwdYQWObbdIGc0Rw3f1mpA0mvmzaZrP2mkEGeJ0SKo2vZA== X-Received: by 10.99.139.195 with SMTP id j186mr3082960pge.231.1507325979057; Fri, 06 Oct 2017 14:39:39 -0700 (PDT) Received: from ubuntu.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id b7sm3991707pge.79.2017.10.06.14.39.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Oct 2017 14:39:38 -0700 (PDT) From: Gurucharan Shetty To: dev@openvswitch.org Date: Fri, 6 Oct 2017 04:08:23 -0700 Message-Id: <1507288103-16077-2-git-send-email-guru@ovn.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507288103-16077-1-git-send-email-guru@ovn.org> References: <1507288103-16077-1-git-send-email-guru@ovn.org> X-Spam-Status: No, score=1.1 required=5.0 tests=DATE_IN_PAST_06_12, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.1 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 2/2] rhel: Skip systemctl redirect. 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 We still use SysV scripts for RHEL. Currently, invoking /etc/init.d/openvswitch will redirect the calls to dynamically generated systemd scripts. In the above case when you call "/etc/init.d/openvswitch-switch start", it inturn calls "/bin/systemctl start openvswitch-switch.service" and that inturn again calls "/etc/init.d/openvswitch-switch start" This patch avoids it. This is similar to what was done to Debian in commit 873d85653d8 (debian: Skip systemctl redirect.) Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- rhel/etc_init.d_openvswitch | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rhel/etc_init.d_openvswitch b/rhel/etc_init.d_openvswitch index 3921aab..caf24cc 100755 --- a/rhel/etc_init.d_openvswitch +++ b/rhel/etc_init.d_openvswitch @@ -27,6 +27,8 @@ # Short-Description: Open vSwitch switch ### END INIT INFO +SYSTEMCTL_SKIP_REDIRECT=yes + . /usr/share/openvswitch/scripts/ovs-lib || exit 1 test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch