This function no longer has much need to modify its argument, because the caller can now easily do the modification itself, so this commit makes that change.
Signed-off-by: Ben Pfaff <b...@nicira.com> --- ofproto/ofproto-dpif.c | 1 + ofproto/tunnel.c | 16 +++++----------- ofproto/tunnel.h | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 0d17dbf..a42625b 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -3927,6 +3927,7 @@ ofproto_receive(const struct dpif_backer *backer, struct ofpbuf *packet, flow->in_port = OFPP_NONE; goto exit; } + flow->in_port = ofport->ofp_port; port = ofport_dpif_cast(ofport); /* XXX: Since the tunnel module is not scoped per backer, it's diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index f5bbfb9..31aaf3b 100644 --- a/ofproto/tunnel.c +++ b/ofproto/tunnel.c @@ -159,17 +159,14 @@ tnl_port_del(struct tnl_port *tnl_port) } } -/* Transforms 'flow' so that it appears to have been received by a tunnel - * OpenFlow port controlled by this module instead of the datapath port it - * actually came in on. Sets 'flow''s in_port to the appropriate OpenFlow port - * number. Returns the 'ofport' corresponding to the new in_port. +/* Looks in the table of tunnels for a tunnel matching the metadata in 'flow'. + * Returns the 'ofport' corresponding to the new in_port, or a null pointer if + * none is found. * * Callers should verify that 'flow' needs to be received by calling - * tnl_port_should_receive() before this function. - * - * Leaves 'flow' untouched and returns null if unsuccessful. */ + * tnl_port_should_receive() before this function. */ const struct ofport * -tnl_port_receive(struct flow *flow) +tnl_port_receive(const struct flow *flow) { char *pre_flow_str = NULL; struct tnl_port *tnl_port; @@ -196,9 +193,6 @@ tnl_port_receive(struct flow *flow) pre_flow_str = flow_to_string(flow); } - flow->in_port = tnl_port->ofport->ofp_port; - /* Keep flow->tunnel to allow matching on tunnel metadata */ - if (pre_flow_str) { char *post_flow_str = flow_to_string(flow); char *tnl_str = tnl_port_fmt(tnl_port); diff --git a/ofproto/tunnel.h b/ofproto/tunnel.h index 1b055ae..34c1133 100644 --- a/ofproto/tunnel.h +++ b/ofproto/tunnel.h @@ -37,7 +37,7 @@ bool tnl_port_reconfigure(const struct ofport *, uint32_t odp_port, struct tnl_port *tnl_port_add(const struct ofport *, uint32_t odp_port); void tnl_port_del(struct tnl_port *); -const struct ofport *tnl_port_receive(struct flow *); +const struct ofport *tnl_port_receive(const struct flow *); uint32_t tnl_port_send(const struct tnl_port *, struct flow *); /* Returns true if 'flow' should be submitted to tnl_port_receive(). */ -- 1.7.2.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev