From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7603FA054D; Tue, 7 Jun 2022 17:42:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49C8B4021D; Tue, 7 Jun 2022 17:42:02 +0200 (CEST) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mails.dpdk.org (Postfix) with ESMTP id 0D7DF40156; Tue, 7 Jun 2022 17:42:00 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 39DD43200A44; Tue, 7 Jun 2022 11:41:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 07 Jun 2022 11:41:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1654616517; x= 1654702917; bh=qg/TqGrQp3tZ+iPkmr4xZj/iGPoNc/Qj4PNCODJP5Qc=; b=f w1SGiXHk6Ko3DSchg4DzDQjnnpEStYeUsNoPtsP8dSsILc9tlU8dQbTA/Qbo/P4N xJv6QGeqDELobtaJcvkkk0Aw4pAfMUmff+Wtb9+kd/rHINK/4ApLeO2NUBBzRmpa cfjSgtnb3zTlpFvMr7E3hhBPqz9eqf7el8BOCdi+g8V78M0/nM08Y+JtztTTPPdp N5IYm91FaV1G6ejdAmrNl1DRV5LsEgYkalAkYKe11yBCKli1pamyt+3zQQeQX8uf xvO2Fa94WbZpbbPhswwXBhaEy+/5qmjZ/53NLKZvLm/cXw5TimbZgV8SWm0Tu4ot vwm+9STnqX0x6MOPr9pjw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1654616517; x= 1654702917; bh=qg/TqGrQp3tZ+iPkmr4xZj/iGPoNc/Qj4PNCODJP5Qc=; b=S OTVpeccmgCvW9hMHHwpI0CrnW3UtfWGTz/FK0P1VRNrcKRfBek8AdgsMrfAwwg1n QfmcBTNxJ9ytp6Ssrd01fMkxv3G8B/LCBz7i4DVykZ28blvnVcdgpNHJYbtqfRYh vr+xFTl8gxnyhtSRR2T0MVujdy932r9ArfPZD5TuSpu1+MG4DZ8CWh2EpJASwKbl lNfLcRmfNdyDOV/2f1xKqc/t2QhJHn5a9fNGaBxxmBfz2w8A8s9V8i8mwLlX3Wcg KUpLoe/FunTAqW1esBcWaZl6YQCVU5GFOmZFufuxLXGOAdgiZ9tl4W0K91Z+sJL0 aiyrGZFl6d0nb/aHVdwBA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Jun 2022 11:41:55 -0400 (EDT) From: Thomas Monjalon To: Romain Delhomel Cc: dev@dpdk.org, elias.boutaleb@6wind.com, guillaume.gaudonville@6wind.com, hemant.agrawal@nxp.com, olivier.matz@6wind.com, sachin.saxena@oss.nxp.com, stephane.gonauer@6wind.com, stable@dpdk.org Subject: Re: [PATCH] bus/fslmc: fix invalid use of default VFIO config Date: Tue, 07 Jun 2022 17:41:52 +0200 Message-ID: <5878881.yKVeVyVuyW@thomas> In-Reply-To: <20220603151830.26845-1-romain.delhomel@6wind.com> References: <20220603151830.26845-1-romain.delhomel@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 03/06/2022 17:18, Romain Delhomel: > At device probe, the fslmc bus driver calls rte_vfio_get_group_fd() to > get a fd associated to a vfio group. This function first checks if the > group is already opened, else it opens /dev/vfio/%u, and increases the > number of active groups in default_vfio_cfg (which references the > default vfio container). > > When adding the first group to a vfio_cfg, the caller is supposed to > pick an IOMMU type and set up DMA mappings for container, as it's done > by pci bus, but it is not done here. Instead, a new container is created > and used. > > This prevents the pci bus driver, which uses the default_vfio_cfg > container, to configure the container because > default_vfio_cfg->active_group > 1. > > This patch fixes the issue by always creating a new container (and its > associated vfio_cfg) and binding the group to it. > > Fixes: a69f79300262 ("bus/fslmc: support multi VFIO group") > Cc: stable@dpdk.org > > Signed-off-by: Romain Delhomel > Acked-by: Hemant Agrawal Applied, thanks.