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 6DA56A0540 for ; Thu, 7 Jul 2022 09:57:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 699BE406B4; Thu, 7 Jul 2022 09:57:54 +0200 (CEST) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id F17FC406B4 for ; Thu, 7 Jul 2022 09:57:52 +0200 (CEST) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 695AB41016 for ; Thu, 7 Jul 2022 07:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657180672; bh=9bFlVrcuTyNsKTFC6fCKo7lecHTxEsTa60tanbbMuDE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X7nX40D+zFkM1EuyjDCpfok1eXC7vP5QuQyaOEpmSD6nWI++FlKYx+8YkthTkLeKl qetfcjgk6WY9Hgc5covCG92hwHsFbO/lGlfoqAwhHAbyw3o296ClK33eoRLyVto9I0 s+IdIc9RjrnTk+BnEhhXyEdTPHWB0wUaiDJqI9yze5++dF+hujg6oc8qVlzmarQqVF uJjqn/gqy/kDDSUXTkQd+nXiUQ0SkuOYUMZxF7j4OlmGvwxNEhA76w5QyfBcb5fnVJ CmrypWRrWBfWYuWkTBDyAjphexgPEIDqp1quyxUU6NcvVMfMyuzJan1REPqru5NEcT yyHQSvQcpvORg== Received: by mail-ed1-f71.google.com with SMTP id m20-20020a056402431400b0043a699cdd6eso7550720edc.9 for ; Thu, 07 Jul 2022 00:57:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9bFlVrcuTyNsKTFC6fCKo7lecHTxEsTa60tanbbMuDE=; b=6HiuY8flOC+E+/OatV+1vCQYqqQWiF0amaIbTnpSL27ouQs7D2a+knm+cUJCIGpE8Q F7pPr4O4weGPZmjX3cuADN3PFC/nwOVLTVN+56T6jDxrkfpjaQPf9HTeMin6xtvABkLv nJ6pMDLo6kqtcp4FZlNWwUrGB/Gj3vZmRmaqccClx1nEKKt0CiktgzIWMewNeJxaLfMh cDaVfsSv/BPZjfQuFYnCnm1okjzMJBzOanySSnHFFO7Xu/5TglP30w8256cLVnU059Ua 7WZT7dNiWPWEuzocJh1Z+qC/JSAg0jdNml2wMkQFMW4ahShWOVunjxyOKsc7AhqXpNic fR4Q== X-Gm-Message-State: AJIora/d9zsgpuY6kEBDFNZPQzuLybXTi/mujay1bjwHUtxvXzrcRmVI DOOhuR+2Du49VFbXf3/8RSaphXBbMMPNkdXwL9uQQzkq/DgP5DQJm4BpcmnBuh1cXhPQB11rtFs KsR77RQjIz518Q3TqhXl4QUSy X-Received: by 2002:a17:907:1c01:b0:6f4:2692:e23 with SMTP id nc1-20020a1709071c0100b006f426920e23mr42627573ejc.243.1657180671937; Thu, 07 Jul 2022 00:57:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ukogrmukLg4b8G/89gESOrxFqYBOx5XbOf3KpxyPBWwzjmbi6etAXsZf5Kew5Lt3yFPYFzvQ== X-Received: by 2002:a17:907:1c01:b0:6f4:2692:e23 with SMTP id nc1-20020a1709071c0100b006f426920e23mr42627530ejc.243.1657180671267; Thu, 07 Jul 2022 00:57:51 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2a02:6d40:3a4f:7b00:c19b:938e:7c97:afe2]) by smtp.gmail.com with ESMTPSA id d1-20020a056402516100b0043a09f6fc24sm11385793ede.47.2022.07.07.00.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 00:57:50 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Romain Delhomel Cc: Hemant Agrawal , dpdk stable Subject: patch 'bus/fslmc: fix VFIO setup' has been queued to stable release 19.11.13 Date: Thu, 7 Jul 2022 09:54:45 +0200 Message-Id: <20220707075522.194223-50-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220707075522.194223-1-christian.ehrhardt@canonical.com> References: <20220707075522.194223-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 19.11.13 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/09/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/3ed306d01422fb8224f6d6314a1181b8d2451908 Thanks. Christian Ehrhardt --- >From 3ed306d01422fb8224f6d6314a1181b8d2451908 Mon Sep 17 00:00:00 2001 From: Romain Delhomel Date: Fri, 3 Jun 2022 17:18:30 +0200 Subject: [PATCH] bus/fslmc: fix VFIO setup [ upstream commit 36c3c4df136f6d79c0ffaddec00696f5eddaef16 ] 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") Signed-off-by: Romain Delhomel Acked-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_vfio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index bf9e3e49a5..95f7586ab5 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -903,6 +903,7 @@ fslmc_vfio_setup_group(void) { int groupid; int ret; + int vfio_container_fd; struct vfio_group_status status = { .argsz = sizeof(status) }; /* if already done once */ @@ -921,8 +922,15 @@ fslmc_vfio_setup_group(void) return 0; } + ret = rte_vfio_container_create(); + if (ret < 0) { + DPAA2_BUS_ERR("Failed to open VFIO container"); + return ret; + } + vfio_container_fd = ret; + /* Get the actual group fd */ - ret = rte_vfio_get_group_fd(groupid); + ret = rte_vfio_container_group_bind(vfio_container_fd, groupid); if (ret < 0) return ret; vfio_group.fd = ret; -- 2.37.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-07 09:54:13.289901956 +0200 +++ 0050-bus-fslmc-fix-VFIO-setup.patch 2022-07-07 09:54:10.937824444 +0200 @@ -1 +1 @@ -From 36c3c4df136f6d79c0ffaddec00696f5eddaef16 Mon Sep 17 00:00:00 2001 +From 3ed306d01422fb8224f6d6314a1181b8d2451908 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 36c3c4df136f6d79c0ffaddec00696f5eddaef16 ] + @@ -25 +26,0 @@ -Cc: stable@dpdk.org @@ -34 +35 @@ -index 1b89a56bbc..3d4e71a80a 100644 +index bf9e3e49a5..95f7586ab5 100644 @@ -37 +38 @@ -@@ -995,6 +995,7 @@ fslmc_vfio_setup_group(void) +@@ -903,6 +903,7 @@ fslmc_vfio_setup_group(void) @@ -45 +46 @@ -@@ -1013,8 +1014,15 @@ fslmc_vfio_setup_group(void) +@@ -921,8 +922,15 @@ fslmc_vfio_setup_group(void)