diff mbox

[ovs-dev] vswitchd: Restore the packet metadata when the packet is resumed

Message ID 43e20fe4-8de7-7488-b16c-b02c26e9d0cb@redhat.com
State Accepted
Headers show

Commit Message

Numan Siddique May 10, 2016, 2:34 p.m. UTC
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>
---
 ofproto/ofproto-dpif.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Jarno Rajahalme May 10, 2016, 11:11 p.m. UTC | #1
> On May 10, 2016, at 7:34 AM, Numan Siddique <nusiddiq@redhat.com> wrote:
> 
> 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>
> ---
> ofproto/ofproto-dpif.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
> 
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index 0c65df2..c131e9d 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> @@ -4399,6 +4399,15 @@ 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);
> +    ofp_port_t in_port;
> +    /* Fix up in_port. */
> +    in_port = pin->public.flow_metadata.flow.in_port.ofp_port;
> +    if (in_port == OFPP_NONE) {
> +        in_port = OFPP_LOCAL;
> +    }
> +    packet.md.in_port.odp_port = ofp_port_to_odp_port(ofproto, in_port);
> +

I re-factored the in_port fix-up code that was copied from elsewhere in the file to a new helper and pushed this to master.

Thanks for the fix!

   Jarno

>     struct flow headers;
>     flow_extract(&packet, &headers);
> 
> -- 
> 2.5.5
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
diff mbox

Patch

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 0c65df2..c131e9d 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4399,6 +4399,15 @@  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);
+    ofp_port_t in_port;
+    /* Fix up in_port. */
+    in_port = pin->public.flow_metadata.flow.in_port.ofp_port;
+    if (in_port == OFPP_NONE) {
+        in_port = OFPP_LOCAL;
+    }
+    packet.md.in_port.odp_port = ofp_port_to_odp_port(ofproto, in_port);
+
     struct flow headers;
     flow_extract(&packet, &headers);