From patchwork Tue Jan 10 22:00:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Odintsov X-Patchwork-Id: 1724355 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=QAz2KGZ+; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ns4W61H6Cz23fY for ; Wed, 11 Jan 2023 09:00:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 08C34417A2; Tue, 10 Jan 2023 22:00:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 08C34417A2 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=QAz2KGZ+ X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ptj3D9cnv5Gg; Tue, 10 Jan 2023 22:00:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 6EF934013E; Tue, 10 Jan 2023 22:00:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6EF934013E Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 41786C0033; Tue, 10 Jan 2023 22:00:27 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id C79EEC002D for ; Tue, 10 Jan 2023 22:00:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A27BE81401 for ; Tue, 10 Jan 2023 22:00:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A27BE81401 Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=QAz2KGZ+ X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ot4sfnf029kP for ; Tue, 10 Jan 2023 22:00:26 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org AD759813FB Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by smtp1.osuosl.org (Postfix) with ESMTPS id AD759813FB for ; Tue, 10 Jan 2023 22:00:25 +0000 (UTC) Received: by mail-lf1-x129.google.com with SMTP id bu8so20601877lfb.4 for ; Tue, 10 Jan 2023 14:00:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cGU+eSFYkimGV/J6FVyUpMyrrsvhLBON6JQP/XF1Oac=; b=QAz2KGZ+qqZLO1d8AcSx30PeUbCaqdl0B15nDf9d9/zqROzXNlJYxLRoP4hfxVQSz6 HxZs5H1nzDI5/pKhKyUBQ13MkbQV1l3s3dp2Kz8Wc6huguvT9RB6BDPsnHdR+47A+SzQ MUrA2q9XEyzydIMSwKVk05NHTZoQVL0FF4PxrNFYA4yiBCtx9xqhLhvJyTVqAkxlaHbN FNLPPuitYbdZ5KZV2Wlypf6ZoqqzGTppOAPvA7cTSBaFd+yRJI44g0h/3JyeTKy0Cedv /jfaB7qNQM4/3lPJ2VOhwhdXk+xM9l1xN0kmgudoyK+y9cgR4C/z7zbqQVfPSLFHsKft vkYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cGU+eSFYkimGV/J6FVyUpMyrrsvhLBON6JQP/XF1Oac=; b=xqsJQPMP/6vuhyjweh2HmBtlEtEjy5BKoy+tvbUalnXyhu4zXWJl82PGRKIY0LR7Vq 6LGNA/gcF/FA42x/xZze9hg+DhH1SC2pCavolpAx/oVyW/aWd+9kTzIZUhjkf7FvnHHg WBSXLyDAEBh+l3TULucGYcrNrwtmCZWvZ9eGiSlk/sxeGaZaavMKtUCRLda6rsiC+uPs ne9jKARbENKwKbBaeL+lTFLzOGBZxz1hLd5cvi2IQrZewjQ357fHgYCcB6uGJ0SrhFWF o4sKnh1PzKlegnfky985NpVoWD+S/ztdSFPT6E6wXvYEsAkVSLK0b7vt3cE1rrCrDbks qZyw== X-Gm-Message-State: AFqh2kpAlbL67bC0OZ+GpGl59gP0cXpzIky/u9GZ2ZEyr3tUig2ZCBE+ fIFhW3JXRjOtBHu80N5NG18/e0qmyi8= X-Google-Smtp-Source: AMrXdXtqM3qE0XUKuWl6E6kYd+f/evwmGDQR44Zr+e1gh/BrkA22M2+s7dnorpLUP5z/D1Isw5+DIQ== X-Received: by 2002:a05:6512:2394:b0:4b5:987c:de3e with SMTP id c20-20020a056512239400b004b5987cde3emr1914537lfv.69.1673388023150; Tue, 10 Jan 2023 14:00:23 -0800 (PST) Received: from ip-10-70-112-12.vpc-1e810be1.internal (c2-178-216-98-9.elastic.cloud.croc.ru. [178.216.98.9]) by smtp.gmail.com with ESMTPSA id e12-20020ac2546c000000b004ca0ea7af24sm2365732lfn.174.2023.01.10.14.00.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 14:00:22 -0800 (PST) From: Vladislav Odintsov To: dev@openvswitch.org Date: Wed, 11 Jan 2023 01:00:17 +0300 Message-Id: <20230110220017.3524092-1-odivlad@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Cc: Vladislav Odintsov , Dumitru Ceara Subject: [ovs-dev] [PATCH ovn branch-22.06] ovn-ic: Only monitor useful tables and columns. 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" From: Dumitru Ceara Signed-off-by: Dumitru Ceara Signed-off-by: Mark Michelson Acked-by: Mark Michelson (cherry picked from commit 2698e7811b41b00ac3b6544430a95be9ae700e23) Signed-off-by: Vladislav Odintsov --- ic/ovn-ic.c | 110 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 105 insertions(+), 5 deletions(-) diff --git a/ic/ovn-ic.c b/ic/ovn-ic.c index 6d1461f11..0de2d9c18 100644 --- a/ic/ovn-ic.c +++ b/ic/ovn-ic.c @@ -1915,13 +1915,113 @@ main(int argc, char *argv[]) struct ovsdb_idl_loop ovnisb_idl_loop = OVSDB_IDL_LOOP_INITIALIZER( ovsdb_idl_create(ovn_ic_sb_db, &icsbrec_idl_class, true, true)); - /* ovn-nb db. XXX: add only needed tables and columns */ + /* ovn-nb db. */ struct ovsdb_idl_loop ovnnb_idl_loop = OVSDB_IDL_LOOP_INITIALIZER( - ovsdb_idl_create(ovnnb_db, &nbrec_idl_class, true, true)); - - /* ovn-sb db. XXX: add only needed tables and columns */ + ovsdb_idl_create(ovnnb_db, &nbrec_idl_class, false, true)); + + ovsdb_idl_add_table(ovnnb_idl_loop.idl, &nbrec_table_nb_global); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, &nbrec_nb_global_col_name); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, &nbrec_nb_global_col_options); + + ovsdb_idl_add_table(ovnnb_idl_loop.idl, + &nbrec_table_logical_router_static_route); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_static_route_col_route_table); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_static_route_col_ip_prefix); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_static_route_col_nexthop); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_static_route_col_external_ids); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_static_route_col_options); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_static_route_col_policy); + + ovsdb_idl_add_table(ovnnb_idl_loop.idl, &nbrec_table_logical_router); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_col_name); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_col_static_routes); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_col_ports); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_col_options); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_col_external_ids); + + ovsdb_idl_add_table(ovnnb_idl_loop.idl, &nbrec_table_logical_router_port); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_port_col_name); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_port_col_networks); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_port_col_external_ids); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_router_port_col_options); + + ovsdb_idl_add_table(ovnnb_idl_loop.idl, &nbrec_table_logical_switch); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_col_name); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_col_ports); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_col_other_config); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_col_external_ids); + + ovsdb_idl_add_table(ovnnb_idl_loop.idl, &nbrec_table_logical_switch_port); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_port_col_name); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_port_col_addresses); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_port_col_options); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_port_col_type); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_port_col_up); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_port_col_addresses); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_port_col_enabled); + ovsdb_idl_add_column(ovnnb_idl_loop.idl, + &nbrec_logical_switch_port_col_external_ids); + + /* ovn-sb db. */ struct ovsdb_idl_loop ovnsb_idl_loop = OVSDB_IDL_LOOP_INITIALIZER( - ovsdb_idl_create(ovnsb_db, &sbrec_idl_class, true, true)); + ovsdb_idl_create(ovnsb_db, &sbrec_idl_class, false, true)); + + ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_chassis); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_chassis_col_encaps); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_chassis_col_external_ids); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_chassis_col_name); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_chassis_col_hostname); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_chassis_col_other_config); + + ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_encap); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_encap_col_chassis_name); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_encap_col_type); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_encap_col_ip); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_encap_col_options); + + ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_datapath_binding); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, + &sbrec_datapath_binding_col_external_ids); + + ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_port_binding); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, + &sbrec_port_binding_col_datapath); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, + &sbrec_port_binding_col_mac); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, + &sbrec_port_binding_col_options); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, + &sbrec_port_binding_col_logical_port); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, + &sbrec_port_binding_col_external_ids); + ovsdb_idl_add_column(ovnsb_idl_loop.idl, + &sbrec_port_binding_col_chassis); /* Create IDL indexes */ struct ovsdb_idl_index *nbrec_ls_by_name