From patchwork Thu Aug 19 11:08:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frode Nordahl X-Patchwork-Id: 1518595 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=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=eOZFP5C3; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gr28s6Ym2z9t0T for ; Thu, 19 Aug 2021 21:09:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 885AD817EB; Thu, 19 Aug 2021 11:09:31 +0000 (UTC) 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 9Y3g-5hVjqDG; Thu, 19 Aug 2021 11:09:26 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 42EBE80EC5; Thu, 19 Aug 2021 11:09:22 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DD51EC002A; Thu, 19 Aug 2021 11:09:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0E356C0027 for ; Thu, 19 Aug 2021 11:09:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E29EA40781 for ; Thu, 19 Aug 2021 11:09:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=canonical.com 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 wvABhKCV02bg for ; Thu, 19 Aug 2021 11:09:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2A32A40784 for ; Thu, 19 Aug 2021 11:09:08 +0000 (UTC) Received: from frode-threadripper.. (ti0189a330-1161.bb.online.no [88.88.219.141]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 7BFD33F365 for ; Thu, 19 Aug 2021 11:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1629371343; bh=Y/dpcvW04uWxlHj6xH49dSqpNYVHTRaLlO3e7BScAlY=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=eOZFP5C3g7I4Jb27WE2oUfJC+XUB1LBVmOeCAs6xuYP//UW3zDHYUElNaEFr0Ag9A 5pspx9LNMqfBjsU+kRGf/eS14MwTcTVtjsUvGLnIQSds0XzmhRX+BP90etjPj2/VJ9 orZDSblt3IZIVS483kZwWcJHTRDD+XYaab9jl4S2FMt5iEgSfBSY4JZBqRqoD8Nvdk FCdjGdprQXww0tzxZuPUPL0FeqFzR/8stutDuA7u4Kaeqy/oONJmuIah+xmQQnWSe4 5Wiu6dVMNoqv2szoQQxlU0zJe/5VYKdYx6tL4ypxVz6fCbDFCLVQ3c9q1qAPp24nbO Uk1B1B6KhDavQ== From: Frode Nordahl To: dev@openvswitch.org Date: Thu, 19 Aug 2021 13:08:50 +0200 Message-Id: <20210819110857.2229769-1-frode.nordahl@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn v3 0/7] Introduce infrastructure for plugging providers 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" Introduce infrastructure for plugging providers and add feature to ovn-controller to add and remove ports on the integration bridge as directed by CMS through Logical_Switch_Port options. Traditionally it has been the CMSs responsibility to create Virtual Interfaces (VIFs) as part of instance (Container, Pod, Virtual Machine etc.) life cycle, and subsequently manage plug/unplug operations on the Open vSwitch integration bridge. With the advent of NICs connected to multiple distinct CPUs we can have a topology where the instance runs on one host and Open vSwitch and OVN runs on a different host, the smartnic control plane CPU. The host facing interfaces will be visible to Open vSwitch and OVN as representor ports. The actions necessary for plugging and unplugging the representor port in Open vSwitch running on the smartnic control plane CPU would be the same for every CMS. Hardware or platform specific details for initialization and lookup of representor ports is provided by an plugging provider hosted inside or outside the core OVN repository, and linked at OVN build time. RFC1 -> RFC2: - Introduce the plug-provider interface, remove hardware/platform dependent code. - Add ovsport module. - Integrate with binding module. - Split into multiple patches. RFC2 -> v1: - Extend build system, `--with-plug-provider`. - Check for required data in b_ctx_in and lbinding data structures. - Split consider_plug_lport into update and create processsing functions. - Consider unplug on release where relevant. - Add ovn-controller `--enable-dummy-plug` option for testing. - Consistent function naming and move ovsport module to controller/. - Rename plug-test.c -> plug-dummy.c. - Add functional- and unit- tests. v1 -> v2: - Move update to controller/binding.h from patch 6 -> patch 5. - Fix lint problems reported by 0-day Robot. v2 -> v3: - Fix build system extension for plug provider. - Implement DDlog version of northd change. - Rebase on tip. Previous discussion: - RFC1: https://patchwork.ozlabs.org/project/ovn/patch/20210509140305.1910796-1-frode.nordahl@canonical.com/ - RFC2: https://patchwork.ozlabs.org/project/ovn/cover/20210805145013.3033919-1-frode.nordahl@gmail.com/ Frode Nordahl (7): ovn-sb: Add plugged_by column to Port_Binding. northd-ddlog: Handle Port_Binding:plugged_by. controller: Move OVS port functions to new module. patch: Consume ovsport functions. lib: Add infrastructure for plugging providers. ovn-controller: Prepare plugging infrastructure. binding: Consider plugging of ports on CMS request. acinclude.m4 | 34 ++++ configure.ac | 1 + controller/automake.mk | 4 +- controller/binding.c | 269 +++++++++++++++++++++++++++- controller/binding.h | 1 + controller/ovn-controller.c | 25 +++ controller/ovsport.c | 256 +++++++++++++++++++++++++++ controller/ovsport.h | 60 +++++++ controller/patch.c | 39 +--- lib/automake.mk | 12 +- lib/plug-dummy.c | 144 +++++++++++++++ lib/plug-dummy.h | 33 ++++ lib/plug-provider.h | 109 ++++++++++++ lib/plug.c | 342 ++++++++++++++++++++++++++++++++++++ lib/plug.h | 101 +++++++++++ lib/test-plug.c | 80 +++++++++ northd/ovn-northd.c | 31 ++++ northd/ovn_northd.dl | 68 ++++++- ovn-nb.xml | 38 ++++ ovn-sb.ovsschema | 10 +- ovn-sb.xml | 15 ++ tests/automake.mk | 4 +- tests/ovn-controller.at | 31 ++++ tests/ovn-macros.at | 2 +- tests/ovn-northd.at | 47 +++++ tests/ovn-plug.at | 8 + 26 files changed, 1711 insertions(+), 53 deletions(-) create mode 100644 controller/ovsport.c create mode 100644 controller/ovsport.h create mode 100644 lib/plug-dummy.c create mode 100644 lib/plug-dummy.h create mode 100644 lib/plug-provider.h create mode 100644 lib/plug.c create mode 100644 lib/plug.h create mode 100644 lib/test-plug.c create mode 100644 tests/ovn-plug.at