Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806359/?format=api
{ "id": 806359, "url": "http://patchwork.ozlabs.org/api/patches/806359/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/1503893682-65314-2-git-send-email-zhouhan@gmail.com/", "project": { "id": 47, "url": "http://patchwork.ozlabs.org/api/projects/47/?format=api", "name": "Open vSwitch", "link_name": "openvswitch", "list_id": "ovs-dev.openvswitch.org", "list_email": "ovs-dev@openvswitch.org", "web_url": "http://openvswitch.org/", "scm_url": "git@github.com:openvswitch/ovs.git", "webscm_url": "https://github.com/openvswitch/ovs", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1503893682-65314-2-git-send-email-zhouhan@gmail.com>", "list_archive_url": null, "date": "2017-08-28T04:14:41", "name": "[ovs-dev,v4,2/3] ovn-controller: Move ovnsb cursors to idl context.", "commit_ref": null, "pull_url": null, "state": "deferred", "archived": false, "hash": "0b25031a6155b57109d5bed63c714489e4181ddc", "submitter": { "id": 67381, "url": "http://patchwork.ozlabs.org/api/people/67381/?format=api", "name": "Han Zhou", "email": "zhouhan@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/1503893682-65314-2-git-send-email-zhouhan@gmail.com/mbox/", "series": [ { "id": 66, "url": "http://patchwork.ozlabs.org/api/series/66/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=66", "date": "2017-08-28T04:14:40", "name": "[ovs-dev,v4,1/3] ovn-controller: readonly mode binding_run and get_br_int", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/66/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/806359/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806359/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<ovs-dev-bounces@openvswitch.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "dev@openvswitch.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "ovs-dev@mail.linuxfoundation.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=openvswitch.org\n\t(client-ip=140.211.169.12; helo=mail.linuxfoundation.org;\n\tenvelope-from=ovs-dev-bounces@openvswitch.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Va3GM2jL\"; dkim-atps=neutral" ], "Received": [ "from mail.linuxfoundation.org (mail.linuxfoundation.org\n\t[140.211.169.12])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xgdk32vkHz9sN7\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 14:16:10 +1000 (AEST)", "from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id BC4878A5;\n\tMon, 28 Aug 2017 04:15:04 +0000 (UTC)", "from smtp1.linuxfoundation.org (smtp1.linux-foundation.org\n\t[172.17.192.35])\n\tby mail.linuxfoundation.org (Postfix) with ESMTPS id 7E45A890\n\tfor <dev@openvswitch.org>; Mon, 28 Aug 2017 04:15:03 +0000 (UTC)", "from mail-pg0-f67.google.com (mail-pg0-f67.google.com\n\t[74.125.83.67])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTPS id 86583A1\n\tfor <dev@openvswitch.org>; Mon, 28 Aug 2017 04:15:02 +0000 (UTC)", "by mail-pg0-f67.google.com with SMTP id 63so5441243pgc.1\n\tfor <dev@openvswitch.org>; Sun, 27 Aug 2017 21:15:02 -0700 (PDT)", "from localhost.localdomain.localdomain\n\t(c-73-162-150-77.hsd1.ca.comcast.net. [73.162.150.77])\n\tby smtp.gmail.com with ESMTPSA id\n\tm13sm22022684pfg.27.2017.08.27.21.15.00\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 27 Aug 2017 21:15:01 -0700 (PDT)" ], "X-Greylist": "whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=JZgK17AZDvHOHS8AWkDl3FY+cUo00dn8x1HN2+yvULw=;\n\tb=Va3GM2jLnHgj8PXA7C0k/3Spd9hTXGHcyg8ZxPpTamHlC0qW/IJRryIUymrNvhvEjf\n\ts7Pkk9bRtV0WCaNt1oloiK1iUHar2DAMwUXD4rzWgjT3qQO1du9M32xsMlWSUePplJMJ\n\tTQt5HrMvqS2TE+xzE4JoWycLMOotbIMjVTQt/pQXFMg9vCWBihht6ELX5Paa4Xqbmhlm\n\t3DKOPXNxE1+nQ5g76K6zFras6RiXko4URTwbHjZ0lkuHWVvrO+yHtZvOdVDHB4YTaWCg\n\t21p9ofRX3akyEIIP20p7OXao0kBdu/0XAD9FV8V5LsuXEVSuOMi0MoZJNp4lqMG3/IbK\n\t5AWA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=JZgK17AZDvHOHS8AWkDl3FY+cUo00dn8x1HN2+yvULw=;\n\tb=O1QLe6GfB3WgxQtyNxwFz+/uDXE/so3zOMxYjzghZaYzEmlXR6HyE67+cBMK1mymS8\n\tx5twMifaJUTqwh4UbI5BTHCllhvMxuQPEC62/kYL4De2wOnVxJHrysEpYb0EHrRcd3HC\n\trUBX44AKeB5iR+B8rTSW9P1CZS+KTeLDKgsrUUyWB35BdxKZ3ztzrtE98vzKMcAfyT+U\n\tVjs2sUZBb/tv2id+lxyKmV58vU/88uydS1cgm8mPLP0+V3SNcQwk5wtMzGX1Hj8cJnRM\n\ttlsszw9WTfp3yUo7yCkKuf6m6sHtlJKWlIHDsJR3Oli/pjSQb8skUlOyJloyYxtUDf5W\n\tIcFQ==", "X-Gm-Message-State": "AHYfb5gRMg3+fWOavK5njaOfvSS9fFnzPb+6BaXILpGGgRDZJjTCdATm\n\tj3zjLQV2i6yBJOyf", "X-Received": "by 10.98.158.92 with SMTP id s89mr3788548pfd.314.1503893701582; \n\tSun, 27 Aug 2017 21:15:01 -0700 (PDT)", "From": "Han Zhou <zhouhan@gmail.com>", "To": "dev@openvswitch.org", "Date": "Sun, 27 Aug 2017 21:14:41 -0700", "Message-Id": "<1503893682-65314-2-git-send-email-zhouhan@gmail.com>", "X-Mailer": "git-send-email 2.1.0", "In-Reply-To": "<1503893682-65314-1-git-send-email-zhouhan@gmail.com>", "References": "<1503893682-65314-1-git-send-email-zhouhan@gmail.com>", "X-Spam-Status": "No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=disabled\n\tversion=3.3.1", "X-Spam-Checker-Version": "SpamAssassin 3.3.1 (2010-03-16) on\n\tsmtp1.linux-foundation.org", "Subject": "[ovs-dev] [PATCH v4 2/3] ovn-controller: Move ovnsb cursors to idl\n\tcontext.", "X-BeenThere": "ovs-dev@openvswitch.org", "X-Mailman-Version": "2.1.12", "Precedence": "list", "List-Id": "<ovs-dev.openvswitch.org>", "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>", "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>", "List-Post": "<mailto:ovs-dev@openvswitch.org>", "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>", "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "ovs-dev-bounces@openvswitch.org", "Errors-To": "ovs-dev-bounces@openvswitch.org" }, "content": "Cursors need to be bound with idl so that different idl for same\nDB can work properly without stepping onto each other. This will\nbe needed for a future patch that requires separate ovnsb idl for\ndifferent thread.\n\nSigned-off-by: Han Zhou <zhouhan@gmail.com>\n---\nv3->v4: this change was not in v3. It is needed because of the recent\n change that replaced lport and ldatapath index by ovsdb index.\n\n ovn/controller/binding.c | 4 +--\n ovn/controller/lflow.c | 16 ++++++------\n ovn/controller/lport.c | 55 +++++++++++++++++++++--------------------\n ovn/controller/lport.h | 22 ++++++++++++-----\n ovn/controller/ovn-controller.c | 4 ++-\n ovn/controller/ovn-controller.h | 1 +\n ovn/controller/physical.c | 6 ++---\n ovn/controller/pinctrl.c | 12 ++++-----\n 8 files changed, 67 insertions(+), 53 deletions(-)", "diff": "diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c\nindex bb1728f..396a504 100644\n--- a/ovn/controller/binding.c\n+++ b/ovn/controller/binding.c\n@@ -153,7 +153,7 @@ add_local_datapath__(struct controller_ctx *ctx,\n if (peer_name) {\n const struct sbrec_port_binding *peer;\n \n- peer = lport_lookup_by_name( ctx->ovnsb_idl, peer_name);\n+ peer = lport_lookup_by_name( ctx->ovnsb_cursors, peer_name);\n \n if (peer && peer->datapath) {\n add_local_datapath__(ctx, peer->datapath,\n@@ -163,7 +163,7 @@ add_local_datapath__(struct controller_ctx *ctx,\n ld->peer_dps,\n ld->n_peer_dps * sizeof *ld->peer_dps);\n ld->peer_dps[ld->n_peer_dps - 1] = datapath_lookup_by_key(\n- ctx->ovnsb_idl, peer->datapath->tunnel_key);\n+ ctx->ovnsb_cursors, peer->datapath->tunnel_key);\n }\n }\n }\ndiff --git a/ovn/controller/lflow.c b/ovn/controller/lflow.c\nindex 6d9f02c..0359667 100644\n--- a/ovn/controller/lflow.c\n+++ b/ovn/controller/lflow.c\n@@ -46,12 +46,12 @@ lflow_init(void)\n }\n \f\n struct lookup_port_aux {\n- struct ovsdb_idl *ovnsb_idl;\n+ struct ovnsb_cursors *ovnsb_cursors;\n const struct sbrec_datapath_binding *dp;\n };\n \n struct condition_aux {\n- struct ovsdb_idl *ovnsb_idl;\n+ struct ovnsb_cursors *ovnsb_cursors;\n const struct sbrec_chassis *chassis;\n const struct sset *active_tunnels;\n const struct chassis_index *chassis_index;\n@@ -76,14 +76,14 @@ lookup_port_cb(const void *aux_, const char *port_name, unsigned int *portp)\n const struct lookup_port_aux *aux = aux_;\n \n const struct sbrec_port_binding *pb\n- = lport_lookup_by_name(aux->ovnsb_idl, port_name);\n+ = lport_lookup_by_name(aux->ovnsb_cursors, port_name);\n if (pb && pb->datapath == aux->dp) {\n *portp = pb->tunnel_key;\n return true;\n }\n \n const struct sbrec_multicast_group *mg\n- = mcgroup_lookup_by_dp_name(aux->ovnsb_idl, aux->dp, port_name);\n+ = mcgroup_lookup_by_dp_name(aux->ovnsb_cursors, aux->dp, port_name);\n if (mg) {\n *portp = mg->tunnel_key;\n return true;\n@@ -98,7 +98,7 @@ is_chassis_resident_cb(const void *c_aux_, const char *port_name)\n const struct condition_aux *c_aux = c_aux_;\n \n const struct sbrec_port_binding *pb\n- = lport_lookup_by_name(c_aux->ovnsb_idl, port_name);\n+ = lport_lookup_by_name(c_aux->ovnsb_cursors, port_name);\n if (!pb) {\n return false;\n }\n@@ -243,7 +243,7 @@ consider_logical_flow(struct controller_ctx *ctx,\n uint64_t ofpacts_stub[1024 / 8];\n struct ofpbuf ofpacts = OFPBUF_STUB_INITIALIZER(ofpacts_stub);\n struct lookup_port_aux aux = {\n- .ovnsb_idl = ctx->ovnsb_idl,\n+ .ovnsb_cursors = ctx->ovnsb_cursors,\n .dp = lflow->logical_datapath\n };\n struct ovnact_encode_params ep = {\n@@ -285,7 +285,7 @@ consider_logical_flow(struct controller_ctx *ctx,\n return;\n }\n \n- struct condition_aux cond_aux = { ctx->ovnsb_idl, chassis, active_tunnels,\n+ struct condition_aux cond_aux = { ctx->ovnsb_cursors, chassis, active_tunnels,\n chassis_index};\n expr = expr_simplify(expr, is_chassis_resident_cb, &cond_aux);\n expr = expr_normalize(expr);\n@@ -348,7 +348,7 @@ consider_neighbor_flow(struct controller_ctx *ctx,\n struct hmap *flow_table)\n {\n const struct sbrec_port_binding *pb\n- = lport_lookup_by_name(ctx->ovnsb_idl, b->logical_port);\n+ = lport_lookup_by_name(ctx->ovnsb_cursors, b->logical_port);\n if (!pb) {\n return;\n }\ndiff --git a/ovn/controller/lport.c b/ovn/controller/lport.c\nindex e5305d0..6be6b31 100644\n--- a/ovn/controller/lport.c\n+++ b/ovn/controller/lport.c\n@@ -22,29 +22,25 @@\n #include \"ovn/lib/ovn-sb-idl.h\"\n VLOG_DEFINE_THIS_MODULE(lport);\n \n-static struct ovsdb_idl_index_cursor lport_by_name_cursor;\n-static struct ovsdb_idl_index_cursor lport_by_key_cursor;\n-static struct ovsdb_idl_index_cursor dpath_by_key_cursor;\n-static struct ovsdb_idl_index_cursor mc_grp_by_dp_name_cursor;\n-\n \f\n \n /* Finds and returns the port binding record with the given 'name',\n * or NULL if no such port binding exists. */\n const struct sbrec_port_binding *\n-lport_lookup_by_name(struct ovsdb_idl *idl, const char *name)\n+lport_lookup_by_name(struct ovnsb_cursors *cursors, const char *name)\n {\n struct sbrec_port_binding *value;\n const struct sbrec_port_binding *pb, *retval = NULL;\n \n /* Build key for an indexed lookup. */\n- value = sbrec_port_binding_index_init_row(idl, &sbrec_table_port_binding);\n+ value = sbrec_port_binding_index_init_row(cursors->idl, &sbrec_table_port_binding);\n sbrec_port_binding_index_set_logical_port(value, name);\n \n /* Find an entry with matching logical port name. Since this column is\n * declared to be an index in the OVN_Southbound schema, the first match\n * (if any) will be the only match. */\n- SBREC_PORT_BINDING_FOR_EACH_EQUAL (pb, &lport_by_name_cursor, value) {\n+ SBREC_PORT_BINDING_FOR_EACH_EQUAL (pb, &cursors->lport_by_name_cursor,\n+ value) {\n retval = pb;\n break;\n }\n@@ -57,20 +53,21 @@ lport_lookup_by_name(struct ovsdb_idl *idl, const char *name)\n /* Finds and returns the datapath binding record with tunnel_key equal to the\n * given 'dp_key', or NULL if no such datapath binding exists. */\n const struct sbrec_datapath_binding *\n-datapath_lookup_by_key(struct ovsdb_idl *idl, uint64_t dp_key)\n+datapath_lookup_by_key(struct ovnsb_cursors *cursors, uint64_t dp_key)\n {\n struct sbrec_datapath_binding *dbval;\n const struct sbrec_datapath_binding *db, *retval = NULL;\n \n /* Build key for an indexed lookup. */\n- dbval = sbrec_datapath_binding_index_init_row(idl,\n- &sbrec_table_datapath_binding);\n+ dbval = sbrec_datapath_binding_index_init_row(\n+ cursors->idl, &sbrec_table_datapath_binding);\n sbrec_datapath_binding_index_set_tunnel_key(dbval, dp_key);\n \n /* Find an entry with matching tunnel_key. Since this column is declared\n * to be an index in the OVN_Southbound schema, the first match (if any)\n * will be the only match. */\n- SBREC_DATAPATH_BINDING_FOR_EACH_EQUAL (db, &dpath_by_key_cursor, dbval) {\n+ SBREC_DATAPATH_BINDING_FOR_EACH_EQUAL (db, &cursors->dpath_by_key_cursor,\n+ dbval) {\n retval = db;\n break;\n }\n@@ -83,27 +80,30 @@ datapath_lookup_by_key(struct ovsdb_idl *idl, uint64_t dp_key)\n * given 'port_key' and datapath binding matching 'dp_key', or NULL if no\n * such port binding exists. */\n const struct sbrec_port_binding *\n-lport_lookup_by_key(struct ovsdb_idl *idl, uint64_t dp_key, uint64_t port_key)\n+lport_lookup_by_key(struct ovnsb_cursors *cursors, uint64_t dp_key,\n+ uint64_t port_key)\n {\n struct sbrec_port_binding *pbval;\n const struct sbrec_port_binding *pb, *retval = NULL;\n const struct sbrec_datapath_binding *db;\n \n /* Lookup datapath corresponding to dp_key. */\n- db = datapath_lookup_by_key(idl, dp_key);\n+ db = datapath_lookup_by_key(cursors, dp_key);\n if (!db) {\n return NULL;\n }\n \n /* Build key for an indexed lookup. */\n- pbval = sbrec_port_binding_index_init_row(idl, &sbrec_table_port_binding);\n+ pbval = sbrec_port_binding_index_init_row(cursors->idl,\n+ &sbrec_table_port_binding);\n sbrec_port_binding_index_set_datapath(pbval, db);\n sbrec_port_binding_index_set_tunnel_key(pbval, port_key);\n \n /* Find an entry with matching tunnel_key and datapath UUID. Since this\n * column pair is declared to be an index in the OVN_Southbound schema,\n * the first match (if any) will be the only match. */\n- SBREC_PORT_BINDING_FOR_EACH_EQUAL (pb, &lport_by_key_cursor, pbval) {\n+ SBREC_PORT_BINDING_FOR_EACH_EQUAL (pb, &cursors->lport_by_key_cursor,\n+ pbval) {\n retval = pb;\n break;\n }\n@@ -115,15 +115,15 @@ lport_lookup_by_key(struct ovsdb_idl *idl, uint64_t dp_key, uint64_t port_key)\n /* Finds and returns the logical multicast group with the given 'name' and\n * datapath binding, or NULL if no such logical multicast group exists. */\n const struct sbrec_multicast_group *\n-mcgroup_lookup_by_dp_name(struct ovsdb_idl *idl,\n- const struct sbrec_datapath_binding *dp,\n- const char *name)\n+mcgroup_lookup_by_dp_name(struct ovnsb_cursors *cursors,\n+ const struct sbrec_datapath_binding *dp,\n+ const char *name)\n {\n struct sbrec_multicast_group *mcval;\n const struct sbrec_multicast_group *mc, *retval = NULL;\n \n /* Build key for an indexed lookup. */\n- mcval = sbrec_multicast_group_index_init_row(idl,\n+ mcval = sbrec_multicast_group_index_init_row(cursors->idl,\n &sbrec_table_multicast_group);\n sbrec_multicast_group_index_set_name(mcval, name);\n sbrec_multicast_group_index_set_datapath(mcval, dp);\n@@ -131,8 +131,8 @@ mcgroup_lookup_by_dp_name(struct ovsdb_idl *idl,\n /* Find an entry with matching logical multicast group name and datapath.\n * Since this column pair is declared to be an index in the OVN_Southbound\n * schema, the first match (if any) will be the only match. */\n- SBREC_MULTICAST_GROUP_FOR_EACH_EQUAL (mc, &mc_grp_by_dp_name_cursor,\n- mcval) {\n+ SBREC_MULTICAST_GROUP_FOR_EACH_EQUAL (mc,\n+ &cursors->mc_grp_by_dp_name_cursor, mcval) {\n retval = mc;\n break;\n }\n@@ -143,25 +143,26 @@ mcgroup_lookup_by_dp_name(struct ovsdb_idl *idl,\n }\n \n void\n-lport_init(struct ovsdb_idl *idl)\n+lport_init(struct ovnsb_cursors *cursors, struct ovsdb_idl *idl)\n {\n+ cursors->idl = idl;\n /* Create a cursor for searching multicast group table by datapath\n * and group name. */\n ovsdb_idl_initialize_cursor(idl, &sbrec_table_multicast_group,\n \"multicast-group-by-dp-name\",\n- &mc_grp_by_dp_name_cursor);\n+ &cursors->mc_grp_by_dp_name_cursor);\n \n /* Create cursor to search port binding table by logical port name. */\n ovsdb_idl_initialize_cursor(idl, &sbrec_table_port_binding,\n \"lport-by-name\",\n- &lport_by_name_cursor);\n+ &cursors->lport_by_name_cursor);\n \n /* Create cursor to search port binding table by logical port tunnel key\n * and datapath uuid. */\n ovsdb_idl_initialize_cursor(idl, &sbrec_table_port_binding, \"lport-by-key\",\n- &lport_by_key_cursor);\n+ &cursors->lport_by_key_cursor);\n \n /* Create cursor to search datapath binding table by tunnel key. */\n ovsdb_idl_initialize_cursor(idl, &sbrec_table_datapath_binding,\n- \"dpath-by-key\", &dpath_by_key_cursor);\n+ \"dpath-by-key\", &cursors->dpath_by_key_cursor);\n }\ndiff --git a/ovn/controller/lport.h b/ovn/controller/lport.h\nindex 38c7344..4421c02 100644\n--- a/ovn/controller/lport.h\n+++ b/ovn/controller/lport.h\n@@ -20,6 +20,7 @@\n #include \"lib/uuid.h\"\n #include \"openvswitch/hmap.h\"\n #include \"openvswitch/list.h\"\n+#include \"ovn/lib/ovn-sb-idl.h\"\n \n struct ovsdb_idl;\n struct sbrec_chassis;\n@@ -34,22 +35,31 @@ struct sbrec_port_binding;\n * look up data based on values of its fields. It's not that smart (yet), so\n * instead we define our own indexes.\n */\n+\n+struct ovnsb_cursors {\n+ struct ovsdb_idl *idl;\n+ struct ovsdb_idl_index_cursor lport_by_name_cursor;\n+ struct ovsdb_idl_index_cursor lport_by_key_cursor;\n+ struct ovsdb_idl_index_cursor dpath_by_key_cursor;\n+ struct ovsdb_idl_index_cursor mc_grp_by_dp_name_cursor;\n+};\n+\n \f\n \n-const struct sbrec_datapath_binding *datapath_lookup_by_key(struct ovsdb_idl *,\n- uint64_t dp_key);\n+const struct sbrec_datapath_binding *datapath_lookup_by_key(\n+ struct ovnsb_cursors *, uint64_t dp_key);\n \n const struct sbrec_port_binding *lport_lookup_by_name(\n- struct ovsdb_idl *, const char *name);\n+ struct ovnsb_cursors *, const char *name);\n const struct sbrec_port_binding *lport_lookup_by_key(\n- struct ovsdb_idl *, uint64_t dp_key, uint64_t port_key);\n+ struct ovnsb_cursors *, uint64_t dp_key, uint64_t port_key);\n \f\n \n const struct sbrec_multicast_group *mcgroup_lookup_by_dp_name(\n- struct ovsdb_idl *idl,\n+ struct ovnsb_cursors *,\n const struct sbrec_datapath_binding *,\n const char *name);\n \n-void lport_init(struct ovsdb_idl *idl);\n+void lport_init(struct ovnsb_cursors *cursors, struct ovsdb_idl *idl);\n \n #endif /* ovn/lport.h */\ndiff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c\nindex 2dacba1..414443f 100644\n--- a/ovn/controller/ovn-controller.c\n+++ b/ovn/controller/ovn-controller.c\n@@ -620,7 +620,8 @@ main(int argc, char *argv[])\n ovsdb_idl_create(ovnsb_remote, &sbrec_idl_class, true, true));\n \n create_ovnsb_indexes(ovnsb_idl_loop.idl);\n- lport_init(ovnsb_idl_loop.idl);\n+ struct ovnsb_cursors ovnsb_cursors;\n+ lport_init(ovnsb_cursors, ovnsb_idl_loop.idl);\n \n ovsdb_idl_omit_alert(ovnsb_idl_loop.idl, &sbrec_chassis_col_nb_cfg);\n update_sb_monitors(ovnsb_idl_loop.idl, NULL, NULL, NULL);\n@@ -658,6 +659,7 @@ main(int argc, char *argv[])\n .ovs_idl_txn = ovsdb_idl_loop_run(&ovs_idl_loop),\n .ovnsb_idl = ovnsb_idl_loop.idl,\n .ovnsb_idl_txn = ovsdb_idl_loop_run(&ovnsb_idl_loop),\n+ .ovnsb_cursors = &ovnsb_cursors,\n };\n \n update_probe_interval(&ctx, ovnsb_remote);\ndiff --git a/ovn/controller/ovn-controller.h b/ovn/controller/ovn-controller.h\nindex 6617b0c..f57c557 100644\n--- a/ovn/controller/ovn-controller.h\n+++ b/ovn/controller/ovn-controller.h\n@@ -29,6 +29,7 @@ struct controller_ctx {\n \n struct ovsdb_idl *ovs_idl;\n struct ovsdb_idl_txn *ovs_idl_txn;\n+ struct ovnsb_cursors *ovnsb_cursors;\n };\n \n /* States to move through when a new conntrack zone has been allocated. */\ndiff --git a/ovn/controller/physical.c b/ovn/controller/physical.c\nindex df71979..3d06623 100644\n--- a/ovn/controller/physical.c\n+++ b/ovn/controller/physical.c\n@@ -318,7 +318,7 @@ consider_port_binding(struct controller_ctx *ctx,\n }\n \n const struct sbrec_port_binding *peer = lport_lookup_by_name(\n- ctx->ovnsb_idl, peer_name);\n+ ctx->ovnsb_cursors, peer_name);\n if (!peer || strcmp(peer->type, binding->type)) {\n return;\n }\n@@ -385,7 +385,7 @@ consider_port_binding(struct controller_ctx *ctx,\n const char *distributed_port = smap_get_def(&binding->options,\n \"distributed-port\", \"\");\n const struct sbrec_port_binding *distributed_binding\n- = lport_lookup_by_name(ctx->ovnsb_idl, distributed_port);\n+ = lport_lookup_by_name(ctx->ovnsb_cursors, distributed_port);\n \n if (!distributed_binding) {\n /* Packet will be dropped. */\n@@ -1109,7 +1109,7 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve,\n * rule with higher priority for every localport in this\n * datapath. */\n const struct sbrec_port_binding *pb = lport_lookup_by_name(\n- ctx->ovnsb_idl, localport);\n+ ctx->ovnsb_cursors, localport);\n if (pb && !strcmp(pb->type, \"localport\")) {\n match_set_reg(&match, MFF_LOG_INPORT - MFF_REG0, pb->tunnel_key);\n match_set_metadata(&match, htonll(pb->datapath->tunnel_key));\ndiff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c\nindex 469a355..9412b48 100644\n--- a/ovn/controller/pinctrl.c\n+++ b/ovn/controller/pinctrl.c\n@@ -1182,7 +1182,7 @@ run_put_mac_binding(struct controller_ctx *ctx,\n \n /* Convert logical datapath and logical port key into lport. */\n const struct sbrec_port_binding *pb\n- = lport_lookup_by_key(ctx->ovnsb_idl, pmb->dp_key, pmb->port_key);\n+ = lport_lookup_by_key(ctx->ovnsb_cursors, pmb->dp_key, pmb->port_key);\n if (!pb) {\n static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);\n \n@@ -1462,7 +1462,7 @@ get_localnet_vifs_l3gwports(struct controller_ctx *ctx,\n continue;\n }\n const struct sbrec_port_binding *pb\n- = lport_lookup_by_name(ctx->ovnsb_idl, iface_id);\n+ = lport_lookup_by_name(ctx->ovnsb_cursors, iface_id);\n if (!pb) {\n continue;\n }\n@@ -1514,7 +1514,7 @@ pinctrl_is_chassis_resident(struct controller_ctx *ctx,\n const char *port_name)\n {\n const struct sbrec_port_binding *pb\n- = lport_lookup_by_name(ctx->ovnsb_idl, port_name);\n+ = lport_lookup_by_name(ctx->ovnsb_cursors, port_name);\n if (!pb || !pb->chassis) {\n return false;\n }\n@@ -1643,7 +1643,7 @@ get_nat_addresses_and_keys(struct controller_ctx *ctx,\n SSET_FOR_EACH(gw_port, local_l3gw_ports) {\n const struct sbrec_port_binding *pb;\n \n- pb = lport_lookup_by_name(ctx->ovnsb_idl, gw_port);\n+ pb = lport_lookup_by_name(ctx->ovnsb_cursors, gw_port);\n if (!pb) {\n continue;\n }\n@@ -1712,7 +1712,7 @@ send_garp_run(struct controller_ctx *ctx,\n SSET_FOR_EACH (iface_id, &localnet_vifs) {\n const struct sbrec_port_binding *pb;\n \n- pb = lport_lookup_by_name(ctx->ovnsb_idl, iface_id);\n+ pb = lport_lookup_by_name(ctx->ovnsb_cursors, iface_id);\n if (pb) {\n send_garp_update(pb, &localnet_ofports, local_datapaths,\n &nat_addresses);\n@@ -1724,7 +1724,7 @@ send_garp_run(struct controller_ctx *ctx,\n SSET_FOR_EACH (gw_port, &local_l3gw_ports) {\n const struct sbrec_port_binding *pb;\n \n- pb = lport_lookup_by_name(ctx->ovnsb_idl, gw_port);\n+ pb = lport_lookup_by_name(ctx->ovnsb_cursors, gw_port);\n if (pb) {\n send_garp_update(pb, &localnet_ofports, local_datapaths,\n &nat_addresses);\n", "prefixes": [ "ovs-dev", "v4", "2/3" ] }