From patchwork Thu May 16 16:05:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1100648 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 454bqy3cJZz9sB3 for ; Fri, 17 May 2019 02:05:49 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EB5B9B7D; Thu, 16 May 2019 16:05:47 +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 6B97AB62 for ; Thu, 16 May 2019 16:05:46 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 7B6DB8B6 for ; Thu, 16 May 2019 16:05:45 +0000 (UTC) Received: by mail-wm1-f54.google.com with SMTP id 198so4205756wme.3 for ; Thu, 16 May 2019 09:05:45 -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=j4vfYbmvERGV3V8h2GbuvVSN757xXd2I4owUVD4mIVw=; b=Psy0cQ1CvY6NNXRks60uImEPl+LohDrCQGW062/njCpPBoRrgYiKefGbHcZen54vLD 7HFgyu9QEyvXvkA7ilPUSB3Q3PgtqnqnIsZOaR57UYXArAFMOwC+rtRQdWWTTmyEA7/8 /HQa8aRd7mHFnuyAVQcpvh4HtfhcywyIbbuSfjSNcpl2UWEvG5bOSS9ayRTZDMKWh2iD ei8v/+9r32jaLJgDBytChGXHKND8udAzKYfHOIG7ZG1G/fuQozhM7XZdji+N12Q5qCBw TT1kXsCpqR8Cwu6t/7iWXmfcIqfH0MY3EOuSToApO4oAA8sThFrI1Iw3PzjKLsyQgptd M0uA== X-Gm-Message-State: APjAAAXjGPrP9wXNzsOA9S5ANt3K0HJSF3dq33bt+/mvpp/hee9cqtVZ Qki8MX4cYaZWwcE55YLNGhBjR2sxkRU= X-Google-Smtp-Source: APXvYqxet9+76BL486yzpM2O+PHPjPR2z2mY9rROSv4pCQhTEdxAtaMppIuAHdHDb4g7cucbBuAKFQ== X-Received: by 2002:a1c:700f:: with SMTP id l15mr28691317wmc.150.1558022743920; Thu, 16 May 2019 09:05:43 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id s10sm4751362wrt.66.2019.05.16.09.05.36 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 16 May 2019 09:05:39 -0700 (PDT) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Thu, 16 May 2019 18:05:23 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 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] [RFC 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. 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 | 17 ++- include/ovn/logical-fields.h | 17 +++ ovn/controller/lflow.c | 8 ++ ovn/controller/ovn-controller.c | 2 + ovn/controller/pinctrl.c | 239 ++++++++++++++++++++++++++++++++ ovn/controller/pinctrl.h | 2 + ovn/lib/actions.c | 169 ++++++++++++++++++++++ ovn/lib/ovn-l7.h | 46 ++++++ ovn/northd/ovn-northd.c | 32 +++++ ovn/ovn-nb.xml | 5 + ovn/ovn-sb.ovsschema | 16 ++- ovn/ovn-sb.xml | 33 +++++ ovn/utilities/ovn-trace.c | 3 + tests/ovn.at | 76 ++++++++++ tests/test-ovn.c | 11 +- 15 files changed, 670 insertions(+), 6 deletions(-)