From patchwork Wed May 8 14:11:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 1097296 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=none (p=none dis=none) header.from=ovn.org 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 44zwct008tz9s55 for ; Thu, 9 May 2019 11:25:00 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 0D69BD8F; Thu, 9 May 2019 01:24:57 +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 698319D for ; Thu, 9 May 2019 01:24:56 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 298EB709 for ; Thu, 9 May 2019 01:24:56 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id t87so385396pfa.2 for ; Wed, 08 May 2019 18:24:56 -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=nlHSzRpU+t9rjVCzD9LjFu8y0lv00mdgk2MWiB279iU=; b=CNhQm0GnrAcztUhzU9SrKzt/VCe3d+sOkJM6J2vhKsbxbfU4hdQUy98iLibNjzY18I e/n4ON96qmpPp5mnz0GAuHWkL5Ya1jy96yC8V3XnhjMNE9iy3eXmtHrkeKE3gykTg/HV RfqVAzr5Fef1CHphJCZ49n2gWCFu2mTaGhFPu5mMT7CfG0EVPcLuYyGOXmckNM6CxpfG tVJjYaQaia43oeGCg6LmtAMRINTJA3NZ1Vd2hdR5ydkaH3AnZEiipIdXUAOKHsL8pi3n rDW2D8k+I8fUQ5NJ95xboe51vjWqb2HJHe1QfAHQTR45u4DP/CWIc0scpZ/z1OWNNrh6 sf4g== X-Gm-Message-State: APjAAAXmwr/P8lbXhmopxqnzFjwEtVZf3bePQ59jmF7byxOlnol39x6s e87BkEmOfxRalRSDAXmQJzjZMlvH X-Google-Smtp-Source: APXvYqxs1ZjBAMvFTAe0SBzuzsynb8AZVDbXBA+ABqG4HanKvQCddDiMqiwnlW/xSvNrdjd4HUtM8g== X-Received: by 2002:a65:518d:: with SMTP id h13mr1785664pgq.259.1557365095304; Wed, 08 May 2019 18:24:55 -0700 (PDT) Received: from kube-master.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id k67sm661572pfb.44.2019.05.08.18.24.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 18:24:54 -0700 (PDT) From: Gurucharan Shetty To: dev@openvswitch.org Date: Wed, 8 May 2019 07:11:56 -0700 Message-Id: <1557324716-13170-1-git-send-email-guru@ovn.org> X-Mailer: git-send-email 1.9.1 X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DATE_IN_PAST_06_12, 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] ovs-save: Handle cases of upgrades from very old OVS versions. 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 have added code to ovs-save over the last few releases which makes the following bad assumptions. 1. The default OpenFlow version of running daemon is OpenFlow14. Impact: This causes upgrades from older OVS versions to end up with no flows in their bridges (even the default 'NORMAL' ones) causing traffic to stop. 2. That ovs-ofctl commands like dump-groups and dump-tlv-map will just work with old OVS versions. Impact: Does not look like it effects the upgrade in a bad away - except you get some errors. Since OpenFlow14 was enabled by default in OVS 2.8, this commit makes a lazy assumption that any upgrade of OVS from versions before 2.7 will not attempt to save and restore flows. VMware-BZ: #2340482 Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- utilities/ovs-save | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/utilities/ovs-save b/utilities/ovs-save index 1ba36e9..4df0c4a 100755 --- a/utilities/ovs-save +++ b/utilities/ovs-save @@ -110,6 +110,15 @@ save_flows () { exit 1 fi + case `ovs-appctl version | sed 1q` in + "ovs-vswitchd (Open vSwitch) 1."*.*) + return + ;; + "ovs-vswitchd (Open vSwitch) 2."[0-7].*) + return + ;; + esac + workdir=$(mktemp -d "${TMPDIR:-/tmp}/ovs-save.XXXXXXXXXX") for bridge in "$@"; do # Get the highest enabled OpenFlow version