> On Sep 13, 2015, at 11:35 AM, ALeX Wang <ee07b...@gmail.com> wrote: > >> On 12 September 2015 at 16:43, Justin Pettit <jpet...@nicira.com> wrote: >> >> > On Aug 27, 2015, at 11:21 PM, Alex Wang <ee07b...@gmail.com> wrote: >> > >> >> > +/* Since we do not own any vtep logical switch, just sets their tunnel key >> > + * to 0. */ >> > +static bool >> > +vtep_lswitch_cleanup(struct ovsdb_idl *vtep_idl) >> > +{ >> > + const struct vteprec_logical_switch *vtep_ls; >> > + int64_t tnl_key = 0; >> > + bool done = true; >> > + >> > + VTEPREC_LOGICAL_SWITCH_FOR_EACH (vtep_ls, vtep_idl) { >> > + if (vtep_ls->n_tunnel_key != 1 >> > + || vtep_ls->tunnel_key[0] != tnl_key) { >> > + vteprec_logical_switch_set_tunnel_key(vtep_ls, &tnl_key, 1); >> >> It looks like the tunnel key is optional. This code will set a tunnel key >> even if one wasn't previously set. Is this intentional? I was just >> surprised to see this in a cleanup function. > > I'm also unclear about if this is necessary. The reason I wanted to reset > it, is > because the controller sets it. And since there is not a good way to mark > which > tunnel key is set by controller, I just reset them all. > > Maybe we can just remove this function?
I like that it cleans up. Since 0 is a valid value, I wonder if the better behavior is to actually remove the tunnel key value entirely. --Justin _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev