From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 93DAE1B616 for ; Sun, 25 Nov 2018 13:03:49 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 26AC920A4D; Sun, 25 Nov 2018 07:03:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 25 Nov 2018 07:03:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=pa15YfBi6ab9z2ozS/L3DQQ57PMkqngio6uGx+Gwbsk=; b=ZVDt0rkgmu2C gaYmXdPvstZzOa7DEKrAceGPdtHB2pFpU+SqTA9zZ5CtXCju1P+9iOFgL4pu8QOf veEkREroUvuoMaQEaxpY+bPTlBaxbs6RRirP64nX49IdSTpcdMlwf5d9qM0dyMMl Z+JpdmdDYzlScBI3AgIy/ZPTYz6hVK8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=pa15YfBi6ab9z2ozS/L3DQQ57PMkqngio6uGx+Gwb sk=; b=c86SlIHS77Qnw2lPGYbAg8KyLlsojcrwINQ4Ib9gY+E/07RqlfbLMDVA/ Hh4z46AT5SjmNHTwxjMsM0sJRoU8JiTZLkbWjyGZ0I17HzhGmxRUfg8H7V1RSFsx k3IF9oHvnkDCyzo7dWYxYYGFDs8Jp/BDeiZMOhm57wrxbFf/wawUr/L7DMTq5cAo 06GTTiuMVln52i6TSZDVSUQDYoQe2PFX6YpxKmrEjINUTU06Hi8CC3VW3jikvspV sMSjq4/9WFOVG4b8F9bvH+mPQqRKNGLQKZax6xbR5rvkUtwpReu0pxi4pdFyCPx8 wp3qsXqV63TogZAPkvi3rAI1Z37bA== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 16E9BE4443; Sun, 25 Nov 2018 07:03:48 -0500 (EST) From: Thomas Monjalon To: Darek Stojaczyk Cc: dev@dpdk.org, "Burakov, Anatoly" Date: Sun, 25 Nov 2018 13:03:46 +0100 Message-ID: <2986248.Quj79joPid@xps> In-Reply-To: <902e9ebc-e658-fd41-55ce-8ba9e3a72728@intel.com> References: <20181121184132.34039-1-dariusz.stojaczyk@intel.com> <902e9ebc-e658-fd41-55ce-8ba9e3a72728@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] vfio: don't needlessly setup devices in secondary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 12:03:49 -0000 23/11/2018 10:12, Burakov, Anatoly: > On 21-Nov-18 6:41 PM, Darek Stojaczyk wrote: > > Setting up a device that wasn't setup in the primary > > process will possibly break the primary process. That's > > because the IPC message to retrieve the group fd in the > > primary will also *open* that group if it wasn't opened > > before. Even though the secondary process closes that fd > > soon after as a part of its error handling path, the > > primary process leaks it. > > > > What's worse, opening that fd on the primary will > > increment the process-local counter of opened groups. > > If it was 0 before, then the group will never be added > > to the vfio container, nor dpdk memory will be ever > > mapped. > > > > This patch moves the proper error checks earlier in the > > code to fuly prevent setting up devices in secondary > > processes that weren't setup in the primary process. > > > > Fixes: 2f4adfad0a69 ("vfio: add multiprocess support") > > Cc: anatoly.burakov@intel.com > > > > Signed-off-by: Darek Stojaczyk > > Acked-by: Anatoly Burakov Applied, thanks