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 CF36F48B4D; Wed, 19 Nov 2025 12:02:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 926F140669; Wed, 19 Nov 2025 12:02:17 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by mails.dpdk.org (Postfix) with ESMTP id A1B524065A for ; Wed, 19 Nov 2025 12:02:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763550135; x=1795086135; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=j9SgHJiGkDd2VBttVtw+GIPkAxZmalcaBq2l12Hht9k=; b=jtfcbnDzp99R1+dW418b3cX9lJds/vHRe/9EWuCCI17Mda0D2YlhMc7j XqNwkpcGWI1kat6elAbH/qjB/9AZ3PROad5nZ8KwWnvJV7oh2TvUH98c3 zPNEEZ3WQrHnUu7Io5npjQhQhoce9gxHY26+hF0k0R8WpZ6caJKkXvAyC c/wozbtBsOueAXBF6iwhzdhtmZTO9L3dHkLpRB+rBobNtEHawL/gk8VUP eATVEnZQ9kUYsWcYm4AVOHQsNk6eeGzXx/B2v9rpsi9+YrNumS5CWhoLs /ZYEfTnpuGkRHLs2qfNAg3zI3ZjSdkEvxEE8ejfrD7TAg0hRHGa7GW1/K g==; X-CSE-ConnectionGUID: O+eZERjmSPSpysLHAQLPYg== X-CSE-MsgGUID: D+NGiMRKSRKQH2b0pOnVnA== X-IronPort-AV: E=McAfee;i="6800,10657,11617"; a="76942094" X-IronPort-AV: E=Sophos;i="6.19,315,1754982000"; d="scan'208";a="76942094" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2025 03:02:14 -0800 X-CSE-ConnectionGUID: ev6+qb99SpGZ0Ii80BGKlA== X-CSE-MsgGUID: KjxWtZjZTdi4jEgc92M2YA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,315,1754982000"; d="scan'208";a="214409204" Received: from silpixa00401119.ir.intel.com ([10.20.224.206]) by fmviesa002.fm.intel.com with ESMTP; 19 Nov 2025 03:02:14 -0800 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v4 06/17] vdpa/ifc: use container device assignment API Date: Wed, 19 Nov 2025 11:01:49 +0000 Message-ID: <37e03bf1ba5f2ec184cc395cb011feab799fbf8d.1763549736.git.anatoly.burakov@intel.com> 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 The IFC vDPA driver uses VFIO group bind/unbind functionality for container device assignment purposes. Use the new container device assignment API instead to provide clearer semantics. Signed-off-by: Anatoly Burakov --- drivers/vdpa/ifc/ifcvf_vdpa.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index f319d455ba..6f1c050787 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -174,28 +174,19 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal) { struct rte_pci_device *dev = internal->pdev; char devname[RTE_DEV_NAME_MAX_LEN] = {0}; - int iommu_group_num; - int i, ret; + int i; internal->vfio_dev_fd = -1; - internal->vfio_group_fd = -1; internal->vfio_container_fd = -1; rte_pci_device_name(&dev->addr, devname, RTE_DEV_NAME_MAX_LEN); - ret = rte_vfio_get_group_num(rte_pci_get_sysfs_path(), devname, - &iommu_group_num); - if (ret <= 0) { - DRV_LOG(ERR, "%s failed to get IOMMU group", devname); - return -1; - } internal->vfio_container_fd = rte_vfio_container_create(); if (internal->vfio_container_fd < 0) return -1; - internal->vfio_group_fd = rte_vfio_container_group_bind( - internal->vfio_container_fd, iommu_group_num); - if (internal->vfio_group_fd < 0) + if (rte_vfio_container_assign_device(internal->vfio_container_fd, + rte_pci_get_sysfs_path(), devname) < 0) goto err; if (rte_pci_map_device(dev)) -- 2.47.3