[ovs-dev] [PATCH] ofproto-dpif.c: Modify vsp_realdev_to_vlandev() function

Ben Pfaff blp at nicira.com
Wed May 29 23:58:27 UTC 2013


On Wed, May 29, 2013 at 04:57:11PM -0700, Alex Wang wrote:
> This patch modifies the vsp_realdev_to_vlandev() function. Instead of taking
> and returning datapath port number, the new implementation takes and returns
> OpenFlow port number.
> 
> Signed-off-by: Alex Wang <alexw at nicira.com>

This needs a re-spin against current master, which has changed slightly
due to the refactoring of xlate_action_ctx.

I would prefer to avoid the ofp_port_to_odp_port() call in the common
case.  How about this:

        uint16_t vlandev_port;

        odp_port = ofport->odp_port;
        vlandev_port = vsp_realdev_to_vlandev(ctx->ofproto, odp_port,
                                              ctx->xin->flow.vlan_tci);
        if (vlandev_port == ofport->up.ofp_port) {
            out_port = odp_port;
        } else {
            out_port = ofp_port_to_odp_port(vlandev_port);
            ctx->xin->flow.vlan_tci = htons(0);
        }
        ctx->xin->flow.skb_mark &= ~IPSEC_MARK;

Thanks,

Ben.



More information about the dev mailing list