> On Jul 23, 2015, at 1:23 PM, Ben Pfaff <[email protected]> wrote:
> 
> Since commit e672ff9b4d2 (ofproto-dpif: Restore metadata and registers
> on recirculation.), xlate_actions() has first obtained the input port:
> 
>    /* The in_port of the original packet before recirculation. */
>    struct xport *in_port = get_ofp_port(xbridge, flow->in_port.ofp_port);
> 
> then updated it to restore the pre-recirculation state:
> 
>    if (xin->recirc) {
> ...
>        /* Restore pipeline metadata. May change flow's in_port and other
>         * metadata to the values that existed when recirculation was
>         * triggered. */
>        recirc_metadata_to_flow(&recirc->metadata, flow);
> ...
>    }
> 
> However I'm not sure that this order makes sense.  We use 'in_port'
> later for checks like may_receive() and xport_stp_forward_state() where
> I'd think that the original input port is the appropriate one to check,
> not the one that happened to be used by the recirculated packet.  Am I
> missing anything?
> 

The input port is only changed when the recirculation was originated by another 
bridge, i.e., the bridge connected to by a patch port. At that point all the 
checks for the original bridge have already been performed, including 
may_receive() etc. In fact, the same applies to the patched-to-port as well, we 
do these checks again for that bridge, and they have already been done before 
recirculation.

Currently we do not repeat these checks after recirculation. If there is need 
for rechecking (e.g., something breaks if we pass traffic on a port that has 
been shut down), it seems to me that it should suffice to re-do these checks on 
the recirculating port/bridge, the first bridge has already transmitted the 
packet to the second one after all.

  Jarno

> Thanks,
> 
> Ben.

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to