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 AEF3AA0A0A; Thu, 13 May 2021 20:40:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B7024067E; Thu, 13 May 2021 20:40:49 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2050.outbound.protection.outlook.com [40.107.243.50]) by mails.dpdk.org (Postfix) with ESMTP id D1BA24003F; Thu, 13 May 2021 20:40:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HOdznf2i1pnphmz7MP4CKHrIMTGvbFxaYH2IpKgYDhhFBExTCi8lV2P+Qhgn325ppeNHzpOAy/7ZS5m8qucZrCrLZZx3/z/aYV2CQNZ2uAsfT0H8ooVjhq4UYLI/WI+K7Unan1pv5LerxrfD6kkSuzTlYShwXFr33/KNQP4QNPY+Wk5XYENhNo9pFOiCjzlkdTK+WCJaY4/22cD4U6ZFpnbHbDnXog8AWQR1+R+w+APkL/ZToJC6nu3vwzF3QPRhe3xaBpY7Zj8tKfrKOUrEEQX6OSqJTQJ0mLzm8G1Zo7SZwNUtBHWLrOHezvjVxDsCJ3x0nlttN0Fs+gVBZzw9NQ== 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-SenderADCheck; bh=XZ9OvTgEYw9DuVvbezyXbRyQ3siKZ8/hWdDyob0PcQU=; b=VtWYZ7PtYr86tO1pCcj9gQlSKdBQ+WOL2jHciDjrorBCU5Omt6kECD55dR0ks2CPbuZNJy2vf766Oehk4gT2MFE8b9egOKiYmK7+hr71gwqCf+au+V1ovKR71+738Tl/daRHUdNjSG1prL6KT+7S5mxeneI2Pmp/LZwC5gPy7Y1HpYezL5/Ce06wAjkwF60VlBvhuD5LuVA6ipJQs01M8Y6aK2+PvXOaYenMKZ2cBpzsLVn3GDY6HNO409iVZJegfkaIHJ41yjPgLlH4XOXFBbQWygyKpZzFmKe+kufKzyS4doCQAbwl7+/phune9W59l633CWRWiFYgcNLlGkpTLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=XZ9OvTgEYw9DuVvbezyXbRyQ3siKZ8/hWdDyob0PcQU=; b=lQFHU5Hl2mPeMgqOxnNBXbVu2zkfOdguGn3w7zOixzTKO0CEtdHG50GKqYBRAPTvBrbPUhLnq/dlTb+UJJRLA3g/3CrMCxJ9HO5P/hEOv1fqf57Vno+pMPgDnARKRGiClv3yzVHXHyJxy0SjL1rXwCxLkbIBNKhulUA+9bkqzkiOdK/4TTZyEdsGNuP956pxmb33JxpfEAWJXUlCaP0jQBV1jnONrH+36mqqzDjfe7X3YOkyl/4kWMKWfT9yCIuGuAva0ElkUMQFNcj8zngEOsY9FnDxJrobXrVC3uMbGDDkkSjf3Jl21FEIEydOLTV/mpT/WfROjgMUppWmXMvy2w== Received: from BN6PR14CA0030.namprd14.prod.outlook.com (2603:10b6:404:13f::16) by DM6PR12MB2971.namprd12.prod.outlook.com (2603:10b6:5:118::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 13 May 2021 18:40:46 +0000 Received: from BN8NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:404:13f:cafe::16) by BN6PR14CA0030.outlook.office365.com (2603:10b6:404:13f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Thu, 13 May 2021 18:40:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BN8NAM11FT032.mail.protection.outlook.com (10.13.177.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Thu, 13 May 2021 18:40:46 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 13 May 2021 18:40:44 +0000 From: Matan Azrad To: CC: , , Eli Britstein , Xueming Li Date: Thu, 13 May 2021 21:40:20 +0300 Message-ID: <20210513184020.672589-1-matan@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210513183105.671396-1-matan@nvidia.com> References: <20210513183105.671396-1-matan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] 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: 1cbba6b6-d2fa-4a84-5dee-08d9163e9f57 X-MS-TrafficTypeDiagnostic: DM6PR12MB2971: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bNrIkBTmpGqHVvMYkjkxh8s4wId7JVYi4Rw0jQj8sKcEjBx47ap1WqiOx6/q3kUtY4Jc7/ZfOUoJrK6trBxVOSI7RfxDVLbibpmTj+YNS1RuJIZ5I9ypKQQ4w7Xtc1iJcvMUgl+FkiCsTPlmaeBKHoTT92aXU/IIcoWHejgI0BCbaqdtqv/LuCBJlLitUsX1PzfGLaKUIlrNm3MGo7tKAeRr0ERWgtfLkGNXC+ESc2v33MHTUGhzjSbBA8DM7x7FWHLpdBKZoy8tsjiVAzCCgnvDDedkub4DQRFEnL4T54AG2/rPFO2Qlb8AOsaBjOauaR8M7QpOwXtWtR/RtJ9zzOiKi4+Ptoj+XSwYwzGD56d4S5jrgdiyRdc9UB+w15ciTcafCzsBdTrK+oIiZPvsecwyxWE1hvVVOc9Mu2GLKkEhPY3t55fKLMO3De5hUZ/ppsLH9FOHAdklDhfuL+NtNZ05R/wETUeG6gxbdCS64q1VWf5nCZgaGqrabCn5H15HlndYvFZSeuvX/Wfpoq/QFCTA/nhGaVmm57o3TO2WnDCdKxGl0LKkf9BnREH//yfVwZk/UxMYHRK/FLNbaEzEMJcWbpHtqPcuCNMNAOzrjYQ/2MM0Y6YE7p508SaYK6Q6ribau4XfqSQNek9a0UxIWA== 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)(376002)(136003)(346002)(396003)(39860400002)(36840700001)(46966006)(6286002)(82310400003)(8936002)(107886003)(55016002)(336012)(356005)(6916009)(47076005)(8676002)(7636003)(5660300002)(86362001)(26005)(478600001)(7696005)(70206006)(70586007)(36756003)(6666004)(1076003)(426003)(2906002)(4326008)(83380400001)(2616005)(36906005)(36860700001)(16526019)(316002)(186003)(54906003)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2021 18:40:46.4813 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1cbba6b6-d2fa-4a84-5dee-08d9163e9f57 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: BN8NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2971 Subject: [dpdk-dev] [PATCH v2] vdpa/mlx5: fix device unplug 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 Sender: "dev" The vDPA PCI device unplug process should release all the private device resources and also to unregister the device. The device unregistration was missed what remained the device data invalid in the rte_vhost library. Unregister the device in unplug process via the remove operation. Fixes: 95276abaaf0a ("vdpa/mlx5: introduce Mellanox vDPA driver") Cc: stable@dpdk.org Reported-by: Eli Britstein Signed-off-by: Matan Azrad Tested-by: Eli Britstein Acked-by: Xueming Li --- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 ++ 1 file changed, 2 insertions(+) v2: fix spelling and email format diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index 40db28b6db..e5e03e6582 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c @@ -787,6 +787,8 @@ mlx5_vdpa_pci_remove(struct rte_pci_device *pci_dev) mlx5_glue->dv_free_var(priv->var); priv->var = NULL; } + if (priv->vdev) + rte_vdpa_unregister_device(priv->vdev); mlx5_glue->close_device(priv->ctx); pthread_mutex_destroy(&priv->vq_config_lock); rte_free(priv); -- 2.25.1