From patchwork Thu Oct 29 03:07:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarno Rajahalme X-Patchwork-Id: 537664 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id A957814030D for ; Thu, 29 Oct 2015 14:08:46 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nicira_com.20150623.gappssmtp.com header.i=@nicira_com.20150623.gappssmtp.com header.b=DmOsRws+; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id ACAC1102EB; Wed, 28 Oct 2015 20:08:13 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 6AF371028E for ; Wed, 28 Oct 2015 20:08:11 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id E8A8D1E02CF for ; Wed, 28 Oct 2015 21:08:10 -0600 (MDT) X-ASG-Debug-ID: 1446088089-09eadd4c91518280001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id GdEio6ukLayd1qf9 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 28 Oct 2015 21:08:09 -0600 (MDT) X-Barracuda-Envelope-From: jrajahalme@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mail-pa0-f52.google.com) (209.85.220.52) by mx1-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 29 Oct 2015 03:08:09 -0000 Received-SPF: unknown (mx1-pf2.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.52 Received: by pasz6 with SMTP id z6so25789169pas.2 for ; Wed, 28 Oct 2015 20:08:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nicira_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sre1vamdfXvCqsTnwtVHUE3ev5CQiSZz1AWQJAj0vMU=; b=DmOsRws+9OGXzZ/7QO+H18KWnhnoDlyz6G7FN65NE9IwFDFn2kw6+gjto/Yw8/DVqZ 8b47eduSpsfafmTBkkqKvFwpCCO0kOVSSm2iPYoKh1+e0raA35xl9A4Sxk0snKuq3wMK YXwy/IZIeWVUtRT87xEYatihh5xrXiERR/WDzxUx15gFV5ev7i8vlldaP/inxWge1uPx 2yPYbl57blZQbm4SeyrcO60Z4B4pxVNU1mDsDNgCTek/kocgcfMcrrq6DftE1igOaXTQ wVcDAizkXHEuqSIZ39MF5O29cWnrlt7vnaWOMkof7fyTqTL4/YZtY2SLPycg/QzEIbcc vmFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sre1vamdfXvCqsTnwtVHUE3ev5CQiSZz1AWQJAj0vMU=; b=OtUcPZifoODq7Tb2OwMhSeL9za3LkWJZHM7RLvnra4ESicPkbUTuTevoHX3FA5lLjR nhJ6taapfNzp84PrT37XyfguOGCu/F88G9SRDd3L9HxmBhivBaa5BYsl29lGMjJiYTfh AVu3zntCZULyuslV1vXbpwnaziBp6slB91K9hRICzNZ1Hp85AVOWaMDsNFIhfNh6OZ4k 0xuMziiT6D1ywmgJ/GGpQgHfISRYYs4tChd9mu9E6VJ068MdtBjPWgba5kvafDnfgZm5 fjelUGoFeC5Op4auiMgh07yqyjEhhHHjz/jT7tsaca70hCgybNkhiY96ZR0yTF6mXvqX /Hgw== X-Gm-Message-State: ALoCoQmyB9EHZ5gaLIZj4E6tk3A7UH5tD0IYKCC4NmKFCuEyli7QBC6/s3L2OXmFeW2vyZD8fVEB X-Received: by 10.66.254.7 with SMTP id ae7mr37324833pad.129.1446088088322; Wed, 28 Oct 2015 20:08:08 -0700 (PDT) Received: from sc9-mailhost1.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id ou1sm42253421pbc.7.2015.10.28.20.08.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Oct 2015 20:08:07 -0700 (PDT) X-CudaMail-Envelope-Sender: jrajahalme@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.1.34 From: Jarno Rajahalme To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E2-1027130231 X-CudaMail-DTE: 102815 X-CudaMail-Originating-IP: 209.85.220.52 Date: Wed, 28 Oct 2015 20:07:57 -0700 X-ASG-Orig-Subj: [##CM-E2-1027130231##][PATCH 5/6] upcall: Check for recirc_id in ukey_create_from_dpif_flow() Message-Id: <1446088078-32610-5-git-send-email-jrajahalme@nicira.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446088078-32610-1-git-send-email-jrajahalme@nicira.com> References: <1446088078-32610-1-git-send-email-jrajahalme@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1446088089 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA 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 5/6] upcall: Check for recirc_id in ukey_create_from_dpif_flow() 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: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Filter out not only flows with recirculation actions, but also flows with non-zero recirculation id in flow key when creating ukeys from datapath flows, as such flows also depend on the recirculation context, which have been lost after a restart. Signed-off-by: Jarno Rajahalme Acked-by: Joe Stringer --- ofproto/ofproto-dpif-upcall.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 1d8790c..f749c66 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -1565,7 +1565,14 @@ ukey_create_from_dpif_flow(const struct udpif *udpif, /* Check the flow actions for recirculation action. As recirculation * relies on OVS userspace internal state, we need to delete all old - * datapath flows with recirculation upon OVS restart. */ + * datapath flows with either a non-zero recirc_id in the key, or any + * recirculation actions upon OVS restart. */ + NL_ATTR_FOR_EACH_UNSAFE (a, left, flow->key, flow->key_len) { + if (nl_attr_type(a) == OVS_KEY_ATTR_RECIRC_ID + && nl_attr_get_u32(a) != 0) { + return EINVAL; + } + } NL_ATTR_FOR_EACH_UNSAFE (a, left, flow->actions, flow->actions_len) { if (nl_attr_type(a) == OVS_ACTION_ATTR_RECIRC) { return EINVAL;