From patchwork Fri Jun 14 15:53:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1116102 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=redhat.com 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 45QQBT12RCz9sBr for ; Sat, 15 Jun 2019 01:53:36 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 8F3BD1418; Fri, 14 Jun 2019 15:53:33 +0000 (UTC) X-Original-To: ovs-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 67D5EE1B for ; Fri, 14 Jun 2019 15:53:32 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A15F1174 for ; Fri, 14 Jun 2019 15:53:31 +0000 (UTC) Received: by mail-wr1-f42.google.com with SMTP id p11so3062383wre.7 for ; Fri, 14 Jun 2019 08:53:31 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=Lp3gPiqJQ6uhJg4Rr2ViErtSf7DWvwT6lHMCID0GR9c=; b=eJBkqBhSasCilt2BEDeObAmuedsIDMR7Ptp2mq/lygwsY9t6vnUOwWvd0cBAobXHHg VKkUr0gSqpTfQFkChoFXcXUrewFH8XMO+Yrf5soK4bQiGT1aXpi5/3OiAA0bxns4qn9H ZbqgPoOJw2GgRSdfMbh44xshaQgRzQrhrgXrJB5L2whsVWP9b2yXu5Xh10T9StjDoKE3 z/dklmeYEx5ClhDRNJxFbNqdFRzcdS4la0Vh3Jd0hSsMzzidUKxmUQhftpqPKEEzM/GO CKYCgVyPdjiowdaeSup7gslzPN/IEuaGi1xvIElsa4xukpeltNIGlo60c73QBbWJNPKF vKSA== X-Gm-Message-State: APjAAAWTK3+70gi4d3PrUCkzqA1hQeqnAowWHchWBC4plX54XnMY4F/p EOjbFDIKUP1l/gdaqdYURAvs2N8dmcE= X-Google-Smtp-Source: APXvYqwWTV3s3I6YQqmgqYYzgDBGeWgZssgEwR8CDFIpQS/tMbLPe3zNNJnTKrs9qdcNFedSkff4cQ== X-Received: by 2002:adf:fd01:: with SMTP id e1mr5500591wrr.167.1560527610023; Fri, 14 Jun 2019 08:53:30 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id o20sm848394wro.65.2019.06.14.08.53.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 08:53:28 -0700 (PDT) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Fri, 14 Jun 2019 17:53:20 +0200 Message-Id: X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 0/3] OVN: add Controller Events 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: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org There are situations where arrival of certain types of traffic into OVS does not warrant a "typical" action, such as output to a specific port or dropping. Rather, the decision about what to do needs to be left to a CMS. The series here introduces a new table, Controller_Event, for this purpose. Traffic into OVS can raise a controller() event that results in a Controller_Event being written to the southbound database. The intention is for a CMS to see the events and take some sort of action. The "handled" column of the event is initially set to "false" by OVN. When the CMS has seen the event and taken appropriate action, then the CMS sets this field to "true'. When ovn-controller sees that the event has been handled, it deletes the event from the database. Controller events are only added to the southbound database if they have been enabled in the nb_global table via the options:controller_event setting. This series introduces a new event, empty_lb_backends. This event is raised if a received packet is destined for a load balancer VIP that has no configured backend destinations. For this event, the event info includes the load balancer VIP, the load balancer UUID, and the transport protocol. The use case for this particular event is for the CMS to supply backend resources to handle this traffic. For example, in Openshift, this event can be used to spin up new containers to handle the incoming traffic. Changes since RFCv2: - introduce event sequence number - improve documentation Changes since RFCv1: - added garbage collector for event hash table - rename send_event in trigger_event - modify event_type from int to string in trigger_event action - added chassis column in Controller_Event as weak reference to Chassis table - added monitoring to 'local' rows in Controller_Event table - fix typos Lorenzo Bianconi (3): OVN: introduce Controller_Event table OVN: introduce send_event() action OVN: use send_event action to report 'empty_lb_rule' events include/ovn/actions.h | 18 ++- include/ovn/logical-fields.h | 26 ++++ ovn/controller/lflow.c | 26 +++- ovn/controller/ovn-controller.c | 10 ++ ovn/controller/pinctrl.c | 268 ++++++++++++++++++++++++++++++++ ovn/controller/pinctrl.h | 2 + ovn/lib/actions.c | 176 +++++++++++++++++++++ ovn/lib/ovn-l7.h | 46 ++++++ ovn/northd/ovn-northd.c | 33 ++++ ovn/ovn-nb.xml | 5 + ovn/ovn-sb.ovsschema | 21 ++- ovn/ovn-sb.xml | 42 +++++ ovn/utilities/ovn-trace.c | 3 + tests/ovn.at | 78 ++++++++++ tests/test-ovn.c | 11 +- 15 files changed, 756 insertions(+), 9 deletions(-)