From patchwork Thu Jul 11 15:48:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1130860 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 45l11K4ZPfz9sNH for ; Fri, 12 Jul 2019 01:58:13 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B140F525E; Thu, 11 Jul 2019 15:58:08 +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 0C0E551B1 for ; Thu, 11 Jul 2019 15:49:26 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 6EB6387C for ; Thu, 11 Jul 2019 15:49:25 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id r1so6840703wrl.7 for ; Thu, 11 Jul 2019 08:49:25 -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=gBOCMpmDpgPuKlYa88W8Kq4PbwrAnfZryBFCvCjAs9w=; b=aBmgx1mQ92NOrv+yQ+5IZbvzQ6ADAFC4lHgoboiAUcIzolxc3kpt6jLkVJsfaLo20s AbwRDAkwYeTxkFDbbGzLBTfzopzZ3dQPHAYPcDNcGruaZzdOnYZdqX4n/s+gt4il7ceR hVxeVYiltuZxG4mJHr9ynqqYzdeQ4iC9ycs85amRIcvInfc7J+vtujj5Gt9sf6Vhzlfg zBPSmPKhI1PDQUMmS1KATXZtonQOB8p3fiQeNpUf0GXb0wkDwzjL38FUtDNrStg2CXzt DF5GajxRNm9E8c7UwWUMhqU48ua2oKmBcYbbg8ppx8rIY2mR3HwYdTvsyIyhDlNl8z0U s0iw== X-Gm-Message-State: APjAAAWahPN9PENi5IvGH0Dulxr4eBWZJCpNqxYoNZAe5tI+GktE/UL6 wQWcsQQN+fyPKJjW8jlO4JVWthZYAJc= X-Google-Smtp-Source: APXvYqzZT6rtvdyQaCo08uFwPJx2uMpNJEclMXyjsSf6PhSb18SGav4E/1K2k+iWxRmyB8fIJR5ZFQ== X-Received: by 2002:adf:de08:: with SMTP id b8mr5895349wrm.282.1562860163743; Thu, 11 Jul 2019 08:49:23 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id e6sm6507334wrw.23.2019.07.11.08.49.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 11 Jul 2019 08:49:21 -0700 (PDT) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Thu, 11 Jul 2019 17:48:42 +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 v2 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. When the CMS has seen the event and taken appropriate action, then it can remove the correponding row in Controller_Event table. Controller events are only added to the southbound database if the CMS enable the feature in the NB nb_global table setting options:controller_event to true. 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 v1: - improve documentation - fix code style - moved event_to_string and string_to_event routines in ovn/lib/logical-fields.c - set GC timeout to 10s - removed unnecessary ip parameter in 'empty_lb_backends' logical flow definition - substituted ovs_assert() with a warning log in pinctrl_handle_empty_lb_backends_opts() - fixed commit message of patch 2/3 - remove 'handled' column in Controller_Event table 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 trigger_event() action OVN: use trigger_event action to report 'empty_lb_rule' events include/ovn/actions.h | 18 ++- include/ovn/logical-fields.h | 7 + ovn/controller/lflow.c | 26 +++- ovn/controller/ovn-controller.c | 10 ++ ovn/controller/pinctrl.c | 265 ++++++++++++++++++++++++++++++++ ovn/controller/pinctrl.h | 2 + ovn/lib/actions.c | 176 +++++++++++++++++++++ ovn/lib/logical-fields.c | 21 +++ ovn/lib/ovn-l7.h | 46 ++++++ ovn/northd/ovn-northd.c | 33 ++++ ovn/ovn-nb.xml | 11 ++ ovn/ovn-sb.ovsschema | 20 ++- ovn/ovn-sb.xml | 61 ++++++++ ovn/utilities/ovn-trace.c | 3 + tests/ovn.at | 75 +++++++++ tests/test-ovn.c | 11 +- 16 files changed, 776 insertions(+), 9 deletions(-)