From patchwork Thu Sep 17 03:21:18 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Ihar Hrachyshka
X-Patchwork-Id: 1365792
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.137; helo=fraxinus.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=cF1IyzDz;
dkim-atps=neutral
Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 4BsMhf0Wzqz9sRf
for ; Thu, 17 Sep 2020 13:22:06 +1000 (AEST)
Received: from localhost (localhost [127.0.0.1])
by fraxinus.osuosl.org (Postfix) with ESMTP id 0B45086F77;
Thu, 17 Sep 2020 03:22:04 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from fraxinus.osuosl.org ([127.0.0.1])
by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id ATUvZnkPXGve; Thu, 17 Sep 2020 03:21:57 +0000 (UTC)
Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])
by fraxinus.osuosl.org (Postfix) with ESMTP id C675686DDB;
Thu, 17 Sep 2020 03:21:57 +0000 (UTC)
Received: from lf-lists.osuosl.org (localhost [127.0.0.1])
by lists.linuxfoundation.org (Postfix) with ESMTP id B2A7AC0864;
Thu, 17 Sep 2020 03:21:57 +0000 (UTC)
X-Original-To: dev@openvswitch.org
Delivered-To: ovs-dev@lists.linuxfoundation.org
Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])
by lists.linuxfoundation.org (Postfix) with ESMTP id BAC17C0051
for ; Thu, 17 Sep 2020 03:21:56 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by silver.osuosl.org (Postfix) with ESMTP id 2D3AE2E0DA
for ; Thu, 17 Sep 2020 03:21:56 +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 xtthyFbYixWC for ;
Thu, 17 Sep 2020 03:21:49 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from us-smtp-delivery-124.mimecast.com
(us-smtp-delivery-124.mimecast.com [216.205.24.124])
by silver.osuosl.org (Postfix) with ESMTPS id 33AE82DE28
for ; Thu, 17 Sep 2020 03:21:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
s=mimecast20190719; t=1600312907;
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=OriGw4GnL3E82dXO6Nlc0iUr4Ww2ywFLWrnT6awi20I=;
b=cF1IyzDzjyUJd6e2LQUndk+JECpf+7sJYfRxoUrmoaMXSFhC7olNcV1LT2yno7b+YciK2B
yBOmXlx0CO1gxH+cdvcfavdIHQNYjuc9U5cIpRx3cuRvZE6xuLtnqOT5gZETP4ilnhrhiF
DfjXfQ7ES/SuJVJEL+Xnf5pUlHPC668=
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-205-2OKngJ8VNCOsxdYTNQzh4w-1; Wed, 16 Sep 2020 23:21:33 -0400
X-MC-Unique: 2OKngJ8VNCOsxdYTNQzh4w-1
Received: by mail-qt1-f199.google.com with SMTP id g10so681595qto.1
for ; Wed, 16 Sep 2020 20:21:33 -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=OriGw4GnL3E82dXO6Nlc0iUr4Ww2ywFLWrnT6awi20I=;
b=NIY4D9HWVMl8MxX2rO308FohYQu9AFkQZJNTIYIRUqdPi+0wde+ugaA7dPOIcPxQQa
39p7LtwqIEAa6VKXIfs7ZzDPmjNwrw5Z6PDCzJy2Ew/sMx8EMeKdY/7qLV0jupXERO+i
Vb8f7QCqExIohLBpOCfk3fKhL6iDcszwigh+cR3SqT6COgnhMElh3JZk1HWPKOPE8jNL
VYo7bNhzw7i4u5FvCCBxiXO0S59mw/+3ynj02i9xjegfnqUR7vyjEZo1KSrc+LlxNbCx
PnPoGWJj4qvgBYNBv8URxwgBjn55mJu3il7mOjLfXVQCB5cT6onnBCJF0rFn7jr9ncbR
d2gQ==
X-Gm-Message-State: AOAM533gAjUriEadHXTEkLccN1KkVvuLc2v+JzVwQTN0KDsTD5lHnbnM
5pqyKj/hBoFIk1SlQ5GYSFM5SdX0JiKVEQ+WnSPgSTy3CeHcW7AU72Ejiz6JxRGOrQ88FXryvve
aSP3TK56X/pVX
X-Received: by 2002:a0c:ec87:: with SMTP id u7mr10208023qvo.50.1600312890615;
Wed, 16 Sep 2020 20:21:30 -0700 (PDT)
X-Google-Smtp-Source:
ABdhPJyOv0Pqc7GJ0G4OCpscI3VjQwJlIkOAi0KxRa0BExD6mrjDNNzRx1pmweHdqgaZ9vl1eFTnYQ==
X-Received: by 2002:a0c:ec87:: with SMTP id u7mr10207982qvo.50.1600312889387;
Wed, 16 Sep 2020 20:21:29 -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 d5sm21717876qtm.36.2020.09.16.20.21.27
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 16 Sep 2020 20:21:28 -0700 (PDT)
From: Ihar Hrachyshka
To: dev@openvswitch.org
Date: Wed, 16 Sep 2020 23:21:18 -0400
Message-Id: <20200917032118.1610794-1-ihrachys@redhat.com>
X-Mailer: git-send-email 2.26.2
MIME-Version: 1.0
Authentication-Results: relay.mimecast.com;
auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ihrachys@redhat.com
X-Mimecast-Spam-Score: 0.102
X-Mimecast-Originator: redhat.com
Subject: [ovs-dev] [PATCH v7 ovn] Add VXLAN support for non-VTEP datapath
bindings
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"
Because of limited space in VXLAN VNI to pass over all three of -
datapath id, ingress port, egress port - the implementation ignores
ingress; and splits the remaining 24 bits of VNI into two chunks, 12
bits each - one for datapath and one for egress port.
This also bumps priority for ramp switch flows to 110 to prioritize
them over regular non-ramp VXLAN flows.
Limitations: because ingress port is not passed, ACLs that rely on it
won't work with VXLAN; reduced number of networks and ports per
network (max 4096 for both).
NB consumers may use NB_Global options:max_tunid to determine maximum
capacity for logical switches supported by the setup.
Renamed MLF_RCV_FROM_VXLAN_BIT into MLF_RCV_FROM_RAMP_BIT to reflect
the new use case.
Added test scenarios that ping through VXLAN tunnel between two
hypervisors added. Also max_tunid is validated.
Signed-off-by: Ihar Hrachyshka
---
Changes:
- v2: run several dvr connectivity tests with vxlan tunnels.
- v2: update ovn-architecture.7 documentation.
- v3: added is_vxlan helper.
- v4: reduce max tunid when vxlan is enabled in cluster.
- v4: added options:max_tunid key for NB_Global.
- v5: rebased.
- v5: renamed MLF_RCV_FROM_VXLAN -> MLF_RCV_FROM_RAMP.
- v5: simplify flows for vxlan non-ramp scenario, don't match against
tun_id.
- v5: bumped priority for ramp flows to 110 to prioritize them over
regular non-ramp vxlan flows.
- v6: added NEWS entry.
- v7: return bool from is_vxlan_mode.
- v7: document that IC is not supported when VXLAN enabled.
- v7: move max_tunid description in ovn-nb(5) to a new "Read-Only"
section.
---
NEWS | 1 +
controller/physical.c | 65 +-
include/ovn/logical-fields.h | 12 +-
lib/ovn-util.h | 5 +
northd/ovn-northd.c | 78 ++-
ovn-architecture.7.xml | 110 +++-
ovn-nb.xml | 10 +
tests/ovn-macros.at | 4 +-
tests/ovn.at | 1083 +++++++++++++++++-----------------
9 files changed, 725 insertions(+), 643 deletions(-)
diff --git a/NEWS b/NEWS
index dece5831c..ee5c2c393 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ OVN v20.09.0 - xx xxx xxxx
this mechanism should update their code to use this new table.
- Added support for external ip based NAT. Now, besides the logical ip,
external ips will also decide if a packet will be NATed or not.
+ - Added support for VXLAN encapsulation (not just for ramp/VTEP switches).
OVN v20.06.0
--------------------------
diff --git a/controller/physical.c b/controller/physical.c
index 535c77730..a7f3efd2f 100644
--- a/controller/physical.c
+++ b/controller/physical.c
@@ -180,7 +180,8 @@ static void
put_encapsulation(enum mf_field_id mff_ovn_geneve,
const struct chassis_tunnel *tun,
const struct sbrec_datapath_binding *datapath,
- uint16_t outport, struct ofpbuf *ofpacts)
+ uint16_t outport, bool is_ramp_switch,
+ struct ofpbuf *ofpacts)
{
if (tun->type == GENEVE) {
put_load(datapath->tunnel_key, MFF_TUN_ID, 0, 24, ofpacts);
@@ -191,7 +192,12 @@ put_encapsulation(enum mf_field_id mff_ovn_geneve,
MFF_TUN_ID, 0, 64, ofpacts);
put_move(MFF_LOG_INPORT, 0, MFF_TUN_ID, 40, 15, ofpacts);
} else if (tun->type == VXLAN) {
- put_load(datapath->tunnel_key, MFF_TUN_ID, 0, 24, ofpacts);
+ uint64_t vni = datapath->tunnel_key;
+ if (!is_ramp_switch) {
+ /* Only some bits are used for regular tunnels. */
+ vni |= (uint64_t) outport << 12;
+ }
+ put_load(vni, MFF_TUN_ID, 0, 24, ofpacts);
} else {
OVS_NOT_REACHED();
}
@@ -323,8 +329,9 @@ put_remote_port_redirect_overlay(const struct
if (!rem_tun) {
return;
}
- put_encapsulation(mff_ovn_geneve, tun, binding->datapath,
- port_key, ofpacts_p);
+ put_encapsulation(mff_ovn_geneve, tun, binding->datapath, port_key,
+ !strcmp(binding->type, "vtep"),
+ ofpacts_p);
/* Output to tunnel. */
ofpact_put_OUTPUT(ofpacts_p)->port = rem_tun->ofport;
} else {
@@ -360,8 +367,9 @@ put_remote_port_redirect_overlay(const struct
return;
}
- put_encapsulation(mff_ovn_geneve, tun, binding->datapath,
- port_key, ofpacts_p);
+ put_encapsulation(mff_ovn_geneve, tun, binding->datapath, port_key,
+ !strcmp(binding->type, "vtep"),
+ ofpacts_p);
/* Output to tunnels with active/backup */
struct ofpact_bundle *bundle = ofpact_put_BUNDLE(ofpacts_p);
@@ -1370,7 +1378,7 @@ consider_mc_group(enum mf_field_id mff_ovn_geneve,
if (!prev || tun->type != prev->type) {
put_encapsulation(mff_ovn_geneve, tun, mc->datapath,
- mc->tunnel_key, &remote_ofpacts);
+ mc->tunnel_key, true, &remote_ofpacts);
prev = tun;
}
ofpact_put_OUTPUT(&remote_ofpacts)->port = tun->ofport;
@@ -1615,11 +1623,12 @@ physical_run(struct physical_ctx *p_ctx,
* Process packets that arrive from a remote hypervisor (by matching
* on tunnel in_port). */
- /* Add flows for Geneve and STT encapsulations. These
- * encapsulations have metadata about the ingress and egress logical
- * ports. We set MFF_LOG_DATAPATH, MFF_LOG_INPORT, and
- * MFF_LOG_OUTPORT from the tunnel key data, then resubmit to table
- * 33 to handle packets to the local hypervisor. */
+ /* Add flows for Geneve, STT and VXLAN encapsulations. Geneve and STT
+ * encapsulations have metadata about the ingress and egress logical ports.
+ * VXLAN encapsulations have metadata about the egress logical port only.
+ * We set MFF_LOG_DATAPATH, MFF_LOG_INPORT, and MFF_LOG_OUTPORT from the
+ * tunnel key data where possible, then resubmit to table 33 to handle
+ * packets to the local hypervisor. */
HMAP_FOR_EACH (tun, hmap_node, &tunnels) {
struct match match = MATCH_CATCHALL_INITIALIZER;
match_set_in_port(&match, tun->ofport);
@@ -1636,8 +1645,10 @@ physical_run(struct physical_ctx *p_ctx,
put_move(MFF_TUN_ID, 24, MFF_LOG_OUTPORT, 0, 16, &ofpacts);
put_move(MFF_TUN_ID, 0, MFF_LOG_DATAPATH, 0, 24, &ofpacts);
} else if (tun->type == VXLAN) {
- /* We'll handle VXLAN later. */
- continue;
+ /* Add flows for non-VTEP tunnels. Split VNI into two 12-bit
+ * sections and use them for datapath and outport IDs. */
+ put_move(MFF_TUN_ID, 12, MFF_LOG_OUTPORT, 0, 12, &ofpacts);
+ put_move(MFF_TUN_ID, 0, MFF_LOG_DATAPATH, 0, 12, &ofpacts);
} else {
OVS_NOT_REACHED();
}
@@ -1648,11 +1659,7 @@ physical_run(struct physical_ctx *p_ctx,
&ofpacts, hc_uuid);
}
- /* Add flows for VXLAN encapsulations. Due to the limited amount of
- * metadata, we only support VXLAN for connections to gateways. The
- * VNI is used to populate MFF_LOG_DATAPATH. The gateway's logical
- * port is set to MFF_LOG_INPORT. Then the packet is resubmitted to
- * table 16 to determine the logical egress port. */
+ /* Handle ramp switch encapsulations. */
HMAP_FOR_EACH (tun, hmap_node, &tunnels) {
if (tun->type != VXLAN) {
continue;
@@ -1660,7 +1667,9 @@ physical_run(struct physical_ctx *p_ctx,
SBREC_PORT_BINDING_TABLE_FOR_EACH (binding,
p_ctx->port_binding_table) {
- struct match match = MATCH_CATCHALL_INITIALIZER;
+ if (strcmp(binding->type, "vtep")) {
+ continue;
+ }
if (!binding->chassis ||
!encaps_tunnel_id_match(tun->chassis_id,
@@ -1668,18 +1677,24 @@ physical_run(struct physical_ctx *p_ctx,
continue;
}
+ struct match match = MATCH_CATCHALL_INITIALIZER;
match_set_in_port(&match, tun->ofport);
+ ofpbuf_clear(&ofpacts);
+
+ /* Add flows for ramp switches. The VNI is used to populate
+ * MFF_LOG_DATAPATH. The gateway's logical port is set to
+ * MFF_LOG_INPORT. Then the packet is resubmitted to table 8
+ * to determine the logical egress port. */
match_set_tun_id(&match, htonll(binding->datapath->tunnel_key));
- ofpbuf_clear(&ofpacts);
put_move(MFF_TUN_ID, 0, MFF_LOG_DATAPATH, 0, 24, &ofpacts);
put_load(binding->tunnel_key, MFF_LOG_INPORT, 0, 15, &ofpacts);
- /* For packets received from a vxlan tunnel, set a flag to that
+ /* For packets received from a ramp tunnel, set a flag to that
* effect. */
- put_load(1, MFF_LOG_FLAGS, MLF_RCV_FROM_VXLAN_BIT, 1, &ofpacts);
+ put_load(1, MFF_LOG_FLAGS, MLF_RCV_FROM_RAMP_BIT, 1, &ofpacts);
put_resubmit(OFTABLE_LOG_INGRESS_PIPELINE, &ofpacts);
- ofctrl_add_flow(flow_table, OFTABLE_PHY_TO_LOG, 100,
+ ofctrl_add_flow(flow_table, OFTABLE_PHY_TO_LOG, 110,
binding->header_.uuid.parts[0],
&match, &ofpacts, hc_uuid);
}
@@ -1696,7 +1711,7 @@ physical_run(struct physical_ctx *p_ctx,
struct match match;
match_init_catchall(&match);
match_set_reg_masked(&match, MFF_LOG_FLAGS - MFF_REG0,
- MLF_RCV_FROM_VXLAN, MLF_RCV_FROM_VXLAN);
+ MLF_RCV_FROM_RAMP, MLF_RCV_FROM_RAMP);
/* Resubmit to table 33. */
ofpbuf_clear(&ofpacts);
diff --git a/include/ovn/logical-fields.h b/include/ovn/logical-fields.h
index 61d17d14f..ac6f2f909 100644
--- a/include/ovn/logical-fields.h
+++ b/include/ovn/logical-fields.h
@@ -51,7 +51,7 @@ void ovn_init_symtab(struct shash *symtab);
/* MFF_LOG_FLAGS_REG bit assignments */
enum mff_log_flags_bits {
MLF_ALLOW_LOOPBACK_BIT = 0,
- MLF_RCV_FROM_VXLAN_BIT = 1,
+ MLF_RCV_FROM_RAMP_BIT = 1,
MLF_FORCE_SNAT_FOR_DNAT_BIT = 2,
MLF_FORCE_SNAT_FOR_LB_BIT = 3,
MLF_LOCAL_ONLY_BIT = 4,
@@ -64,11 +64,11 @@ enum mff_log_flags {
/* Allow outputting back to inport. */
MLF_ALLOW_LOOPBACK = (1 << MLF_ALLOW_LOOPBACK_BIT),
- /* Indicate that a packet was received from a VXLAN tunnel to
- * compensate for the lack of egress port information available in
- * VXLAN encapsulation. Egress port information is available for
- * Geneve and STT tunnel types. */
- MLF_RCV_FROM_VXLAN = (1 << MLF_RCV_FROM_VXLAN_BIT),
+ /* Indicate that a packet was received from a ramp switch to compensate for
+ * the lack of egress port information available in ramp switch
+ * encapsulation. Egress port information is available for Geneve, STT and
+ * regular VXLAN tunnel types. */
+ MLF_RCV_FROM_RAMP = (1 << MLF_RCV_FROM_RAMP_BIT),
/* Indicate that a packet needs a force SNAT in the gateway router when
* DNAT has taken place. */
diff --git a/lib/ovn-util.h b/lib/ovn-util.h
index 0f7b501f1..58d41a582 100644
--- a/lib/ovn-util.h
+++ b/lib/ovn-util.h
@@ -16,6 +16,7 @@
#ifndef OVN_UTIL_H
#define OVN_UTIL_H 1
+#include "lib/ovn-sb-idl.h"
#include "lib/packets.h"
#include "include/ovn/version.h"
@@ -107,6 +108,10 @@ void ovn_conn_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
#define OVN_MAX_DP_KEY_LOCAL (OVN_MAX_DP_KEY - OVN_MAX_DP_GLOBAL_NUM)
#define OVN_MIN_DP_KEY_GLOBAL (OVN_MAX_DP_KEY_LOCAL + 1)
#define OVN_MAX_DP_KEY_GLOBAL OVN_MAX_DP_KEY
+
+#define OVN_MAX_DP_VXLAN_KEY ((1u << 12) - 1)
+#define OVN_MAX_DP_VXLAN_KEY_LOCAL (OVN_MAX_DP_KEY - OVN_MAX_DP_GLOBAL_NUM)
+
struct hmap;
void ovn_destroy_tnlids(struct hmap *tnlids);
void ovn_add_tnlid(struct hmap *set, uint32_t tnlid);
diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index db14909fc..92add9125 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -64,6 +64,7 @@ struct northd_context {
struct ovsdb_idl *ovnsb_idl;
struct ovsdb_idl_txn *ovnnb_txn;
struct ovsdb_idl_txn *ovnsb_txn;
+ struct ovsdb_idl_index *sbrec_chassis_by_name;
struct ovsdb_idl_index *sbrec_ha_chassis_grp_by_name;
struct ovsdb_idl_index *sbrec_mcast_group_by_name_dp;
struct ovsdb_idl_index *sbrec_ip_mcast_by_dp;
@@ -1189,12 +1190,34 @@ join_datapaths(struct northd_context *ctx, struct hmap *datapaths,
}
}
+static bool is_vxlan_mode(struct ovsdb_idl *ovnsb_idl)
+{
+ const struct sbrec_chassis *chassis;
+ SBREC_CHASSIS_FOR_EACH (chassis, ovnsb_idl) {
+ for (int i = 0; i < chassis->n_encaps; i++) {
+ if (!strcmp(chassis->encaps[i]->type, "vxlan")) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+static uint32_t
+get_ovn_max_dp_key_local(struct northd_context *ctx) {
+ if (is_vxlan_mode(ctx->ovnsb_idl)) {
+ /* OVN_MAX_DP_GLOBAL_NUM doesn't apply for vxlan mode. */
+ return OVN_MAX_DP_VXLAN_KEY;
+ }
+ return OVN_MAX_DP_KEY - OVN_MAX_DP_GLOBAL_NUM;
+}
+
static uint32_t
-ovn_datapath_allocate_key(struct hmap *dp_tnlids)
+ovn_datapath_allocate_key(struct northd_context *ctx, struct hmap *dp_tnlids)
{
static uint32_t hint;
return ovn_allocate_tnlid(dp_tnlids, "datapath", OVN_MIN_DP_KEY_LOCAL,
- OVN_MAX_DP_KEY_LOCAL, &hint);
+ get_ovn_max_dp_key_local(ctx), &hint);
}
/* Updates the southbound Datapath_Binding table so that it contains the
@@ -1237,7 +1260,7 @@ build_datapaths(struct northd_context *ctx, struct hmap *datapaths,
}
}
if (!tunnel_key) {
- tunnel_key = ovn_datapath_allocate_key(&dp_tnlids);
+ tunnel_key = ovn_datapath_allocate_key(ctx, &dp_tnlids);
if (!tunnel_key) {
break;
}
@@ -12110,32 +12133,34 @@ ovnnb_db_run(struct northd_context *ctx,
}
}
- if (!mac_addr_prefix || !monitor_mac) {
- struct smap options;
- smap_clone(&options, &nb->options);
+ struct smap options;
+ smap_clone(&options, &nb->options);
- if (!mac_addr_prefix) {
- eth_addr_random(&mac_prefix);
- memset(&mac_prefix.ea[3], 0, 3);
+ if (!mac_addr_prefix) {
+ eth_addr_random(&mac_prefix);
+ memset(&mac_prefix.ea[3], 0, 3);
- smap_add_format(&options, "mac_prefix",
- "%02"PRIx8":%02"PRIx8":%02"PRIx8,
- mac_prefix.ea[0], mac_prefix.ea[1],
- mac_prefix.ea[2]);
- }
+ smap_add_format(&options, "mac_prefix",
+ "%02"PRIx8":%02"PRIx8":%02"PRIx8,
+ mac_prefix.ea[0], mac_prefix.ea[1],
+ mac_prefix.ea[2]);
+ }
- if (!monitor_mac) {
- eth_addr_random(&svc_monitor_mac_ea);
- snprintf(svc_monitor_mac, sizeof svc_monitor_mac,
- ETH_ADDR_FMT, ETH_ADDR_ARGS(svc_monitor_mac_ea));
- smap_replace(&options, "svc_monitor_mac", svc_monitor_mac);
- }
+ if (!monitor_mac) {
+ eth_addr_random(&svc_monitor_mac_ea);
+ snprintf(svc_monitor_mac, sizeof svc_monitor_mac,
+ ETH_ADDR_FMT, ETH_ADDR_ARGS(svc_monitor_mac_ea));
+ smap_replace(&options, "svc_monitor_mac", svc_monitor_mac);
+ }
- nbrec_nb_global_verify_options(nb);
- nbrec_nb_global_set_options(nb, &options);
+ char *max_tunid = xasprintf("%d", get_ovn_max_dp_key_local(ctx));
+ smap_replace(&options, "max_tunid", max_tunid);
+ free(max_tunid);
- smap_destroy(&options);
- }
+ nbrec_nb_global_verify_options(nb);
+ nbrec_nb_global_set_options(nb, &options);
+
+ smap_destroy(&options);
/* Update the probe interval. */
northd_probe_interval_nb = get_probe_interval(ovnnb_db, nb);
@@ -13009,6 +13034,10 @@ main(int argc, char *argv[])
ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_chassis);
ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_chassis_col_name);
ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_chassis_col_other_config);
+ ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_chassis_col_encaps);
+
+ ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_encap);
+ ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_encap_col_type);
ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_chassis_private);
ovsdb_idl_add_column(ovnsb_idl_loop.idl,
@@ -13122,6 +13151,7 @@ main(int argc, char *argv[])
.ovnnb_txn = ovsdb_idl_loop_run(&ovnnb_idl_loop),
.ovnsb_idl = ovnsb_idl_loop.idl,
.ovnsb_txn = ovsdb_idl_loop_run(&ovnsb_idl_loop),
+ .sbrec_chassis_by_name = sbrec_chassis_by_name,
.sbrec_ha_chassis_grp_by_name = sbrec_ha_chassis_grp_by_name,
.sbrec_mcast_group_by_name_dp = sbrec_mcast_group_by_name_dp,
.sbrec_ip_mcast_by_dp = sbrec_ip_mcast_by_dp,
diff --git a/ovn-architecture.7.xml b/ovn-architecture.7.xml
index b81844f89..6d9057507 100644
--- a/ovn-architecture.7.xml
+++ b/ovn-architecture.7.xml
@@ -1163,11 +1163,14 @@
Geneve and STT tunnels pass this field as part of the tunnel key.
- Although VXLAN tunnels do not explicitly carry a logical input port,
- OVN only uses VXLAN to communicate with gateways that from OVN's
+ Ramp switch VXLAN tunnels do not explicitly carry a logical input port,
+ but since they are used to communicate with gateways that from OVN's
perspective consist of only a single logical port, so that OVN can set
the logical input port field to this one on ingress to the OVN logical
- pipeline.
+ pipeline. As for regular VXLAN tunnels, they don't carry input port
+ field at all. This puts additional limitations on cluster
+ capabilities that are described in
+ Tunnel Encapsulations
section.
@@ -1183,15 +1186,15 @@
- Geneve and STT tunnels pass this field as part of the tunnel key.
- VXLAN tunnels do not transmit the logical output port field.
- Since VXLAN tunnels do not carry a logical output port field in
- the tunnel key, when a packet is received from VXLAN tunnel by
- an OVN hypervisor, the packet is resubmitted to table 8 to
- determine the output port(s); when the packet reaches table 32,
+ Geneve, STT and regular VXLAN tunnels pass this field as part of the
+ tunnel key. Ramp switch VXLAN tunnels do not transmit the logical
+ output port field, and since they do not carry a logical output port
+ field in the tunnel key, when a packet is received from ramp switch
+ VXLAN tunnel by an OVN hypervisor, the packet is resubmitted to table 8
+ to determine the output port(s); when the packet reaches table 32,
these packets are resubmitted to table 33 for local delivery by
- checking a MLF_RCV_FROM_VXLAN flag, which is set when the packet
- arrives from a VXLAN tunnel.
+ checking a MLF_RCV_FROM_RAMP flag, which is set when the packet
+ arrives from a ramp tunnel.
@@ -1263,15 +1266,16 @@
- Table 0 also processes packets that arrive from other chassis. It
+ Table 0 also processes packets that arrive from other chassis. It
distinguishes them from other packets by ingress port, which is a
- tunnel. As with packets just entering the OVN pipeline, the actions
- annotate these packets with logical datapath and logical ingress port
- metadata. In addition, the actions set the logical output port field,
+ tunnel. As with packets just entering the OVN pipeline, the actions
+ annotate these packets with logical datapath metadata. For tunnel types
+ that support it, they are also annotated with logical ingress port
+ metadata. In addition, the actions set the logical output port field,
which is available because in OVN tunneling occurs after the logical
- output port is known. These three pieces of information are obtained
+ output port is known. These pieces of information are obtained
from the tunnel encapsulation metadata (see Tunnel
- Encapsulations
for encoding details). Then the actions resubmit
+ Encapsulations for encoding details). Then the actions resubmit
to table 33 to enter the logical egress pipeline.
@@ -1430,12 +1434,12 @@