From patchwork Tue May 10 14:34:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 620660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3r41wn68LWz9sXR for ; Wed, 11 May 2016 00:34:33 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 618B2108C8; Tue, 10 May 2016 07:34:32 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id F2D49108C2 for ; Tue, 10 May 2016 07:34:30 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 586DE1622CF for ; Tue, 10 May 2016 08:34:30 -0600 (MDT) X-ASG-Debug-ID: 1462890868-0b3237652e4b3950001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar6.cudamail.com with ESMTP id uhvkZIN9Uqbj3Jiu (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 10 May 2016 08:34:28 -0600 (MDT) X-Barracuda-Envelope-From: nusiddiq@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 10 May 2016 14:34:27 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at _spf1.redhat.com designates 209.132.183.28 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF91B627DD for ; Tue, 10 May 2016 14:34:25 +0000 (UTC) Received: from nusiddiq.blr.redhat.com (dhcp-0-111.blr.redhat.com [10.70.1.111]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4AEYOla009610 for ; Tue, 10 May 2016 10:34:25 -0400 X-CudaMail-Envelope-Sender: nusiddiq@redhat.com From: Numan Siddique X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-509028633 X-CudaMail-DTE: 051016 X-CudaMail-Originating-IP: 209.132.183.28 To: ovs dev X-ASG-Orig-Subj: [##CM-E1-509028633##][PATCH] vswitchd: Restore the packet metadata when the packet is resumed Organization: Red Hat Message-ID: <43e20fe4-8de7-7488-b16c-b02c26e9d0cb@redhat.com> Date: Tue, 10 May 2016 20:04:23 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 10 May 2016 14:34:25 +0000 (UTC) X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1462890868 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH] vswitchd: Restore the packet metadata when the packet is resumed X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 --- 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); + struct flow headers; flow_extract(&packet, &headers);