From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8061C61DBE for ; Tue, 25 Aug 2026 13:22:33 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4526240A7D; Tue, 25 Aug 2026 15:21:42 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by mails.dpdk.org (Postfix) with ESMTP id 8206940A6C for ; Tue, 25 Aug 2026 15:21:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1787664098; x=1819200098; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=KIQbyDQ17D/FSA1gKye3JfRZh2hJpT+V8+LJwVDVl3w=; b=ERk5hXmfCBIYbq925tuxwi3s8BV/MCd4+KA73v8M6I7aWdB9kFmvOWne prqtsrM6msh0wFW2+LzhUCJVpknPWRQZHQNyVkORFFGEHhmR77e0BupEk EItW3aswxgPoV5ew6Ex6w0hwfr2/ambjKqOsybclmH4khToGOieY56uk5 UGKFsM6NY9Qlqgo4bT+58Q3N179m5/SDE6Xsud2BSO7DF/hAUhInP7aqA etdqBaw5fkjAvnLrL4UGZP0ll/MWjYhuZVZMCLR41zR3yX4mertXlEiAz TnygT+2NaV8Q3ooCfi4iJC0q6yiRl1hB7pht+TG2wT4kwL/qczEUCA9Sc w==; X-CSE-ConnectionGUID: e1HQ2kT7QmOK2J084A5ORQ== X-CSE-MsgGUID: AK8L+3/UQlStou88c87k+A== X-IronPort-AV: E=McAfee;i="6800,10657,11885"; a="88332706" X-IronPort-AV: E=Sophos;i="6.25,242,1779174000"; d="scan'208";a="88332706" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2026 06:21:38 -0700 X-CSE-ConnectionGUID: GkLmit8BQzWmOkOkPIURQw== X-CSE-MsgGUID: JnsCKt/BS3CNS9OiL4MbQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,242,1779174000"; d="scan'208";a="264660889" Received: from silpixa00401119.ir.intel.com ([10.20.224.206]) by fmviesa008.fm.intel.com with ESMTP; 25 Aug 2026 06:21:37 -0700 From: Anatoly Burakov To: dev@dpdk.org, Chaoyong He Subject: [PATCH v12 09/20] vdpa/nfp: use container device assignment API Date: Tue, 25 Aug 2026 14:21:06 +0100 Message-ID: <6152dcd0715b911dd06b238df1314d282b3f97c8.1787663787.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.52.0 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 NFP 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. Since group API is no longer used after these changes, remove its implementation. Signed-off-by: Anatoly Burakov --- drivers/vdpa/nfp/nfp_vdpa.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/drivers/vdpa/nfp/nfp_vdpa.c b/drivers/vdpa/nfp/nfp_vdpa.c index 4c0ab3ff30..778ab2b8e7 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; @@ -120,33 +118,26 @@ nfp_vdpa_vfio_setup(struct nfp_vdpa_dev *device) struct rte_pci_device *pci_dev = device->pci_dev; rte_pci_device_name(&pci_dev->addr, dev_name, RTE_DEV_NAME_MAX_LEN); - ret = rte_vfio_get_group_num(rte_pci_get_sysfs_path(), dev_name, - &device->iommu_group); - if (ret <= 0) - return -1; device->vfio_container_fd = rte_vfio_container_create(); if (device->vfio_container_fd < 0) return -1; - device->vfio_group_fd = rte_vfio_container_group_bind( - device->vfio_container_fd, device->iommu_group); - if (device->vfio_group_fd < 0) + ret = rte_vfio_container_assign_device(device->vfio_container_fd, + rte_pci_get_sysfs_path(), dev_name); + if (ret < 0) goto container_destroy; - DRV_VDPA_LOG(DEBUG, "The container_fd=%d, group_fd=%d.", - device->vfio_container_fd, device->vfio_group_fd); + DRV_VDPA_LOG(DEBUG, "container_fd=%d", device->vfio_container_fd); ret = rte_pci_map_device(pci_dev); if (ret != 0) - goto group_unbind; + goto container_destroy; device->vfio_dev_fd = rte_intr_dev_fd_get(pci_dev->intr_handle); return 0; -group_unbind: - rte_vfio_container_group_unbind(device->vfio_container_fd, device->iommu_group); container_destroy: rte_vfio_container_destroy(device->vfio_container_fd); @@ -157,7 +148,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); } @@ -1023,22 +1013,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) { @@ -1190,7 +1164,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, }; -- 2.52.0