From patchwork Wed May 13 13:38:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1289307 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.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MMHGsMmZ; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49MbPk3pzWz9sSw for ; Wed, 13 May 2020 23:39:38 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D17D622091; Wed, 13 May 2020 13:39:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EmFYw1Q2c83q; Wed, 13 May 2020 13:39:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 3437F21F76; Wed, 13 May 2020 13:39:26 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1ABA3C0890; Wed, 13 May 2020 13:39:26 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 04153C016F for ; Wed, 13 May 2020 13:39:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E72A18776C for ; Wed, 13 May 2020 13:39:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NFVJ6C44WmLb for ; Wed, 13 May 2020 13:39:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by whitealder.osuosl.org (Postfix) with ESMTPS id DC81087720 for ; Wed, 13 May 2020 13:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589377161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mqS6d7MmenJkYT8XLOPmReLhdS6x8SfRqbBgCDURzSU=; b=MMHGsMmZHEH3s4Fne9OPb/QF23UwSah6DF3lfuGZQQxBKsGtVRnDQWbaKTMuyot0Hfn7vD aaDoafUNXXl68gJlWSNF+vpIDuxzZlKWgjZqWMRRM9zN6rhnaU3+HkHz6H9ZpPkrYWBedf mYewbsCasybI+QkJ4UAuDUtyPleOmeQ= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-TDsJtuk2MBuxi4gHdovwuQ-1; Wed, 13 May 2020 09:39:19 -0400 X-MC-Unique: TDsJtuk2MBuxi4gHdovwuQ-1 Received: by mail-qt1-f199.google.com with SMTP id o16so15455137qto.12 for ; Wed, 13 May 2020 06:39:19 -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=mqS6d7MmenJkYT8XLOPmReLhdS6x8SfRqbBgCDURzSU=; b=YN8rMingl7qs8X6vZN2LAdmaEWiy7kHVZrnx5VuxdjWGO/bOeIUGaJ9jQZuVYKg9LH ou5cbwD1XNLheCkFIkPU06G2WZXmRbTCuFFODhy3qU59ySJF4vhcFL+bblHl2BKQEp7g bOu11uNK9Y6hIxSO4gBLohYr0pWUP8J9E8MpL9yILIIMO66VeGswVX7kGoTzXTudJZbs cRJNfIpFkP25o7DeLFw0GCMywpeo6SDrKU5zklITgg12LIsKUpUBsI94McXeZ3bFLa4C w72f+PFc9fEmAQT2i/hrNsFhZJADuriIQq/F5+9XonIkLtytBVGGnk1C7pQnx9aVMYyv adhQ== X-Gm-Message-State: AOAM532aB6EF4G1YAi0z+uO+s5KVvrpCVeBCafhHmY4+4l7TkS5V08SG zyaBJMq0ddY7Dw26bEFdruSW1CVhvrG6r1m4jP/3zaLaVh9IzTTDqX9diIbsUr13BpBDXFCqCy7 wqrxE4Ke7XGUc X-Received: by 2002:ac8:326d:: with SMTP id y42mr9447692qta.243.1589377158340; Wed, 13 May 2020 06:39:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsGkN5qMR+2Oaws4XOW1mlQd7p2Yo9TV3OyNuT0PEyRnXCP1tOCupxQZA3YvJuAaYpr8QgRQ== X-Received: by 2002:ac8:326d:: with SMTP id y42mr9447576qta.243.1589377156621; Wed, 13 May 2020 06:39:16 -0700 (PDT) Received: from localhost.localdomain.com (cpe-172-73-180-250.carolina.res.rr.com. [172.73.180.250]) by smtp.googlemail.com with ESMTPSA id h12sm12048411qtb.19.2020.05.13.06.39.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 06:39:15 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Wed, 13 May 2020 09:38:47 -0400 Message-Id: <20200513133853.116959-1-ihrachys@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 0/6 v7] Support logical switches with multiple localnet ports 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" Hi all, This series is to allow for multiple localnet ports to be present in a logical switch. Even before the series, it was allowed to create multiple ports of this kind but they were handled inconsistently. This series uses logical switches with multiple localnet ports (LSMLP) to implement what is called "routed provider networks" in OpenStack. To elaborate, this allows to natively model a network that has multiple segments with implied L3 routing between the segments realized by the fabric. A user can operate such a network as a single entity instead of deciding on which segment to choose for their port bindings. The assumption in this implementation is that while a logical switch can have multiple localnet ports, each chassis has only one of corresponding physical networks mapped. Meaning, if the same LS has localnet ports for networks A, B, and C, then each chassis can either be mapped to A, B, or C, but not several of the networks. (Note this doesn't mean that a chassis can't be mapped to network D, as long as it doesn't have a corresponding localnet port in this same logical switch.) Ihar Hrachyshka (6): Spin out flow generation into build_dhcpv4_options_flows Spin out flow generation into build_dhcpv6_options_flows Spin out flow generation into build_pre_acl_flows Spin out flow generation into build_drop_arp_nd_flows_for_unbound_router_ports Support logical switches with multiple localnet ports Log missing bridge per localnet port just once Acked-by: Dumitru Ceara --- v2: - rebase on top of series that refactors code dealing with localnet ports. - tests: send packets both ways, more test scenarios covered. - use x2nrealloc to allocate ->localnet_ports. - use n_localnet_ports counter instead of localnet_ports pointer to detect switches with localnet ports. v3: - adjusted documentation to be more explicit about how multiple localnet ports scenario should be used in practice. - more tests (broadcast, multiple co-hosted switches with multiple localnet ports) v4: - sent as a series, fixed test description to reflect we test broadcast only. v5: - fixed a test case failure on slower machines due to service broadcast traffic captured. - rearranged parameters in new functions to keep output parameters at the end. v6: - fixed several memory leaks due to struct ds not destroyed / char* not freed. - explained why we don't rate limit messages about unbound localnet ports. - docs: fixed a missing space between sentences. - nit: rearranged code inside controller/patch.c to avoid an `if`. v7: - simplified new build_* functions by removing stage_hint calculation. - simplified signature of build_pre_acl_flows_for_nbsp. - renamed build_pre_acl_flows_for_nbsp -> build_pre_acl_flows. - nit: removed redundant newlines between new build_* functions. --- controller/binding.c | 16 ++ controller/patch.c | 31 ++- northd/ovn-northd.c | 474 ++++++++++++++++++++------------------ ovn-architecture.7.xml | 50 ++-- ovn-nb.xml | 23 +- ovn-sb.xml | 21 +- tests/ovn.at | 504 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 862 insertions(+), 257 deletions(-)