ovn/controller/lflow.c
static void
ldp_run(struct controller_ctx *ctx)
{
    struct logical_datapath *ldp;
    HMAP_FOR_EACH (ldp, hmap_node, &logical_datapaths) {
        simap_clear(&ldp->ports);
    }

    const struct sbrec_port_binding *binding;
    SBREC_PORT_BINDING_FOR_EACH (binding, ctx->ovnsb_idl) {
        struct logical_datapath *ldp = ldp_lookup_or_create(binding->datapath);

        simap_put(&ldp->ports, binding->logical_port, binding->tunnel_key);
    }

    const struct sbrec_multicast_group *mc;
    SBREC_MULTICAST_GROUP_FOR_EACH (mc, ctx->ovnsb_idl) {
        struct logical_datapath *ldp = ldp_lookup_or_create(mc->datapath);
        simap_put(&ldp->ports, mc->name, mc->tunnel_key);
    }

    struct logical_datapath *next_ldp;
    HMAP_FOR_EACH_SAFE (ldp, next_ldp, hmap_node, &logical_datapaths) {
        if (simap_is_empty(&ldp->ports)) {
            ldp_free(ldp);
        }
    }
}
/* Iterates through all of the records in the Port_Binding table, updating the
 * table of logical_datapaths to match the values found in active
 * Port_Bindings. */
Iterates through all of the records in the Port_Binding table, updating the
table of logical_datapaths to match the values found in active
Port_Bindings.
Iterates through all of the records in the Port_Binding table updating the table of logical_datapaths to match the values found in active Port_Bindings .
static void
ldp_run(struct controller_ctx *ctx)
{
    struct logical_datapath *ldp;
    HMAP_FOR_EACH (ldp, hmap_node, &logical_datapaths) {
        simap_clear(&ldp->ports);
    }
    const struct sbrec_port_binding *binding;
    SBREC_PORT_BINDING_FOR_EACH (binding, ctx->ovnsb_idl) {
        struct logical_datapath *ldp = ldp_lookup_or_create(binding->datapath);
        simap_put(&ldp->ports, binding->logical_port, binding->tunnel_key);
    }
    const struct sbrec_multicast_group *mc;
    SBREC_MULTICAST_GROUP_FOR_EACH (mc, ctx->ovnsb_idl) {
        struct logical_datapath *ldp = ldp_lookup_or_create(mc->datapath);
        simap_put(&ldp->ports, mc->name, mc->tunnel_key);
    }
    struct logical_datapath *next_ldp;
    HMAP_FOR_EACH_SAFE (ldp, next_ldp, hmap_node, &logical_datapaths) {
        if (simap_is_empty(&ldp->ports)) {
            ldp_free(ldp);
        }
    }
}
static void ldp_run ( struct controller_ctx * ctx ) { struct logical_datapath * ldp ; HMAP_FOR_EACH ( ldp , hmap_node , & logical_datapaths ) { simap_clear ( & ldp -> ports ) ; } const struct sbrec_port_binding * binding ; SBREC_PORT_BINDING_FOR_EACH ( binding , ctx -> ovnsb_idl ) { struct logical_datapath * ldp = ldp_lookup_or_create ( binding -> datapath ) ; simap_put ( & ldp -> ports , binding -> logical_port , binding -> tunnel_key ) ; } const struct sbrec_multicast_group * mc ; SBREC_MULTICAST_GROUP_FOR_EACH ( mc , ctx -> ovnsb_idl ) { struct logical_datapath * ldp = ldp_lookup_or_create ( mc -> datapath ) ; simap_put ( & ldp -> ports , mc -> name , mc -> tunnel_key ) ; } struct logical_datapath * next_ldp ; HMAP_FOR_EACH_SAFE ( ldp , next_ldp , hmap_node , & logical_datapaths ) { if ( simap_is_empty ( & ldp -> ports ) ) { ldp_free ( ldp ) ; } } }
Iterates through all of the records in the Port_Binding table, updating the
 table of logical_datapaths to match the values found in active
 Port_Bindings.
Iterates through all of the records in the Port_Binding table updating the table of logical_datapaths to match the values found in active Port_Bindings .