On Wed, Dec 16, 2015 at 11:44:20PM +0530, Numan Siddique wrote: > On 12/09/2015 06:38 AM, Ben Pfaff wrote: > > This was more or less implemented inside lflow.c until now, but some > > upcoming code that shouldn't be in that file needs to use it too. > > > > This also adds a second index on lports, so that lports can be looked up > > based on the logical datapath tunnel key and the logical port tunnel key. > > An upcoming commit will add a user for this new index. > > > > Signed-off-by: Ben Pfaff <b...@ovn.org>
... > > +static bool > > +lookup_port_cb(const void *aux_, const char *port_name, unsigned int > > *portp) > > { > > - 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); > > + const struct lookup_port_aux *aux = aux_; > > > > - simap_put(&ldp->ports, binding->logical_port, binding->tunnel_key); > > + const struct sbrec_port_binding *pb > > + = lport_lookup_by_name(aux->lports, port_name); > > + if (pb && pb->datapath == aux->dp) { > > + *portp = pb->tunnel_key; > > + return true; > > } > > > > - 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); > > + const struct sbrec_multicast_group *mg > > + = mcgroup_lookup_by_dp_name(aux->mcgroups, aux->dp, port_name); > > + if (mg) { > > + *portp = mg->tunnel_key; > > + return true; > > } > > > > - 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); > > - } > > - } > > -} > > + VLOG_WARN("unknown lport name %s", port_name); > > > I am seeing a lot of this warning log print because 'inport = \"\"' for the > logical flows pertaining to "ARP reply for known IPs". > May be this warning print can be removed. Fair enough. Removed. Thank you for the review. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev