diff options
author | Numan Siddique <nusiddiq@redhat.com> | 2016-05-10 16:04:35 -0700 |
---|---|---|
committer | Jarno Rajahalme <jarno@ovn.org> | 2016-05-10 16:04:35 -0700 |
commit | 1df7f7aac8c976690167261fec9a50d832ef9e7e (patch) | |
tree | ce6516d9caa57a83e489060f645bd584b2f610a7 | |
parent | 2ff8484bbf88ce2552f0a55c6032d30eaff377e6 (diff) | |
download | openvswitch-1df7f7aac8c976690167261fec9a50d832ef9e7e.tar.gz |
ofproto-dpif: Restore packet metadata when a continuation is resumed.
Recirculations due to NXT_RESUME are failing if the packet metadata is not
restored prior to the packet execution.
Reported-at: http://openvswitch.org/pipermail/dev/2016-May/070723.html
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
-rw-r--r-- | ofproto/ofproto-dpif.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index fea86aa3a..219933ef2 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -3656,6 +3656,16 @@ rule_expire(struct rule_dpif *rule) } } +static void +ofproto_dpif_set_packet_odp_port(const struct ofproto_dpif *ofproto, + ofp_port_t in_port, struct dp_packet *packet) +{ + if (in_port == OFPP_NONE) { + in_port = OFPP_LOCAL; + } + packet->md.in_port.odp_port = ofp_port_to_odp_port(ofproto, in_port); +} + int ofproto_dpif_execute_actions__(struct ofproto_dpif *ofproto, const struct flow *flow, @@ -3667,7 +3677,6 @@ ofproto_dpif_execute_actions__(struct ofproto_dpif *ofproto, struct dpif_flow_stats stats; struct xlate_out xout; struct xlate_in xin; - ofp_port_t in_port; struct dpif_execute execute; int error; @@ -3704,11 +3713,7 @@ ofproto_dpif_execute_actions__(struct ofproto_dpif *ofproto, execute.mtu = 0; /* Fix up in_port. */ - in_port = flow->in_port.ofp_port; - if (in_port == OFPP_NONE) { - in_port = OFPP_LOCAL; - } - execute.packet->md.in_port.odp_port = ofp_port_to_odp_port(ofproto, in_port); + ofproto_dpif_set_packet_odp_port(ofproto, flow->in_port.ofp_port, packet); error = dpif_execute(ofproto->backer->dpif, &execute); out: @@ -4399,6 +4404,13 @@ nxt_resume(struct ofproto *ofproto_, dp_packet_init(&packet, pin->public.packet_len); dp_packet_put(&packet, pin->public.packet, pin->public.packet_len); + pkt_metadata_from_flow(&packet.md, &pin->public.flow_metadata.flow); + + /* Fix up in_port. */ + ofproto_dpif_set_packet_odp_port(ofproto, + pin->public.flow_metadata.flow.in_port.ofp_port, + &packet); + struct flow headers; flow_extract(&packet, &headers); |