From patchwork Thu Jul 14 20:09:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 648577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rr6Hy3rXDz9sBg for ; Fri, 15 Jul 2016 06:10:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=PEafpK+w; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id C8A5C10C07; Thu, 14 Jul 2016 13:10:05 -0700 (PDT) X-Original-To: dev@openvswitch.com Delivered-To: dev@openvswitch.com Received: from mail-pa0-f65.google.com (mail-pa0-f65.google.com [209.85.220.65]) by archives.nicira.com (Postfix) with ESMTPS id 5DB4F10BFC for ; Thu, 14 Jul 2016 13:10:05 -0700 (PDT) Received: by mail-pa0-f65.google.com with SMTP id ez1so1633738pab.3 for ; Thu, 14 Jul 2016 13:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=n+pMltZPl/UrAMQ8sQE7sN2IWiDFaI/lb2Klz+IcnTA=; b=PEafpK+wqtf2w2d6X6GwHf0AN2VECBdDsL4aC4tgXzx1Xu2MG1LDnB+Vru1TqL2VrU R9kGvcrxZZ/po5eQxJAG3nGSdStxfGG9B9fLfXvPp3EUElSYYBnfKFxrxqf+5IIoShR9 yy0VlkPntJopVjuTfzJd10nC4zRS13FTiqrSi2o/+2JlZXoR4+6Q6ibn4/ta7+B2RRWu tqDBbT5O7nt05/oWAVJVjEwdCpAIZhqcwo4TJomn4/l+h/Cmm6fpwDuMcCM8LuUgINtf rPLX4W/3q3FwMUdSbeW81BxC0SadFq97ZO3WfUM3JhNpd+FZU869/zM4ARk6iRgks6b5 gPvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=n+pMltZPl/UrAMQ8sQE7sN2IWiDFaI/lb2Klz+IcnTA=; b=Esl69oPNHUGyBv1i8ACtKi71tZRtzCbMYz6Z3jBqypeNEUUB1PlgTaqRH/OBMGd9Aj 5vzmagPHzWrKDhfqSEhHZGZHPL+OY8gDz5q+oIIm4rKS5EuRvb9jgRI6s20QtA3ssgG0 jaSPVx2mDVIZPSKW89czXdDU7S7w1WxgkW6KsK7sReIJxXFSJwKHMdd48Zd6rXw6QarC UdciD2PpuH76zPJ4lcAftqi3ckManNnX4qUWBZ2h6zN6lQkNLyhD8MjDnHekH10t2Qdn 2bnZeWsKMfN42vG7zZg4xe5+pHPaQcYlyPD/CGpgOZn3vd3iOtdQIMMkxVuHcroRs8XK /HDg== X-Gm-Message-State: ALyK8tL6lz5Th8o5wBliaK4KSk5MCU67aMicYVzGqEpZ+MOqmPzjN0/uF2u3D0MHwOuFLQ== X-Received: by 10.66.54.35 with SMTP id g3mr25901029pap.30.1468527004642; Thu, 14 Jul 2016 13:10:04 -0700 (PDT) Received: from localhost.localdomain ([208.91.2.3]) by smtp.gmail.com with ESMTPSA id v126sm6259925pfb.60.2016.07.14.13.10.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jul 2016 13:10:04 -0700 (PDT) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.com Date: Thu, 14 Jul 2016 13:09:57 -0700 Message-Id: <1468526997-7163-1-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 Subject: [ovs-dev] [patch_v1] ovs-vtep: Handle tunnel key configuration in any order. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Presently, ovs-vtep expects the datapath tunnel key to be available in the VTEP DB at startup. This may not be the case which is also observed as interrmittent unit test failures. This patch allows for the tunnel key to later appear in the VTEP database. Signed-off-by: Darrell Ball --- vtep/ovs-vtep | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep index e52c66f..871b999 100644 --- a/vtep/ovs-vtep +++ b/vtep/ovs-vtep @@ -259,6 +259,21 @@ class Logical_Switch(object): tunnels = set() parse_ucast = True + if not self.tunnel_key: + vlog.info("Invalid tunnel key %s in %s; requery VTEP DB" + % (self.tunnel_key, self.name)) + column = vtep_ctl("--columns=tunnel_key find logical_switch " + "name=%s" % self.name) + tunnel_key = column.partition(":")[2].strip() + if tunnel_key and isinstance(eval(tunnel_key), six.integer_types): + self.tunnel_key = tunnel_key + vlog.info("update_remote_macs: using tunnel key %s in %s" + % (self.tunnel_key, self.name)) + else: + vlog.info("Invalid tunnel key %s in %s post VTEP DB requery" + % (self.tunnel_key, self.name)) + return + mac_list = vtep_ctl("list-remote-macs %s" % self.name).splitlines() for line in mac_list: if (line.find("mcast-mac-remote") != -1):