Skip to content

Commit

Permalink
vtep-ctl: Add Tunnel table to vtep_ctl_table_class.
Browse files Browse the repository at this point in the history
This is needed to create, get, set records in the Tunnel table.

(We need to add the Tunnel table's 'local' and 'remote' columns
that point to the Physical_Locator record to cache because vtep-ctl
commands like 'add-ucast-local' will try to add an entry in
Physical_Locator table based on the contents of the cache.)

Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Ariel Tubaltsev <[email protected]>
Acked-by: Justin Pettit <[email protected]>
  • Loading branch information
shettyg committed Sep 25, 2014
1 parent 721d60e commit 2c06d26
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions vtep/vtep-ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ pre_get_info(struct vtep_ctl_context *ctx)

ovsdb_idl_add_column(ctx->idl, &vteprec_physical_switch_col_name);
ovsdb_idl_add_column(ctx->idl, &vteprec_physical_switch_col_ports);
ovsdb_idl_add_column(ctx->idl, &vteprec_physical_switch_col_tunnels);

ovsdb_idl_add_column(ctx->idl, &vteprec_physical_port_col_name);
ovsdb_idl_add_column(ctx->idl, &vteprec_physical_port_col_vlan_bindings);
Expand Down Expand Up @@ -1111,6 +1112,9 @@ pre_get_info(struct vtep_ctl_context *ctx)
&vteprec_physical_locator_col_dst_ip);
ovsdb_idl_add_column(ctx->idl,
&vteprec_physical_locator_col_encapsulation_type);

ovsdb_idl_add_column(ctx->idl, &vteprec_tunnel_col_local);
ovsdb_idl_add_column(ctx->idl, &vteprec_tunnel_col_remote);
}

static void
Expand All @@ -1122,6 +1126,7 @@ vtep_ctl_context_populate_cache(struct vtep_ctl_context *ctx)
const struct vteprec_ucast_macs_remote *ucast_remote_cfg;
const struct vteprec_mcast_macs_local *mcast_local_cfg;
const struct vteprec_mcast_macs_remote *mcast_remote_cfg;
const struct vteprec_tunnel *tunnel_cfg;
struct sset pswitches, ports, lswitches;
size_t i;

Expand Down Expand Up @@ -1247,6 +1252,15 @@ vtep_ctl_context_populate_cache(struct vtep_ctl_context *ctx)
mcast_mac->remote_cfg = mcast_remote_cfg;
}

VTEPREC_TUNNEL_FOR_EACH (tunnel_cfg, ctx->idl) {
if (tunnel_cfg->local) {
add_ploc_to_cache(ctx, tunnel_cfg->local);
}
if (tunnel_cfg->remote) {
add_ploc_to_cache(ctx, tunnel_cfg->remote);
}
}

sset_init(&pswitches);
for (i = 0; i < vtep_global->n_switches; i++) {
struct vteprec_physical_switch *ps_cfg = vtep_global->switches[i];
Expand Down Expand Up @@ -2283,6 +2297,10 @@ static const struct vtep_ctl_table_class tables[] = {
{{&vteprec_table_physical_switch, &vteprec_physical_switch_col_name, NULL},
{NULL, NULL, NULL}}},

{&vteprec_table_tunnel,
{{NULL, NULL, NULL},
{NULL, NULL, NULL}}},

{NULL, {{NULL, NULL, NULL}, {NULL, NULL, NULL}}}
};

Expand Down

0 comments on commit 2c06d26

Please sign in to comment.