From patchwork Fri Aug 23 11:23:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1152127 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 46FJtr3k0Bz9s00 for ; Fri, 23 Aug 2019 21:23:48 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 4ACDEE18; Fri, 23 Aug 2019 11:23:29 +0000 (UTC) X-Original-To: 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 14D21DF2 for ; Fri, 23 Aug 2019 11:23:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D083D8A7 for ; Fri, 23 Aug 2019 11:23:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74BB5308A98C for ; Fri, 23 Aug 2019 11:23:27 +0000 (UTC) Received: from dceara.remote.csb (ovpn-117-75.ams2.redhat.com [10.36.117.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCAE360605 for ; Fri, 23 Aug 2019 11:23:26 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Fri, 23 Aug 2019 13:23:23 +0200 Message-Id: <20190823112319.30602.12918.stgit@dceara.remote.csb> In-Reply-To: <20190823112304.30602.63778.stgit@dceara.remote.csb> References: <20190823112304.30602.63778.stgit@dceara.remote.csb> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 23 Aug 2019 11:23:27 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 ovn 1/3] ofctrl: Avoid recomputing match hash in ofctrl_dup_flow(). 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 Signed-off-by: Dumitru Ceara --- controller/ofctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/ofctrl.c b/controller/ofctrl.c index 8928205..3131baf 100644 --- a/controller/ofctrl.c +++ b/controller/ofctrl.c @@ -743,7 +743,7 @@ ofctrl_dup_flow(struct ovn_flow *src) dst->ofpacts = xmemdup(src->ofpacts, src->ofpacts_len); dst->ofpacts_len = src->ofpacts_len; dst->sb_uuid = src->sb_uuid; - dst->match_hmap_node.hash = ovn_flow_match_hash(dst); + dst->match_hmap_node.hash = src->match_hmap_node.hash; dst->uuid_hindex_node.hash = uuid_hash(&src->sb_uuid); return dst; } From patchwork Fri Aug 23 11:23:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1152128 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 46FJvW31lkz9s00 for ; Fri, 23 Aug 2019 21:24:23 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 24BEEE2C; Fri, 23 Aug 2019 11:23:47 +0000 (UTC) X-Original-To: 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 76E9FE17 for ; Fri, 23 Aug 2019 11:23:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 101EA8A3 for ; Fri, 23 Aug 2019 11:23:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A746B8AC6FD for ; Fri, 23 Aug 2019 11:23:44 +0000 (UTC) Received: from dceara.remote.csb (ovpn-117-75.ams2.redhat.com [10.36.117.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B4A760933 for ; Fri, 23 Aug 2019 11:23:43 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Fri, 23 Aug 2019 13:23:41 +0200 Message-Id: <20190823112332.30602.8218.stgit@dceara.remote.csb> In-Reply-To: <20190823112304.30602.63778.stgit@dceara.remote.csb> References: <20190823112304.30602.63778.stgit@dceara.remote.csb> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Fri, 23 Aug 2019 11:23:44 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 ovn 2/3] ovn-controller: Optimize update of ct-zones external-ids. 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 commit_ct_zones() is called at every ovn-controller iteration but updates to ct-zones don't happen at every iteration. Avoid cloning the br-int->external_ids map unless an update is needed. Signed-off-by: Dumitru Ceara --- controller/ovn-controller.c | 53 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c index 86f29ac..1825c1f 100644 --- a/controller/ovn-controller.c +++ b/controller/ovn-controller.c @@ -531,10 +531,9 @@ static void commit_ct_zones(const struct ovsrec_bridge *br_int, struct shash *pending_ct_zones) { - struct smap new_ids; - smap_clone(&new_ids, &br_int->external_ids); + struct smap ct_add_ids = SMAP_INITIALIZER(&ct_add_ids); + struct sset ct_del_ids = SSET_INITIALIZER(&ct_del_ids); - bool updated = false; struct shash_node *iter; SHASH_FOR_EACH(iter, pending_ct_zones) { struct ct_zone_pending_entry *ctzpe = iter->data; @@ -550,22 +549,60 @@ commit_ct_zones(const struct ovsrec_bridge *br_int, char *user_str = xasprintf("ct-zone-%s", iter->name); if (ctzpe->add) { char *zone_str = xasprintf("%"PRId32, ctzpe->zone); - smap_replace(&new_ids, user_str, zone_str); + struct smap_node *node = + smap_get_node(&br_int->external_ids, user_str); + if (!node || strcmp(node->value, zone_str)) { + smap_add_nocopy(&ct_add_ids, user_str, zone_str); + user_str = NULL; + zone_str = NULL; + } free(zone_str); } else { - smap_remove(&new_ids, user_str); + if (smap_get(&br_int->external_ids, user_str)) { + sset_add(&ct_del_ids, user_str); + } } free(user_str); ctzpe->state = CT_ZONE_DB_SENT; - updated = true; } - if (updated) { + /* Update the bridge external IDs only if really needed (i.e., we must + * add a value or delete one). Rebuilding the external IDs map at + * every run is a costly operation when having lots of ct_zones. + */ + if (!smap_is_empty(&ct_add_ids) || !sset_is_empty(&ct_del_ids)) { + struct smap new_ids = SMAP_INITIALIZER(&new_ids); + + struct smap_node *id; + SMAP_FOR_EACH (id, &br_int->external_ids) { + if (sset_find_and_delete(&ct_del_ids, id->key)) { + continue; + } + + if (smap_get(&ct_add_ids, id->key)) { + continue; + } + + smap_add(&new_ids, id->key, id->value); + } + + struct smap_node *next_id; + SMAP_FOR_EACH_SAFE (id, next_id, &ct_add_ids) { + smap_replace(&new_ids, id->key, id->value); + smap_remove_node(&ct_add_ids, id); + } + ovsrec_bridge_verify_external_ids(br_int); ovsrec_bridge_set_external_ids(br_int, &new_ids); + smap_destroy(&new_ids); } - smap_destroy(&new_ids); + + ovs_assert(smap_is_empty(&ct_add_ids)); + ovs_assert(sset_is_empty(&ct_del_ids)); + + smap_destroy(&ct_add_ids); + sset_destroy(&ct_del_ids); } static void From patchwork Fri Aug 23 11:23:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1152129 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 46FJw936JRz9s00 for ; Fri, 23 Aug 2019 21:24:57 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CF056E36; Fri, 23 Aug 2019 11:23:57 +0000 (UTC) X-Original-To: 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 BCC7AE35 for ; Fri, 23 Aug 2019 11:23:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 18E698A3 for ; Fri, 23 Aug 2019 11:23:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF849315C010 for ; Fri, 23 Aug 2019 11:23:55 +0000 (UTC) Received: from dceara.remote.csb (ovpn-117-75.ams2.redhat.com [10.36.117.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0172569709 for ; Fri, 23 Aug 2019 11:23:54 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Fri, 23 Aug 2019 13:23:52 +0200 Message-Id: <20190823112350.30602.81041.stgit@dceara.remote.csb> In-Reply-To: <20190823112304.30602.63778.stgit@dceara.remote.csb> References: <20190823112304.30602.63778.stgit@dceara.remote.csb> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 23 Aug 2019 11:23:55 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 ovn 3/3] ovn-controller: Minimize SB DB port_binding lookups. 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 Instead of storing only peer_ports in struct local_datapath, store both local-remote mappings for patch ports. Also, it's useful to directly store sbrec_port_binding pointers for all datapath ports as we avoid doing costly sbrec_port_binding index lookups by port name. Signed-off-by: Dumitru Ceara --- controller/binding.c | 19 ++++++++++++--- controller/ovn-controller.h | 11 ++++++++- controller/physical.c | 4 ++- controller/pinctrl.c | 53 +++++++++++-------------------------------- 4 files changed, 41 insertions(+), 46 deletions(-) diff --git a/controller/binding.c b/controller/binding.c index 47d4fea..242163d 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -160,13 +160,24 @@ add_local_datapath__(struct ovsdb_idl_index *sbrec_datapath_binding_by_key, peer->datapath, false, depth + 1, local_datapaths); ld->n_peer_ports++; - ld->peer_ports = xrealloc(ld->peer_ports, - ld->n_peer_ports * - sizeof *ld->peer_ports); - ld->peer_ports[ld->n_peer_ports - 1] = peer; + if (ld->n_peer_ports > ld->n_allocated_peer_ports) { + ld->peer_ports = + x2nrealloc(ld->peer_ports, + &ld->n_allocated_peer_ports, + sizeof *ld->peer_ports); + } + ld->peer_ports[ld->n_peer_ports - 1].local = pb; + ld->peer_ports[ld->n_peer_ports - 1].remote = peer; } } } + + ld->n_ports++; + if (ld->n_ports > ld->n_allocated_ports) { + ld->ports = x2nrealloc(ld->ports, &ld->n_allocated_ports, + sizeof *ld->ports); + } + ld->ports[ld->n_ports - 1] = pb; } sbrec_port_binding_index_destroy_row(target); } diff --git a/controller/ovn-controller.h b/controller/ovn-controller.h index 41feec3..86b300e 100644 --- a/controller/ovn-controller.h +++ b/controller/ovn-controller.h @@ -60,8 +60,17 @@ struct local_datapath { * hypervisor. */ bool has_local_l3gateway; - const struct sbrec_port_binding **peer_ports; + const struct sbrec_port_binding **ports; + size_t n_ports; + size_t n_allocated_ports; + + struct { + const struct sbrec_port_binding *local; + const struct sbrec_port_binding *remote; + } *peer_ports; + size_t n_peer_ports; + size_t n_allocated_peer_ports; }; struct local_datapath *get_local_datapath(const struct hmap *, diff --git a/controller/physical.c b/controller/physical.c index a05962b..49bc1a4 100644 --- a/controller/physical.c +++ b/controller/physical.c @@ -266,11 +266,13 @@ put_replace_router_port_mac_flows(const struct } for (int i = 0; i < ld->n_peer_ports; i++) { - const struct sbrec_port_binding *rport_binding = ld->peer_ports[i]; + const struct sbrec_port_binding *rport_binding; struct eth_addr router_port_mac; struct match match; struct ofpact_mac *replace_mac; + rport_binding = ld->peer_ports[i].remote; + /* Table 65, priority 150. * ======================= * diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 21ed75f..a8ff0bb 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -174,8 +174,7 @@ static struct pinctrl pinctrl; static void init_buffered_packets_map(void); static void destroy_buffered_packets_map(void); static void -run_buffered_binding(struct ovsdb_idl_index *sbrec_port_binding_by_datapath, - struct ovsdb_idl_index *sbrec_mac_binding_by_lport_ip, +run_buffered_binding(struct ovsdb_idl_index *sbrec_mac_binding_by_lport_ip, const struct hmap *local_datapaths) OVS_REQUIRES(pinctrl_mutex); @@ -239,10 +238,7 @@ static void wait_controller_event(struct ovsdb_idl_txn *ovnsb_idl_txn); static void init_ipv6_ras(void); static void destroy_ipv6_ras(void); static void ipv6_ra_wait(long long int send_ipv6_ra_time); -static void prepare_ipv6_ras( - struct ovsdb_idl_index *sbrec_port_binding_by_datapath, - struct ovsdb_idl_index *sbrec_port_binding_by_name, - const struct hmap *local_datapaths) +static void prepare_ipv6_ras(const struct hmap *local_datapaths) OVS_REQUIRES(pinctrl_mutex); static void send_ipv6_ras(struct rconn *swconn, long long int *send_ipv6_ra_time) @@ -2166,8 +2162,7 @@ pinctrl_run(struct ovsdb_idl_txn *ovnsb_idl_txn, send_garp_prepare(sbrec_port_binding_by_datapath, sbrec_port_binding_by_name, br_int, chassis, local_datapaths, active_tunnels); - prepare_ipv6_ras(sbrec_port_binding_by_datapath, - sbrec_port_binding_by_name, local_datapaths); + prepare_ipv6_ras(local_datapaths); sync_dns_cache(dns_table); controller_event_run(ovnsb_idl_txn, ce_table, chassis); ip_mcast_sync(ovnsb_idl_txn, chassis, local_datapaths, @@ -2175,8 +2170,7 @@ pinctrl_run(struct ovsdb_idl_txn *ovnsb_idl_txn, sbrec_port_binding_by_key, sbrec_igmp_groups, sbrec_ip_multicast_opts); - run_buffered_binding(sbrec_port_binding_by_datapath, - sbrec_mac_binding_by_lport_ip, + run_buffered_binding(sbrec_mac_binding_by_lport_ip, local_datapaths); ovs_mutex_unlock(&pinctrl_mutex); } @@ -2412,9 +2406,7 @@ send_ipv6_ras(struct rconn *swconn, long long int *send_ipv6_ra_time) /* Called by pinctrl_run(). Runs with in the main ovn-controller * thread context. */ static void -prepare_ipv6_ras(struct ovsdb_idl_index *sbrec_port_binding_by_datapath, - struct ovsdb_idl_index *sbrec_port_binding_by_name, - const struct hmap *local_datapaths) +prepare_ipv6_ras(const struct hmap *local_datapaths) OVS_REQUIRES(pinctrl_mutex) { struct shash_node *iter, *iter_next; @@ -2427,25 +2419,12 @@ prepare_ipv6_ras(struct ovsdb_idl_index *sbrec_port_binding_by_datapath, bool changed = false; const struct local_datapath *ld; HMAP_FOR_EACH (ld, hmap_node, local_datapaths) { - struct sbrec_port_binding *target = sbrec_port_binding_index_init_row( - sbrec_port_binding_by_datapath); - sbrec_port_binding_index_set_datapath(target, ld->datapath); - struct sbrec_port_binding *pb; - SBREC_PORT_BINDING_FOR_EACH_EQUAL (pb, target, - sbrec_port_binding_by_datapath) { - if (!smap_get_bool(&pb->options, "ipv6_ra_send_periodic", false)) { - continue; - } + for (size_t i = 0; i < ld->n_peer_ports; i++) { + const struct sbrec_port_binding *peer = ld->peer_ports[i].remote; + const struct sbrec_port_binding *pb = ld->peer_ports[i].local; - const char *peer_s = smap_get(&pb->options, "peer"); - if (!peer_s) { - continue; - } - - const struct sbrec_port_binding *peer - = lport_lookup_by_name(sbrec_port_binding_by_name, peer_s); - if (!peer) { + if (!smap_get_bool(&pb->options, "ipv6_ra_send_periodic", false)) { continue; } @@ -2484,7 +2463,6 @@ prepare_ipv6_ras(struct ovsdb_idl_index *sbrec_port_binding_by_datapath, /* pinctrl_handler thread will send the IPv6 RAs. */ } - sbrec_port_binding_index_destroy_row(target); } /* Remove those that are no longer in the SB database */ @@ -2729,8 +2707,7 @@ run_put_mac_bindings(struct ovsdb_idl_txn *ovnsb_idl_txn, } static void -run_buffered_binding(struct ovsdb_idl_index *sbrec_port_binding_by_datapath, - struct ovsdb_idl_index *sbrec_mac_binding_by_lport_ip, +run_buffered_binding(struct ovsdb_idl_index *sbrec_mac_binding_by_lport_ip, const struct hmap *local_datapaths) OVS_REQUIRES(pinctrl_mutex) { @@ -2738,13 +2715,10 @@ run_buffered_binding(struct ovsdb_idl_index *sbrec_port_binding_by_datapath, bool notify = false; HMAP_FOR_EACH (ld, hmap_node, local_datapaths) { - struct sbrec_port_binding *target = sbrec_port_binding_index_init_row( - sbrec_port_binding_by_datapath); - sbrec_port_binding_index_set_datapath(target, ld->datapath); - const struct sbrec_port_binding *pb; - SBREC_PORT_BINDING_FOR_EACH_EQUAL (pb, target, - sbrec_port_binding_by_datapath) { + for (size_t i = 0; i < ld->n_ports; i++) { + + const struct sbrec_port_binding *pb = ld->ports[i]; struct buffered_packets *cur_qp, *next_qp; HMAP_FOR_EACH_SAFE (cur_qp, next_qp, hmap_node, &buffered_packets_map) { @@ -2762,7 +2736,6 @@ run_buffered_binding(struct ovsdb_idl_index *sbrec_port_binding_by_datapath, ds_destroy(&ip_s); } } - sbrec_port_binding_index_destroy_row(target); } buffered_packets_map_gc();