From patchwork Wed May 31 20:04:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1788505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.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=N5peiLjU; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWgGw17KRz20PW for ; Thu, 1 Jun 2023 06:05:12 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 500CE429A7; Wed, 31 May 2023 20:05:09 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 500CE429A7 Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=N5peiLjU X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m8DIsvzSEHHS; Wed, 31 May 2023 20:05:06 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 5C3A341E4D; Wed, 31 May 2023 20:05:04 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5C3A341E4D Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4C313C007C; Wed, 31 May 2023 20:05:03 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id E0B19C0037 for ; Wed, 31 May 2023 20:05:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 954FD41E45 for ; Wed, 31 May 2023 20:05:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 954FD41E45 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D4QGzxQ3anip for ; Wed, 31 May 2023 20:05:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3A56A41CEF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3A56A41CEF for ; Wed, 31 May 2023 20:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685563498; 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: in-reply-to:in-reply-to:references:references; bh=vAKoxZLD0kxJVN1vzjQ3AqDht0CPR3qao6uIiaF3qso=; b=N5peiLjU+NNSbjfGRbXhAdtjDitWPdWYPLjR6qilKX0u42Tw3zqucn7F14HJeGMwOgU94g zXbCmR7H7oU+CiTtRKgdgd4gUMwifJs2jI+knkrl1gCrtN5YZNLyiDmsMAmGbiDyagYGPI 86Ax43AFXGlRZgBMgUBYv1lpAotxScs= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-HxLY2A3EMmWgZ1Mc-paHaQ-1; Wed, 31 May 2023 16:04:57 -0400 X-MC-Unique: HxLY2A3EMmWgZ1Mc-paHaQ-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-75aff486a3eso966219185a.1 for ; Wed, 31 May 2023 13:04:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685563497; x=1688155497; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vAKoxZLD0kxJVN1vzjQ3AqDht0CPR3qao6uIiaF3qso=; b=djW9lyjyn4HltHRJd5RVqw9Mhcz4xrLuZ2500mnWi65vfLFE4wisJWsMX3eEZl+XmV quG7yx3Xa9DRKSsMtssxiFgz5ikxOISc9UuJZWhSJeIwKkDQlGF1iDw2am3ebLkmTbyN GQ6d80hk5XsUTL3p+wAY2EkBxFhyKvyE5pU2i0UIJNDB519E7FYXHVkb622r1DyUEtzR hbMSmvfcMUVei3LgJC2OD4qBed1nSvW5EXZbi8H/G6cwj99XZ4TdFeCGwKBhS5IizEN/ dg77x0yuemyEk91k3ub4Q7qdRtgGsMpbI50DLTk8A5JOgL/tE9ssrbI8zAMX0p+Lccvs 0ZkA== X-Gm-Message-State: AC+VfDz4IU/BHulaqDZDTI9229eCSmEsSVM1fMRCzLtfnpO5nToF7dxI TIAx61k2XYjgT/P/75T9f7hFBZma0b+myeLvw5sYaEAR8L6iz0ocbLWhQCSOFJDqTHKv5IHE+qu fVIjJGdCbYRQkjsi6M8lGZl2aiPQ/6yEhfmJyrzRBV17m598K8hum79WyLKyHGfwJGAWb4JIJ X-Received: by 2002:a05:620a:4895:b0:75b:23a0:de84 with SMTP id ea21-20020a05620a489500b0075b23a0de84mr7822269qkb.2.1685563496619; Wed, 31 May 2023 13:04:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6opZEnIsnAolTAt5wdsjQUu/yw8C+Y7cFidOHcmAqKC4oJXaBdtqVvXEua0HiPpZy4wtB8vA== X-Received: by 2002:a05:620a:4895:b0:75b:23a0:de84 with SMTP id ea21-20020a05620a489500b0075b23a0de84mr7822247qkb.2.1685563496198; Wed, 31 May 2023 13:04:56 -0700 (PDT) Received: from fedora34.localdomain.com (cpe-172-73-180-250.carolina.res.rr.com. [172.73.180.250]) by smtp.gmail.com with ESMTPSA id k23-20020a05620a143700b007591805caefsm5578488qkj.18.2023.05.31.13.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 13:04:55 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Wed, 31 May 2023 20:04:48 +0000 Message-Id: <20230531200451.3541416-2-ihrachys@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230531200451.3541416-1-ihrachys@redhat.com> References: <20230531200451.3541416-1-ihrachys@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Dumitru Ceara Subject: [ovs-dev] [PATCH ovn branch-23.03 2/5] Track interface MTU in if-status-mgr 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" This will be used in a later patch to calculate the effective interface MTU after considering tunneling overhead. NOTE: ideally, OVN would support Logical_Port MTU, in which case we wouldn't have to track OVSDB for interfaces. Signed-off-by: Ihar Hrachyshka Acked-by: Dumitru Ceara Signed-off-by: Mark Michelson (cherry picked from commit 6562f50edf8e03f7018ae8decc442905ac7f6325) --- controller/binding.c | 4 +- controller/if-status.c | 40 ++++++++++-- controller/if-status.h | 5 ++ controller/ovn-controller.c | 122 ++++++++++++++++++++++++++++++++++++ controller/ovsport.c | 9 +++ controller/ovsport.h | 2 + controller/physical.h | 2 + 7 files changed, 178 insertions(+), 6 deletions(-) diff --git a/controller/binding.c b/controller/binding.c index 248de5148..11e99911c 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -1273,7 +1273,7 @@ claim_lport(const struct sbrec_port_binding *pb, } set_pb_chassis_in_sbrec(pb, chassis_rec, true); } else { - if_status_mgr_claim_iface(if_mgr, pb, chassis_rec, + if_status_mgr_claim_iface(if_mgr, pb, chassis_rec, iface_rec, sb_readonly); } register_claim_timestamp(pb->logical_port, now); @@ -1288,7 +1288,7 @@ claim_lport(const struct sbrec_port_binding *pb, !smap_get_bool(&iface_rec->external_ids, OVN_INSTALLED_EXT_ID, false)) { if_status_mgr_claim_iface(if_mgr, pb, chassis_rec, - sb_readonly); + iface_rec, sb_readonly); } } } diff --git a/controller/if-status.c b/controller/if-status.c index 8503e5daa..2bff284d6 100644 --- a/controller/if-status.c +++ b/controller/if-status.c @@ -18,12 +18,14 @@ #include "binding.h" #include "if-status.h" #include "ofctrl-seqno.h" +#include "ovsport.h" #include "simap.h" #include "lib/hmapx.h" #include "lib/util.h" #include "timeval.h" #include "openvswitch/vlog.h" +#include "lib/vswitch-idl.h" #include "lib/ovn-sb-idl.h" VLOG_DEFINE_THIS_MODULE(if_status); @@ -181,6 +183,7 @@ struct ovs_iface { * be fully programmed in OVS. Only used in state * OIF_INSTALL_FLOWS. */ + uint16_t mtu; /* Extracted from OVS interface.mtu field. */ }; static uint64_t ifaces_usage; @@ -205,9 +208,10 @@ struct if_status_mgr { uint32_t iface_seqno; }; -static struct ovs_iface *ovs_iface_create(struct if_status_mgr *, - const char *iface_id, - enum if_state ); +static struct ovs_iface * +ovs_iface_create(struct if_status_mgr *, const char *iface_id, + const struct ovsrec_interface *iface_rec, + enum if_state); static void add_to_ovn_uninstall_hash(struct if_status_mgr *, const char *, const struct uuid *); static void ovs_iface_destroy(struct if_status_mgr *, struct ovs_iface *); @@ -272,13 +276,14 @@ void if_status_mgr_claim_iface(struct if_status_mgr *mgr, const struct sbrec_port_binding *pb, const struct sbrec_chassis *chassis_rec, + const struct ovsrec_interface *iface_rec, bool sb_readonly) { const char *iface_id = pb->logical_port; struct ovs_iface *iface = shash_find_data(&mgr->ifaces, iface_id); if (!iface) { - iface = ovs_iface_create(mgr, iface_id, OIF_CLAIMED); + iface = ovs_iface_create(mgr, iface_id, iface_rec, OIF_CLAIMED); } memcpy(&iface->pb_uuid, &pb->header_.uuid, sizeof(iface->pb_uuid)); @@ -639,8 +644,34 @@ ovn_uninstall_hash_account_mem(const char *name, bool erase) } } +uint16_t +if_status_mgr_iface_get_mtu(const struct if_status_mgr *mgr, + const char *iface_id) +{ + const struct ovs_iface *iface = shash_find_data(&mgr->ifaces, iface_id); + return iface ? iface->mtu : 0; +} + +bool +if_status_mgr_iface_update(const struct if_status_mgr *mgr, + const struct ovsrec_interface *iface_rec) +{ + const char *iface_id = smap_get(&iface_rec->external_ids, "iface-id"); + if (!iface_id) { + return false; + } + uint16_t mtu = get_iface_mtu(iface_rec); + struct ovs_iface *iface = shash_find_data(&mgr->ifaces, iface_id); + if (iface && iface->mtu != mtu) { + iface->mtu = mtu; + return true; + } + return false; +} + static struct ovs_iface * ovs_iface_create(struct if_status_mgr *mgr, const char *iface_id, + const struct ovsrec_interface *iface_rec, enum if_state state) { struct ovs_iface *iface = xzalloc(sizeof *iface); @@ -650,6 +681,7 @@ ovs_iface_create(struct if_status_mgr *mgr, const char *iface_id, shash_add_nocopy(&mgr->ifaces, iface->id, iface); ovs_iface_set_state(mgr, iface, state); ovs_iface_account_mem(iface_id, false); + if_status_mgr_iface_update(mgr, iface_rec); return iface; } diff --git a/controller/if-status.h b/controller/if-status.h index 8ba80acd9..55979ece4 100644 --- a/controller/if-status.h +++ b/controller/if-status.h @@ -30,6 +30,7 @@ void if_status_mgr_destroy(struct if_status_mgr *); void if_status_mgr_claim_iface(struct if_status_mgr *, const struct sbrec_port_binding *pb, const struct sbrec_chassis *chassis_rec, + const struct ovsrec_interface *iface_rec, bool sb_readonly); void if_status_mgr_release_iface(struct if_status_mgr *, const char *iface_id); void if_status_mgr_delete_iface(struct if_status_mgr *, const char *iface_id); @@ -56,5 +57,9 @@ bool if_status_handle_claims(struct if_status_mgr *mgr, void if_status_mgr_remove_ovn_installed(struct if_status_mgr *mgr, const char *name, const struct uuid *uuid); +uint16_t if_status_mgr_iface_get_mtu(const struct if_status_mgr *mgr, + const char *iface_id); +bool if_status_mgr_iface_update(const struct if_status_mgr *mgr, + const struct ovsrec_interface *iface_rec); # endif /* controller/if-status.h */ diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c index 13a7d46ef..70c8623ce 100644 --- a/controller/ovn-controller.c +++ b/controller/ovn-controller.c @@ -60,6 +60,7 @@ #include "lib/ovn-dirs.h" #include "lib/ovn-sb-idl.h" #include "lib/ovn-util.h" +#include "ovsport.h" #include "patch.h" #include "vif-plug.h" #include "vif-plug-provider.h" @@ -1060,6 +1061,7 @@ ctrl_register_ovs_idl(struct ovsdb_idl *ovs_idl) ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_name); ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_bfd); ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_bfd_status); + ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_mtu); ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_type); ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_options); ovsdb_idl_track_add_column(ovs_idl, &ovsrec_interface_col_ofport); @@ -1158,6 +1160,56 @@ en_ofctrl_is_connected_run(struct engine_node *node, void *data) engine_set_node_state(node, EN_UNCHANGED); } +struct ed_type_if_status_mgr { + const struct if_status_mgr *manager; + const struct ovsrec_interface_table *iface_table; +}; + +static void * +en_if_status_mgr_init(struct engine_node *node OVS_UNUSED, + struct engine_arg *arg OVS_UNUSED) +{ + struct ed_type_if_status_mgr *data = xzalloc(sizeof *data); + return data; +} + +static void +en_if_status_mgr_cleanup(void *data OVS_UNUSED) +{ +} + +static void +en_if_status_mgr_run(struct engine_node *node, void *data_) +{ + enum engine_node_state state = EN_UNCHANGED; + struct ed_type_if_status_mgr *data = data_; + struct controller_engine_ctx *ctrl_ctx = engine_get_context()->client_ctx; + data->manager = ctrl_ctx->if_mgr; + data->iface_table = EN_OVSDB_GET(engine_get_input("OVS_interface", node)); + + const struct ovsrec_interface *iface; + OVSREC_INTERFACE_TABLE_FOR_EACH (iface, data->iface_table) { + if (if_status_mgr_iface_update(data->manager, iface)) { + state = EN_UPDATED; + } + } + engine_set_node_state(node, state); +} + +static bool +if_status_mgr_ovs_interface_handler(struct engine_node *node, void *data) +{ + struct ed_type_if_status_mgr *data_ = data; + + const struct ovsrec_interface *iface; + OVSREC_INTERFACE_TABLE_FOR_EACH_TRACKED (iface, data_->iface_table) { + if (if_status_mgr_iface_update(data_->manager, iface)) { + engine_set_node_state(node, EN_UPDATED); + } + } + return true; +} + /* This engine node is to wrap the OVS_interface input and maintain a copy of * the old version of data for the column external_ids. * @@ -4056,6 +4108,9 @@ static void init_physical_ctx(struct engine_node *node, const struct ed_type_mff_ovn_geneve *ed_mff_ovn_geneve = engine_get_input_data("mff_ovn_geneve", node); + const struct ovsrec_interface_table *ovs_interface_table = + EN_OVSDB_GET(engine_get_input("if_status_mgr", node)); + const struct ovsrec_open_vswitch_table *ovs_table = EN_OVSDB_GET(engine_get_input("OVS_open_vswitch", node)); const struct ovsrec_bridge_table *bridge_table = @@ -4080,6 +4135,7 @@ static void init_physical_ctx(struct engine_node *node, p_ctx->sbrec_port_binding_by_name = sbrec_port_binding_by_name; p_ctx->sbrec_port_binding_by_datapath = sbrec_port_binding_by_datapath; p_ctx->port_binding_table = port_binding_table; + p_ctx->ovs_interface_table = ovs_interface_table; p_ctx->mc_group_table = multicast_group_table; p_ctx->br_int = br_int; p_ctx->chassis_table = chassis_table; @@ -4093,6 +4149,9 @@ static void init_physical_ctx(struct engine_node *node, p_ctx->patch_ofports = &non_vif_data->patch_ofports; p_ctx->chassis_tunnels = &non_vif_data->chassis_tunnels; + struct controller_engine_ctx *ctrl_ctx = engine_get_context()->client_ctx; + p_ctx->if_mgr = ctrl_ctx->if_mgr; + pflow_output_get_debug(node, &p_ctx->debug); } @@ -4136,6 +4195,63 @@ en_pflow_output_run(struct engine_node *node, void *data) engine_set_node_state(node, EN_UPDATED); } +static bool +pflow_output_if_status_mgr_handler(struct engine_node *node, + void *data) +{ + struct ed_type_pflow_output *pfo = data; + struct ed_type_runtime_data *rt_data = + engine_get_input_data("runtime_data", node); + struct ed_type_non_vif_data *non_vif_data = + engine_get_input_data("non_vif_data", node); + struct ed_type_if_status_mgr *if_mgr_data = + engine_get_input_data("if_status_mgr", node); + + struct physical_ctx p_ctx; + init_physical_ctx(node, rt_data, non_vif_data, &p_ctx); + + const struct ovsrec_interface *iface; + OVSREC_INTERFACE_TABLE_FOR_EACH_TRACKED (iface, if_mgr_data->iface_table) { + const char *iface_id = smap_get(&iface->external_ids, "iface-id"); + if (!iface_id) { + continue; + } + + const struct sbrec_port_binding *pb = lport_lookup_by_name( + p_ctx.sbrec_port_binding_by_name, iface_id); + if (!pb) { + continue; + } + if (pb->n_additional_chassis) { + /* Update flows for all ports in datapath. */ + struct sbrec_port_binding *target = + sbrec_port_binding_index_init_row( + p_ctx.sbrec_port_binding_by_datapath); + sbrec_port_binding_index_set_datapath(target, pb->datapath); + + const struct sbrec_port_binding *binding; + SBREC_PORT_BINDING_FOR_EACH_EQUAL ( + binding, target, p_ctx.sbrec_port_binding_by_datapath) { + bool removed = sbrec_port_binding_is_deleted(binding); + if (!physical_handle_flows_for_lport(binding, removed, &p_ctx, + &pfo->flow_table)) { + return false; + } + } + sbrec_port_binding_index_destroy_row(target); + } else { + /* If any multichassis ports, update flows for the port. */ + bool removed = sbrec_port_binding_is_deleted(pb); + if (!physical_handle_flows_for_lport(pb, removed, &p_ctx, + &pfo->flow_table)) { + return false; + } + } + engine_set_node_state(node, EN_UPDATED); + } + return true; +} + static bool pflow_output_sb_port_binding_handler(struct engine_node *node, void *data) @@ -4619,6 +4735,7 @@ main(int argc, char *argv[]) ENGINE_NODE_WITH_CLEAR_TRACK_DATA(port_groups, "port_groups"); ENGINE_NODE(northd_options, "northd_options"); ENGINE_NODE(dhcp_options, "dhcp_options"); + ENGINE_NODE(if_status_mgr, "if_status_mgr"); ENGINE_NODE_WITH_CLEAR_TRACK_DATA(lb_data, "lb_data"); #define SB_NODE(NAME, NAME_STR) ENGINE_NODE_SB(NAME, NAME_STR); @@ -4657,6 +4774,9 @@ main(int argc, char *argv[]) engine_add_input(&en_non_vif_data, &en_ovs_interface, non_vif_data_ovs_iface_handler); + engine_add_input(&en_if_status_mgr, &en_ovs_interface, + if_status_mgr_ovs_interface_handler); + /* Note: The order of inputs is important, all OVS interface changes must * be handled before any ct_zone changes. */ @@ -4667,6 +4787,8 @@ main(int argc, char *argv[]) engine_add_input(&en_pflow_output, &en_sb_chassis, pflow_lflow_output_sb_chassis_handler); + engine_add_input(&en_pflow_output, &en_if_status_mgr, + pflow_output_if_status_mgr_handler); engine_add_input(&en_pflow_output, &en_sb_port_binding, pflow_output_sb_port_binding_handler); engine_add_input(&en_pflow_output, &en_sb_multicast_group, diff --git a/controller/ovsport.c b/controller/ovsport.c index ec38c3fca..ebcb9cb6d 100644 --- a/controller/ovsport.c +++ b/controller/ovsport.c @@ -264,3 +264,12 @@ maintain_interface_smap_column( } } } + +uint16_t +get_iface_mtu(const struct ovsrec_interface *iface) +{ + if (!iface || !iface->n_mtu || iface->mtu[0] <= 0) { + return 0; + } + return (uint16_t) iface->mtu[0]; +} diff --git a/controller/ovsport.h b/controller/ovsport.h index e355ff7ff..c40c1855a 100644 --- a/controller/ovsport.h +++ b/controller/ovsport.h @@ -57,4 +57,6 @@ const struct ovsrec_port * ovsport_lookup_by_interfaces( const struct ovsrec_port * ovsport_lookup_by_interface( struct ovsdb_idl_index *, struct ovsrec_interface *); +uint16_t get_iface_mtu(const struct ovsrec_interface *); + #endif /* lib/ovsport.h */ diff --git a/controller/physical.h b/controller/physical.h index f450dca94..1f1ed55ef 100644 --- a/controller/physical.h +++ b/controller/physical.h @@ -52,11 +52,13 @@ struct physical_ctx { struct ovsdb_idl_index *sbrec_port_binding_by_name; struct ovsdb_idl_index *sbrec_port_binding_by_datapath; const struct sbrec_port_binding_table *port_binding_table; + const struct ovsrec_interface_table *ovs_interface_table; const struct sbrec_multicast_group_table *mc_group_table; const struct ovsrec_bridge *br_int; const struct sbrec_chassis_table *chassis_table; const struct sbrec_chassis *chassis; const struct sset *active_tunnels; + const struct if_status_mgr *if_mgr; struct hmap *local_datapaths; struct sset *local_lports; const struct simap *ct_zones;