On Mon, May 18, 2015 at 07:32:01AM -0700, Gurucharan Shetty wrote: > > > >> + int tag = 0; > >> + ofp_port_t ofport; > >> + if (binding->parent_port) { > >> + ofport = u16_to_ofp(simap_get(&lport_to_ofport, > >> + binding->parent_port)); > >> + if (ofport) { > > > > I don't think that it is safe to rely on 'tag' being nonnull here. It > > should be, but the database constraints can't ensure it: > > > >> + tag = *binding->tag; > I will fix it.
Thanks! > >> @@ -122,10 +136,20 @@ physical_run(struct controller_ctx *ctx) > >> * > >> * For packets that arrive from a vif: set MFF_LOG_INPORT to > >> the > >> * logical input port, MFF_METADATA to the logical datapath, > >> and > >> - * resubmit into the logical pipeline starting at table 16. */ > >> + * resubmit into the logical pipeline starting at table 16. > >> + * > >> + * Containers sitting behind a vif, come with VLAN tags. > >> + * Match on the tags and then strip it before resubmitting to > >> + * the next tables. */ > >> match_init_catchall(&match); > >> ofpbuf_clear(&ofpacts); > >> match_set_in_port(&match, ofport); > >> + if (tag) { > >> + match_set_dl_vlan(&match, htons(tag)); > >> + } else { > >> + match_set_dl_vlan(&match, htons(OFP10_VLAN_NONE)); > >> + } > > > > Above, I would rather avoid matching on the VLAN at all in the case > > where there is no tag. That gives the logical pipeline a chance to use > > the VLAN tag in such a case. (Currently, the logical pipeline just > > discards packets that have VLAN tags, but I'd like to leave room for > > expansion in the future, especially since there seems to be some ongoing > > work on QinQ support.) > If I have 2 flows: > 1. inport=10, actions=foo > 2. inport=10,dl_vlan=20, actions=foo > > Then is it not true that a packet coming from inport=10 with vlan 20 > can match either of the above flows? > If the above is correct, I think I should match on a 'no vlan' because > I need to let the mgmt IP of the VM that hosts containers to belong to > a different logical network. (I guess, I can change the priorities of > the vlan matched packets to get the behavior that you desire too.) I didn't know that we could have both kinds of traffic on a single vif, thanks for pointing that out. I'd rather use a priority to do this distinguishing. Thanks, Ben. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev