From patchwork Tue May 10 22:42:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 620858 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 3r4DlX5TPGz9s2G for ; Wed, 11 May 2016 08:42:16 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 0827910A8E; Tue, 10 May 2016 15:42:16 -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 277D610A80 for ; Tue, 10 May 2016 15:42:14 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id AB403162148 for ; Tue, 10 May 2016 16:42:13 -0600 (MDT) X-ASG-Debug-ID: 1462920133-0b3237652e5670e0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar6.cudamail.com with ESMTP id IieWD1749z3ZgIsz (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 10 May 2016 16:42:13 -0600 (MDT) X-Barracuda-Envelope-From: joe@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO relay6-d.mail.gandi.net) (217.70.183.198) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 10 May 2016 22:42:12 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at ovn.org designates 217.70.183.198 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.198 X-Barracuda-RBL-IP: 217.70.183.198 Received: from mfilter21-d.gandi.net (mfilter21-d.gandi.net [217.70.178.149]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 754C1FB8A0; Wed, 11 May 2016 00:42:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter21-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter21-d.gandi.net (mfilter21-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id F1UFoYKtG0nl; Wed, 11 May 2016 00:42:09 +0200 (CEST) X-Originating-IP: 208.91.1.34 Received: from localhost.localdomain (unknown [208.91.1.34]) (Authenticated sender: joe@ovn.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 37223FB89E; Wed, 11 May 2016 00:42:07 +0200 (CEST) X-CudaMail-Envelope-Sender: joe@ovn.org From: Joe Stringer To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-509091332 X-CudaMail-DTE: 051016 X-CudaMail-Originating-IP: 217.70.183.198 Date: Tue, 10 May 2016 15:42:01 -0700 X-ASG-Orig-Subj: [##CM-E1-509091332##][PATCH] ofproto-dpif-upcall: Pass key to dpif_flow_get(). Message-Id: <1462920121-63263-1-git-send-email-joe@ovn.org> X-Mailer: git-send-email 2.1.4 X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1462920133 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] ofproto-dpif-upcall: Pass key to dpif_flow_get(). 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" Windows datapath folks have reported instances where OVS userspace will pass down a flow_get request to the datapath using a UFID even though the datapath has no support for UFIDs. Since commit e672ff9b4d22 ("ofproto-dpif: Restore metadata and registers on recirculation."), if a flow dump provides a flow that userspace isn't aware of, and the flow dump doesn't provide actions for that flow, then userspace will attempt a flow_get using just the UFID. This is because the ofproto-dpif layer doesn't pass the key down to the dpif layer even if it's available. Prior to the above commit, the codepath was only hit if the key was not available, which would have implied UFID support. This assumption is now broken: An empty set of actions could also trigger flow_get, and datapaths without UFID support are free to pass up empty actions lists. This patch should fix the issue by ensuring that the flow key is passed down, so the dpif layer should have all of the relevant information to craft the appropriate datapath flow_get request for the underlying datapath, whether UFID is supported or not. Fixes: e672ff9b4d22 ("ofproto-dpif: Restore metadata and registers on recirculation.") Reported-by: Sairam Venugopal Signed-off-by: Joe Stringer Acked-by: Jarno Rajahalme --- ofproto/ofproto-dpif-upcall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index f62f46b8e337..52c42ab41a47 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -1518,7 +1518,7 @@ ukey_create_from_dpif_flow(const struct udpif *udpif, /* If the key or actions were not provided by the datapath, fetch the * full flow. */ ofpbuf_use_stack(&buf, &stub, sizeof stub); - err = dpif_flow_get(udpif->dpif, NULL, 0, &flow->ufid, + err = dpif_flow_get(udpif->dpif, flow->key, flow->key_len, &flow->ufid, flow->pmd_id, &buf, &full_flow); if (err) { return err;