From patchwork Thu May 24 22:10:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 920128 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="nkau/JBK"; 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 40sNrS6HqFz9s0q for ; Fri, 25 May 2018 08:11:20 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 266B2D2A; Thu, 24 May 2018 22:10:21 +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 AA0DCCCB for ; Thu, 24 May 2018 22:10:19 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 27C566D3 for ; Thu, 24 May 2018 22:10:19 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id 15-v6so1056242pge.2 for ; Thu, 24 May 2018 15:10:19 -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=RN8pddBpzV5lMijRLyCJAgs3IQEpMujBc4TaXbGgMqM=; b=nkau/JBKeUXhuVrrtE1q4x7UwqZTMCnIlneO2HzWh0k3y+6Z+kSNVAOnOlyumx7RLT v2dluKa6XUS7BQzUECofwp0d4xQNCGtiyrV+sqr/dFpoaDxbj1gcqQHj2GyvaaAlYXZn qPezcX8v050fS6qxEDGlwyuX2Rsj51v+7KiPcLh2R9zULNepN+cNnvUPuUT4G19a0mzn HIV3zhqmOOQzzrk1fnh0tSbbnTfPmjMq3wCYNVAalNzmhsqmZfvD01u+Id2VXYfPxcUQ NPAql59vpxKT45DE6jVWjGGOrJVTtZZmW3J5AiDsh4FoMpalHyFPU6HgLVbHigXh/4Jx CzKw== 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=RN8pddBpzV5lMijRLyCJAgs3IQEpMujBc4TaXbGgMqM=; b=qmzjkpgYh0e7bPB3ZnYwQm7rFXWFb1OziBHjs1XLkclA+V6e1fmhZd8RtdjaxPNtAS 9Z1C0cYdj6P2KD5TEPAEu0wRg74Q4EUdlf2eVTTiPPtrbFw2zwLDE9LimC+Nv33Ax3zr um06m/rOyim8QGftRDNdyR0+CPHq/vcA4yyhQpapLNaOIxNcjtoKyWTKJqUkxkM3aJGM ibpCjlpcUiDExOyp3SP3T85E4ifMj3nrMIjuZlH/p/fGarD083y7+Ncoos+CAG23gy27 SRqkL0cs4aSn93HL+sZ1i7S9fwgku4bfWDExAr5kAxnMO6g6Y5AwUOJTWNf7iFuMviyx dj2g== X-Gm-Message-State: ALKqPwfPIWiVphhT9+zREaKxvx69LSh2tpA8fNHgeeDRjg6brf6WofPd iNeuRdb9Uq8F7fUNqUgy4QugkA== X-Google-Smtp-Source: AB8JxZoCLnM7JBUruK2Mh3VIULvtJ2LbLi05Dm4FMnLDxcYxXUkC4LrhMSM1dy3e2Fdy7f+k23MXBA== X-Received: by 2002:a63:b506:: with SMTP id y6-v6mr7465568pge.213.1527199818548; Thu, 24 May 2018 15:10:18 -0700 (PDT) Received: from localhost.localdomain.localdomain ([216.113.160.70]) by smtp.gmail.com with ESMTPSA id y18-v6sm47493651pfi.104.2018.05.24.15.10.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 15:10:17 -0700 (PDT) From: Han Zhou X-Google-Original-From: Han Zhou To: dev@openvswitch.org Date: Thu, 24 May 2018 15:10:43 -0700 Message-Id: <1527199851-107563-3-git-send-email-hzhou8@ebay.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1527199851-107563-1-git-send-email-hzhou8@ebay.com> References: <1527199851-107563-1-git-send-email-hzhou8@ebay.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v2 02/10] ovn-controller: Track OVSDB changes 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 Track OVSDB changes for future patches of incremental processing Signed-off-by: Han Zhou --- ovn/controller/bfd.c | 4 ++-- ovn/controller/binding.c | 16 ++++++++-------- ovn/controller/encaps.c | 12 ++++++------ ovn/controller/ovn-controller.c | 22 +++++++++++++--------- ovn/controller/physical.c | 12 ++++++------ 5 files changed, 35 insertions(+), 31 deletions(-) diff --git a/ovn/controller/bfd.c b/ovn/controller/bfd.c index 8f020d5..d7ea9e8 100644 --- a/ovn/controller/bfd.c +++ b/ovn/controller/bfd.c @@ -34,8 +34,8 @@ bfd_register_ovs_idl(struct ovsdb_idl *ovs_idl) { /* NOTE: this assumes that binding.c has added the * ovsrec_interface table */ - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_bfd); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_bfd_status); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_bfd); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_bfd_status); } diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c index 0785a94..84ff4d6 100644 --- a/ovn/controller/binding.c +++ b/ovn/controller/binding.c @@ -53,16 +53,16 @@ binding_register_ovs_idl(struct ovsdb_idl *ovs_idl) ovsdb_idl_add_column(ovs_idl, &ovsrec_bridge_col_ports); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_port); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_name); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_interfaces); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_qos); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_name); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_interfaces); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_qos); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_interface); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_name); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_external_ids); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_bfd); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_bfd_status); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_status); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_name); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_external_ids); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_bfd); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_bfd_status); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_status); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_qos); ovsdb_idl_add_column(ovs_idl, &ovsrec_qos_col_type); diff --git a/ovn/controller/encaps.c b/ovn/controller/encaps.c index f187a8f..9f33394 100644 --- a/ovn/controller/encaps.c +++ b/ovn/controller/encaps.c @@ -32,13 +32,13 @@ encaps_register_ovs_idl(struct ovsdb_idl *ovs_idl) ovsdb_idl_add_table(ovs_idl, &ovsrec_table_bridge); ovsdb_idl_add_column(ovs_idl, &ovsrec_bridge_col_ports); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_port); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_name); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_interfaces); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_external_ids); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_name); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_interfaces); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_external_ids); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_interface); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_name); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_type); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_options); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_name); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_type); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_options); } /* Enough context to create a new tunnel, using tunnel_add(). */ diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index 86e1836..d4cc69f 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -520,16 +520,16 @@ ctrl_register_ovs_idl(struct ovsdb_idl *ovs_idl) ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_external_ids); ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_bridges); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_interface); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_name); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_bfd); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_bfd_status); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_type); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_options); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_ofport); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_name); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_bfd); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_bfd_status); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_type); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_options); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_ofport); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_port); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_name); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_interfaces); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_external_ids); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_name); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_interfaces); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_external_ids); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_bridge); ovsdb_idl_add_column(ovs_idl, &ovsrec_bridge_col_ports); ovsdb_idl_add_column(ovs_idl, &ovsrec_bridge_col_name); @@ -638,6 +638,7 @@ main(int argc, char *argv[]) create_ovnsb_indexes(ovnsb_idl_loop.idl); lport_init(ovnsb_idl_loop.idl); + ovsdb_idl_track_add_all(ovnsb_idl_loop.idl); ovsdb_idl_omit_alert(ovnsb_idl_loop.idl, &sbrec_chassis_col_nb_cfg); update_sb_monitors(ovnsb_idl_loop.idl, NULL, NULL, NULL); ovsdb_idl_get_initial_snapshot(ovnsb_idl_loop.idl); @@ -833,6 +834,9 @@ main(int argc, char *argv[]) } } } + + ovsdb_idl_track_clear(ctx.ovnsb_idl); + ovsdb_idl_track_clear(ctx.ovs_idl); poll_block(); if (should_service_stop()) { exiting = true; diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c index fc8adcf..b3aa27a 100644 --- a/ovn/controller/physical.c +++ b/ovn/controller/physical.c @@ -51,14 +51,14 @@ physical_register_ovs_idl(struct ovsdb_idl *ovs_idl) ovsdb_idl_add_column(ovs_idl, &ovsrec_bridge_col_ports); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_port); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_name); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_interfaces); - ovsdb_idl_add_column(ovs_idl, &ovsrec_port_col_external_ids); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_name); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_interfaces); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_port_col_external_ids); ovsdb_idl_add_table(ovs_idl, &ovsrec_table_interface); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_name); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_ofport); - ovsdb_idl_add_column(ovs_idl, &ovsrec_interface_col_external_ids); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_name); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_ofport); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_external_ids); } static struct simap localvif_to_ofport =