From patchwork Mon Nov 16 15:49:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flaviof X-Patchwork-Id: 1400999 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=flaviof.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CZYS54ZXGz9sSs for ; Tue, 17 Nov 2020 02:50:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C1B738551F; Mon, 16 Nov 2020 15:50:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tZ7OtYAp9XCU; Mon, 16 Nov 2020 15:50:11 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0B38E84DD4; Mon, 16 Nov 2020 15:50:11 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EB0EDC0891; Mon, 16 Nov 2020 15:50:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2EECCC07FF for ; Mon, 16 Nov 2020 15:50:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 22D8A854E7 for ; Mon, 16 Nov 2020 15:50:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P3Wn1TD9OpYM for ; Mon, 16 Nov 2020 15:50:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 092E784DD4 for ; Mon, 16 Nov 2020 15:50:09 +0000 (UTC) Received: by mail-qk1-f176.google.com with SMTP id d28so17146453qka.11 for ; Mon, 16 Nov 2020 07:50:08 -0800 (PST) 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; bh=mL62seu+lkq49RKfrgxq4fYLTSP6MVyNYVGUIOsQ8FU=; b=j6Pcho8hrHI8FxsUM4VKF6T882wCZYbecJIg411nqXhBR/oby2o/izIG2yt/p70Uvu 6edtSWT6GOFlwyNcnJEJ3M0emTJAKccz60oAZ/Y5wItNKT7MK99ewfTXFHwC5XlzHUUY 7XRl2qnHwfLgQpCphWa/AurdiRwAnfqclTEQzXllgDJrWPAyZo5E5uda4PFv8kUdriE2 YOVmhYvdK2UWvwJkdIPgU9wXU6rXw0isHmFTJgFAj9otzfAi25LWU6TXpxIdrYIV0cpA F1rxzwhnFhtUW8A3Mc1topJpS6rht8Sf7jRu3RTGqCt6JBDeHJCF94XjFkb6dlE2oVst 3W5g== X-Gm-Message-State: AOAM5322o5i6LPYRTSRqDOhD0c827f4shDJwEcarRER1NPMIh6ZOUJHU pwCdIOpRLehfrQnD5qbHCwda2RLaTZg4kA== X-Google-Smtp-Source: ABdhPJy9dny7IBneYH/hpEBxm9XCHVhcRjhEXLX7Sq2ltDZBWYnWNtga5pLM3efGr9FUhCbD3vxRjA== X-Received: by 2002:a37:c20b:: with SMTP id i11mr14847977qkm.52.1605541807460; Mon, 16 Nov 2020 07:50:07 -0800 (PST) Received: from c8vm.redhat.com (pool-173-76-170-96.bstnma.fios.verizon.net. [173.76.170.96]) by smtp.gmail.com with ESMTPSA id y4sm11960196qtd.24.2020.11.16.07.50.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 07:50:06 -0800 (PST) From: Flavio Fernandes To: dev@openvswitch.org Date: Mon, 16 Nov 2020 15:49:55 +0000 Message-Id: <20201116154957.2443-1-flavio@flaviof.com> X-Mailer: git-send-email 2.18.4 Subject: [ovs-dev] [PATCH v5 ovn 0/2] northd: Fair ACL log meters. 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Using meters is a great way to keep the ovn-controllers from getting overwhelmed with ACL log events. Since multiple ACL rows with logging enabled can refer to the same meter name, I ran a little experiment to better understand how that behaves [1]. From that experiment, we see that a 'noisy' ACL match could consume all the events allowed by the meter, shadowing logs for other ACLs that also use the same meter. The thought of maintaining a meter row per ACL at the NB side is a solution, but it could easily become a management burden for the CMS. A much better approach would be to leverage northd to take care of this on behalf of the ACLs. As northd populates SB meter table from NB meter table, a new logic checks if the meter is configured as 'fair'. Such config is kept as a new column in the Meter table. Fair meters result in additional rows in the SB that have the same attributes of the original (aka template) meter except for its name has the ACL UUID appended to it. Last but not least, northd takes care of using the corresponding meter name as the logical flow action for the logging of the ACL. This change can be tracked in the following github clone/branch: https://github.com/flavio-fernandes/ovn/commits/acl-meters.v5.ddlog [1]: https://github.com/flavio-fernandes/ovsdbapp_playground/blob/acl_meter_issue/scripts/acl_meter.sh Flavio Fernandes (2): northd: Enhance the implementation of ACL log meters. ddlog for ACL log meters NEWS | 2 + northd/ovn-northd.c | 184 +++++++++++++++++++-------- northd/ovn_northd.dl | 281 ++++++++++++++++++++++++------------------ ovn-nb.ovsschema | 5 +- ovn-nb.xml | 16 ++- tests/ovn-nbctl.at | 6 +- tests/ovn-northd.at | 99 +++++++++++++++ utilities/ovn-nbctl.c | 16 ++- 8 files changed, 429 insertions(+), 180 deletions(-)