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 A76A248B68; Fri, 21 Nov 2025 11:10:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3574740671; Fri, 21 Nov 2025 11:09:29 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by mails.dpdk.org (Postfix) with ESMTP id E4AA040668 for ; Fri, 21 Nov 2025 11:09:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763719766; x=1795255766; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=fcLWURXChtPQcHtsiQ1uKcVEswGzl9srt/zpd/9y044=; b=Dt1IlKoXSXId0BoaHROyFA0D9BX429TWHYo0OJn20eganAgcr/EIMMlk s1A22fE4FU3xCe5dpLFzrRaCb9Nw/SyqLIkhlbR4+KyMVgc7LcCi4H4OB XBDqYyTNDuN1AG7CHxF0oSx1etTqcwqjJaWgeX+2BmIW4iYbIleqTTlmX xxiNhJQ4Cjma4EXhHPVSGuWHpue1+lTajQ4+I69o652tQ8kXA7EPcYXy7 2CZJOD+DM2vX+p6BkRTa+5WAoqAaOQh+9X7vQ9wBJQV6EASrIZKTH2T7q AYoQ+g/ag60RavMPg6cttR9jxoXc+I77eoVw9eHqWFeVZcg4cn1cBYDVO A==; X-CSE-ConnectionGUID: SsxRfFvgTlWo1hCTWOzbxQ== X-CSE-MsgGUID: g8jxmOL8SLyuB5UAmz2cog== X-IronPort-AV: E=McAfee;i="6800,10657,11619"; a="76491004" X-IronPort-AV: E=Sophos;i="6.20,215,1758610800"; d="scan'208";a="76491004" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2025 02:09:25 -0800 X-CSE-ConnectionGUID: 3/6G+TKoQy6kqATY2hRMwg== X-CSE-MsgGUID: Qu+2GiVZQnGfVVuT+RV1rA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,215,1758610800"; d="scan'208";a="196121570" Received: from silpixa00401119.ir.intel.com ([10.20.224.206]) by orviesa004.jf.intel.com with ESMTP; 21 Nov 2025 02:09:24 -0800 From: Anatoly Burakov To: dev@dpdk.org, Maxime Coquelin , Chenbo Xia , Matan Azrad , Viacheslav Ovsiienko , Chaoyong He Subject: [PATCH v6 10/18] vhost: remove group-related API from drivers Date: Fri, 21 Nov 2025 10:08:55 +0000 Message-ID: X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Some vDPA drivers have "get_vfio_group_fd" call in their internal driver API structure, but it is not used for anything beyond device assignment to containers which can now be achieved via other means, so remove this API and all its usages. Signed-off-by: Anatoly Burakov --- doc/guides/prog_guide/vhost_lib.rst | 4 ---- drivers/vdpa/ifc/ifcvf_vdpa.c | 19 ------------------- drivers/vdpa/mlx5/mlx5_vdpa.c | 1 - drivers/vdpa/nfp/nfp_vdpa.c | 20 -------------------- lib/vhost/vdpa_driver.h | 3 --- 5 files changed, 47 deletions(-) diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst index 0c2b4d020a..2f80cf4072 100644 --- a/doc/guides/prog_guide/vhost_lib.rst +++ b/doc/guides/prog_guide/vhost_lib.rst @@ -471,10 +471,6 @@ Finally, a set of device ops is defined for device specific operations: Called to allow the device to response to RARP sending. -* ``get_vfio_group_fd`` - - Called to get the VFIO group fd of the device. - * ``get_vfio_device_fd`` Called to get the VFIO device fd of the device. diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 6f1c050787..63f4172da5 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -58,7 +58,6 @@ struct ifcvf_internal { struct ifcvf_hw hw; int configured; int vfio_container_fd; - int vfio_group_fd; int vfio_dev_fd; rte_thread_t tid; /* thread for notify relay */ rte_thread_t intr_tid; /* thread for config space change interrupt relay */ @@ -1204,22 +1203,6 @@ ifcvf_set_features(int vid) return 0; } -static int -ifcvf_get_vfio_group_fd(int vid) -{ - struct rte_vdpa_device *vdev; - struct internal_list *list; - - vdev = rte_vhost_get_vdpa_device(vid); - list = find_internal_resource_by_vdev(vdev); - if (list == NULL) { - DRV_LOG(ERR, "Invalid vDPA device: %p", vdev); - return -1; - } - - return list->internal->vfio_group_fd; -} - static int ifcvf_get_vfio_device_fd(int vid) { @@ -1465,7 +1448,6 @@ static struct rte_vdpa_dev_ops ifcvf_net_ops = { .set_vring_state = ifcvf_set_vring_state, .set_features = ifcvf_set_features, .migration_done = NULL, - .get_vfio_group_fd = ifcvf_get_vfio_group_fd, .get_vfio_device_fd = ifcvf_get_vfio_device_fd, .get_notify_area = ifcvf_get_notify_area, .get_dev_type = ifcvf_get_device_type, @@ -1596,7 +1578,6 @@ static struct rte_vdpa_dev_ops ifcvf_blk_ops = { .dev_close = ifcvf_dev_close, .set_vring_state = ifcvf_set_vring_state, .migration_done = NULL, - .get_vfio_group_fd = ifcvf_get_vfio_group_fd, .get_vfio_device_fd = ifcvf_get_vfio_device_fd, .get_notify_area = ifcvf_get_notify_area, .get_config = ifcvf_blk_get_config, diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index 11708e2005..1bb5de51b6 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c @@ -523,7 +523,6 @@ static struct rte_vdpa_dev_ops mlx5_vdpa_ops = { .set_vring_state = mlx5_vdpa_set_vring_state, .set_features = mlx5_vdpa_features_set, .migration_done = NULL, - .get_vfio_group_fd = NULL, .get_vfio_device_fd = mlx5_vdpa_get_device_fd, .get_notify_area = mlx5_vdpa_get_notify_area, .get_stats_names = mlx5_vdpa_get_stats_names, diff --git a/drivers/vdpa/nfp/nfp_vdpa.c b/drivers/vdpa/nfp/nfp_vdpa.c index 4885fa5cbc..efd7ee7d95 100644 --- a/drivers/vdpa/nfp/nfp_vdpa.c +++ b/drivers/vdpa/nfp/nfp_vdpa.c @@ -36,9 +36,7 @@ struct nfp_vdpa_dev { struct nfp_vdpa_hw hw; int vfio_container_fd; - int vfio_group_fd; int vfio_dev_fd; - int iommu_group; rte_thread_t tid; /**< Thread for notify relay */ int epoll_fd; @@ -152,7 +150,6 @@ static void nfp_vdpa_vfio_teardown(struct nfp_vdpa_dev *device) { rte_pci_unmap_device(device->pci_dev); - rte_vfio_container_group_unbind(device->vfio_container_fd, device->iommu_group); rte_vfio_container_destroy(device->vfio_container_fd); } @@ -1018,22 +1015,6 @@ nfp_vdpa_dev_close(int vid) return 0; } -static int -nfp_vdpa_get_vfio_group_fd(int vid) -{ - struct rte_vdpa_device *vdev; - struct nfp_vdpa_dev_node *node; - - vdev = rte_vhost_get_vdpa_device(vid); - node = nfp_vdpa_find_node_by_vdev(vdev); - if (node == NULL) { - DRV_VDPA_LOG(ERR, "Invalid vDPA device: %p.", vdev); - return -ENODEV; - } - - return node->device->vfio_group_fd; -} - static int nfp_vdpa_get_vfio_device_fd(int vid) { @@ -1185,7 +1166,6 @@ struct rte_vdpa_dev_ops nfp_vdpa_ops = { .dev_close = nfp_vdpa_dev_close, .set_vring_state = nfp_vdpa_set_vring_state, .set_features = nfp_vdpa_set_features, - .get_vfio_group_fd = nfp_vdpa_get_vfio_group_fd, .get_vfio_device_fd = nfp_vdpa_get_vfio_device_fd, .get_notify_area = nfp_vdpa_get_notify_area, }; diff --git a/lib/vhost/vdpa_driver.h b/lib/vhost/vdpa_driver.h index 42392a0d14..c7b9be09fb 100644 --- a/lib/vhost/vdpa_driver.h +++ b/lib/vhost/vdpa_driver.h @@ -50,9 +50,6 @@ struct rte_vdpa_dev_ops { /** Destination operations when migration done */ int (*migration_done)(int vid); - /** Get the vfio group fd */ - int (*get_vfio_group_fd)(int vid); - /** Get the vfio device fd */ int (*get_vfio_device_fd)(int vid); -- 2.47.3