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 5EDF2A034F for ; Wed, 10 Nov 2021 07:59:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5218F40142; Wed, 10 Nov 2021 07:59:46 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2080.outbound.protection.outlook.com [40.107.236.80]) by mails.dpdk.org (Postfix) with ESMTP id BB553410F2 for ; Wed, 10 Nov 2021 07:59:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FHXQnwsMinyBjWBX7dkxL9yD/nn0oBOMyUAmw+LK+7/5IrutFkrWrOnZF+FzJjnodXl4Dh2qHlO8ofA9zU3tx1LpmjoLH8I4ggvI9WbxriJwNwiD64CpSi9/U2Yr6zyyrEFLd94DP3qOZe/ky9y3R+DW+JaRwPDk9XEcXlOKuBFWoCOr50XwamAasWQ0SsgxpIoVT/T3DB7bv+2A6v6XVH/HaFu0WZXmXcU1a+KpK7SHeeMYn34q0GQCmPURwBaVSsjc1VjuTJr8Xmk7ZMT5zy01f6C2buf55auF7mraDjuc/1dV44cSr9S4bz/gahc29m485w3COas816P2ocq3Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yHYTvQRqpxPf3R0xq8EL8rNJ2L+PmnZKqf14wkCejVI=; b=kxpk9nXpdSEtN43yBrgtC1xoGp52dJTBtfS7Bd3VkRh6jF1U8nh1O/eTXoV/UompXkvYZ2ISZvApmWYfts9YkfhsH1TXoG46fdKu29ledLA+0Pje4RgxRx8S8IS9zEBMUWb2EdzlmCnNloweQddVVYNQK/IZJexVCEmnNrEFhSl9cGke5wDlcStLf/TSgO/zjeBbwYstbkGPCO7spsCqzfAxp/scAPzs4VBEM7nd7AV2kKhKZb0c18LRb/0C5ESHbexisSzuynCgtPT48fjxGKk5juoaMJEmC3C4y2U6UCycF2f4LgBlP65XsPde0fHuMy9PQHGPgsz0BKODJqAoyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yHYTvQRqpxPf3R0xq8EL8rNJ2L+PmnZKqf14wkCejVI=; b=KE06Ds43x+jnlHgXAsCu37+vgNlTqhwRxR/Q1g0yDVuCIRxnqFx+h7MjpIPw/f4i81jR30k8O5vjhRGVjSeGWJKKsxinFY4XpKKSz3TyDGAQ3cqiSIX442nOfSiUA7WNFvxHnM2/gOIwtfpBnSMP06GJZPphpJ0I+PIADj3YFQMUD2KHkNiCbw3Xo99FLZqZknYffzYP844dVNaJRNeBPTALr4C1W5ZCMSpKNBPCUDi8rV+/FSOzvuHHYMzQVsx5gpSk7ELXUjGf58ucePoeBnVl5Is2PkSiVsbgnr1R4o3MPepxlKvmp+mA5jWUIlxx6xnCRaB0Y9f9gypxD8fH8g== Received: from DS7PR03CA0234.namprd03.prod.outlook.com (2603:10b6:5:3ba::29) by BN9PR12MB5366.namprd12.prod.outlook.com (2603:10b6:408:103::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 06:59:43 +0000 Received: from DM6NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ba:cafe::69) by DS7PR03CA0234.outlook.office365.com (2603:10b6:5:3ba::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:59:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT055.mail.protection.outlook.com (10.13.173.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:59:42 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:59:40 +0000 From: Xueming Li To: Anatoly Burakov CC: Luca Boccassi , Chenbo Xia , Bruce Richardson , dpdk stable Date: Wed, 10 Nov 2021 14:32:12 +0800 Message-ID: <20211110063216.2744012-249-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 61d0bd85-b356-455a-df70-08d9a417abfb X-MS-TrafficTypeDiagnostic: BN9PR12MB5366: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NwcLNHnLHZwuLxg/tYelRngiJK+4Zn7oOmL5M9Klrg1udNg/Bk0eq0NMZxFhGSPWaNY25HIP9KID80N4TBXAgfTtOngJ2Qi0z+W2QTIpG6bizXzN+LC2d2HV+fSsB7iF5+308njHYEGpshigCsVR3OG6ei5KQttQQLUgthqwUaMTViZHOjxXn44ccX056eCbUWuYbWQqixwKr6ywghin1dUj1gAE56Zy30GA2OAIUx1z5r6uO8WC6xFCfssdPgJMsYUvlFRZno/20uXxT8mwDe8nCgEQEY6UXQoHoRWREHbRAA+3hDoRVzIV9W8VJP2FO4Z8do9zHM/f6/UmOZbiwTWDi7qzkKEsdTeryjjTQaKhtgoD9TRm+L4c/orHt/Zu+pJNB+i4kKgYRZvx8qVOgWWhETBTysiSxkDSVg5YbwJTSm6IfeJTIro5MwJo4uIX+Htj8KfGJkdQPQsTHrb9JrnE6BYrKn18cmUyxQszlAoZMh+1k7OyMWOv4pA7Bcd5+FAy82n/sfxNtN+gZDelQRqbjKeS4942A7wVBzbhpjR2xwjiZjuI4LgnjBpqdRkP4iCGZMHCsdxrxu8H14/ixydPXW9bSAQd9hNJ7IXaF5Hd6UT92sd+6nC0HEu/XeEoDkzyn/yaPbwM60qKI8SwB0rE33+/ewQo7OQq4E9e8AEwv/wzftETgRMppgCFOSZhy18wjGHRppkLyjhcS22GUT0MXJcA6nz+p4zRvG4Yv1Wi+j8O6sFQtoG/6N5IiJbBsY7Sdmd2DKYpfCDxt7AfdRPXMQVclGiC9gd07X7+5EbLmXVJy9EgYkUpaJMaYCtj670pHT34IbFZf+Kpq/SV8g== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(4001150100001)(4326008)(53546011)(8936002)(7636003)(316002)(6916009)(426003)(16526019)(82310400003)(6286002)(86362001)(356005)(5660300002)(26005)(336012)(7696005)(6666004)(186003)(1076003)(36860700001)(966005)(70206006)(47076005)(36756003)(8676002)(55016002)(54906003)(508600001)(2616005)(70586007)(40140700001)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:59:42.5090 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61d0bd85-b356-455a-df70-08d9a417abfb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5366 Subject: [dpdk-stable] patch 'vfio: set errno on unsupported OS' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/4298385935eef1e27cfcd12d75517a448d176be9 Thanks. Xueming Li --- >From 4298385935eef1e27cfcd12d75517a448d176be9 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Thu, 28 Oct 2021 14:15:19 +0000 Subject: [PATCH] vfio: set errno on unsupported OS Cc: Xueming Li [ upstream commit 4fd15c6af0d4e065227a27cda9ec0ca1a563dc67 ] Currently, when code is running on FreeBSD or Windows, there is no way to distinguish between a geniune error and a "VFIO is unsupported" error. Fix the dummy implementations to also set the rte_errno flag. Fixes: 279b581c897d ("vfio: expose functions") Fixes: c564a2a20093 ("vfio: expose clear group function for internal usages") Fixes: 964b2f3bfb07 ("vfio: export some internal functions") Fixes: ea2dc1066870 ("vfio: add multi container support") Signed-off-by: Anatoly Burakov Acked-by: Chenbo Xia Acked-by: Bruce Richardson --- lib/librte_eal/freebsd/eal.c | 13 +++++++++++++ lib/librte_eal/windows/eal.c | 2 ++ 2 files changed, 15 insertions(+) diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c index 053ae65365..6f9f12911e 100644 --- a/lib/librte_eal/freebsd/eal.c +++ b/lib/librte_eal/freebsd/eal.c @@ -1014,6 +1014,7 @@ int rte_vfio_setup_device(__rte_unused const char *sysfs_base, __rte_unused int *vfio_dev_fd, __rte_unused struct vfio_device_info *device_info) { + rte_errno = ENOTSUP; return -1; } @@ -1021,11 +1022,13 @@ int rte_vfio_release_device(__rte_unused const char *sysfs_base, __rte_unused const char *dev_addr, __rte_unused int fd) { + rte_errno = ENOTSUP; return -1; } int rte_vfio_enable(__rte_unused const char *modname) { + rte_errno = ENOTSUP; return -1; } @@ -1041,6 +1044,7 @@ int rte_vfio_noiommu_is_enabled(void) int rte_vfio_clear_group(__rte_unused int vfio_group_fd) { + rte_errno = ENOTSUP; return -1; } @@ -1049,30 +1053,35 @@ rte_vfio_get_group_num(__rte_unused const char *sysfs_base, __rte_unused const char *dev_addr, __rte_unused int *iommu_group_num) { + rte_errno = ENOTSUP; return -1; } int rte_vfio_get_container_fd(void) { + rte_errno = ENOTSUP; return -1; } int rte_vfio_get_group_fd(__rte_unused int iommu_group_num) { + rte_errno = ENOTSUP; return -1; } int rte_vfio_container_create(void) { + rte_errno = ENOTSUP; return -1; } int rte_vfio_container_destroy(__rte_unused int container_fd) { + rte_errno = ENOTSUP; return -1; } @@ -1080,6 +1089,7 @@ int rte_vfio_container_group_bind(__rte_unused int container_fd, __rte_unused int iommu_group_num) { + rte_errno = ENOTSUP; return -1; } @@ -1087,6 +1097,7 @@ int rte_vfio_container_group_unbind(__rte_unused int container_fd, __rte_unused int iommu_group_num) { + rte_errno = ENOTSUP; return -1; } @@ -1096,6 +1107,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd, __rte_unused uint64_t iova, __rte_unused uint64_t len) { + rte_errno = ENOTSUP; return -1; } @@ -1105,5 +1117,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd, __rte_unused uint64_t iova, __rte_unused uint64_t len) { + rte_errno = ENOTSUP; return -1; } diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c index abe4c4038d..892c69356d 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -446,6 +446,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd, __rte_unused uint64_t iova, __rte_unused uint64_t len) { + rte_errno = ENOTSUP; return -1; } @@ -455,5 +456,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd, __rte_unused uint64_t iova, __rte_unused uint64_t len) { + rte_errno = ENOTSUP; return -1; } -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:12.800067594 +0800 +++ 0248-vfio-set-errno-on-unsupported-OS.patch 2021-11-10 14:17:02.090744291 +0800 @@ -1 +1 @@ -From 4fd15c6af0d4e065227a27cda9ec0ca1a563dc67 Mon Sep 17 00:00:00 2001 +From 4298385935eef1e27cfcd12d75517a448d176be9 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 4fd15c6af0d4e065227a27cda9ec0ca1a563dc67 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -20,2 +22,2 @@ - lib/eal/freebsd/eal.c | 13 +++++++++++++ - lib/eal/windows/eal.c | 2 ++ + lib/librte_eal/freebsd/eal.c | 13 +++++++++++++ + lib/librte_eal/windows/eal.c | 2 ++ @@ -24,5 +26,5 @@ -diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c -index 5cea368efe..a1cd2462db 100644 ---- a/lib/eal/freebsd/eal.c -+++ b/lib/eal/freebsd/eal.c -@@ -1018,6 +1018,7 @@ int rte_vfio_setup_device(__rte_unused const char *sysfs_base, +diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c +index 053ae65365..6f9f12911e 100644 +--- a/lib/librte_eal/freebsd/eal.c ++++ b/lib/librte_eal/freebsd/eal.c +@@ -1014,6 +1014,7 @@ int rte_vfio_setup_device(__rte_unused const char *sysfs_base, @@ -36 +38 @@ -@@ -1025,11 +1026,13 @@ int rte_vfio_release_device(__rte_unused const char *sysfs_base, +@@ -1021,11 +1022,13 @@ int rte_vfio_release_device(__rte_unused const char *sysfs_base, @@ -50 +52 @@ -@@ -1045,6 +1048,7 @@ int rte_vfio_noiommu_is_enabled(void) +@@ -1041,6 +1044,7 @@ int rte_vfio_noiommu_is_enabled(void) @@ -58 +60 @@ -@@ -1053,30 +1057,35 @@ rte_vfio_get_group_num(__rte_unused const char *sysfs_base, +@@ -1049,30 +1053,35 @@ rte_vfio_get_group_num(__rte_unused const char *sysfs_base, @@ -94 +96 @@ -@@ -1084,6 +1093,7 @@ int +@@ -1080,6 +1089,7 @@ int @@ -102 +104 @@ -@@ -1091,6 +1101,7 @@ int +@@ -1087,6 +1097,7 @@ int @@ -110 +112 @@ -@@ -1100,6 +1111,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd, +@@ -1096,6 +1107,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd, @@ -118 +120 @@ -@@ -1109,5 +1121,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd, +@@ -1105,5 +1117,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd, @@ -125,5 +127,5 @@ -diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c -index f7ce1b6671..67db7f099a 100644 ---- a/lib/eal/windows/eal.c -+++ b/lib/eal/windows/eal.c -@@ -481,6 +481,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd, +diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c +index abe4c4038d..892c69356d 100644 +--- a/lib/librte_eal/windows/eal.c ++++ b/lib/librte_eal/windows/eal.c +@@ -446,6 +446,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd, @@ -137 +139 @@ -@@ -490,6 +491,7 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd, +@@ -455,5 +456,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd, @@ -144 +145,0 @@ -