From patchwork Wed Dec 2 06:23:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1409330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cm87Y2l5Xz9sRK for ; Wed, 2 Dec 2020 17:24:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 97B9C2E208; Wed, 2 Dec 2020 06:24:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yVi5JlktIih0; Wed, 2 Dec 2020 06:23:59 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id B99C42041F; Wed, 2 Dec 2020 06:23:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8FF8FC163C; Wed, 2 Dec 2020 06:23:59 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6AFC3C0052 for ; Wed, 2 Dec 2020 06:23:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 510068781F for ; Wed, 2 Dec 2020 06:23:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HK2OJPMsa3eK for ; Wed, 2 Dec 2020 06:23:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by hemlock.osuosl.org (Postfix) with ESMTPS id 52EC78781E for ; Wed, 2 Dec 2020 06:23:54 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 442F8E0009; Wed, 2 Dec 2020 06:23:49 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Tue, 1 Dec 2020 22:23:33 -0800 Message-Id: <20201202062341.1367060-1-blp@ovn.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH v2 0/8] Refactor OVSDB IDL into two layers X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" This series breaks the IDL into two layers: the IDL proper, whose interface to its client is unchanged, and a low-level library called the OVSDB "client synchronization" (CS) library. There are two reasons for this change. First, the IDL is big and complicated and I think that this change factors out some of that complication into a simpler lower layer. Second, the OVN northd implementation based on DDlog can benefit from the client synchronization library even though it would actually be made increasingly complicated by the IDL. v1->v2: - Add a few patches with trivial bug fixes and improvements to idl. - Make ovsdb-cs data structures exactly reproduce the ordering that the idl previously used, so that the behavior is exactly the same. This fixes the behavior in the ovn-controller. I am pretty convinced that there is a bug in the idl regarding change tracking, but these patches will not make it better or worse. There are lots of idl patches flying around on the mailing list currently; maybe one of those fixes the real problem. Ben Pfaff (8): jsonrpc: Avoid disconnecting prematurely due to long poll intervals. ovsdb-idl: Avoid redundant clearing and parsing of received data. ovsdb-idl: Fix memory leak sending messages without a session. ovsdb-idl: Remove prototype for function that is not defined or used. ovsdb-idl: Improve prototypes. ovsdb-idl: Add comment. ovsdb-cs: New module that factors out code from ovsdb-idl. ovsdb-idl: Break into two layers. lib/automake.mk | 2 + lib/jsonrpc.c | 5 +- lib/ovsdb-cs.c | 2279 ++++++++++++++++++++++++++++++++++++ lib/ovsdb-cs.h | 199 ++++ lib/ovsdb-idl-provider.h | 8 +- lib/ovsdb-idl.c | 2374 +++++++------------------------------- lib/ovsdb-idl.h | 5 +- lib/reconnect.c | 25 +- lib/reconnect.h | 1 + tests/test-reconnect.c | 1 + 10 files changed, 2943 insertions(+), 1956 deletions(-) create mode 100644 lib/ovsdb-cs.c create mode 100644 lib/ovsdb-cs.h