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 068D9C61DBE for ; Tue, 25 Aug 2026 13:22:28 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5705040A79; Tue, 25 Aug 2026 15:21:40 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by mails.dpdk.org (Postfix) with ESMTP id 5DBCD4069F for ; Tue, 25 Aug 2026 15:21:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1787664097; x=1819200097; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=YsOlD6wp5Twx4xFRyZYCF9OyyMg1wuIFynM/6WlYoNQ=; b=Xut14RemGNob/M2Bpm7wS8soClWxvUcbYgWJCsqcyDugsFKyM8NHonIS VS+heOW4AhBUh4HnhUu027xoPX9fZEZ70lROZPHvMJ1d6HnzvmcokonvA lymS5/EhcDfY0rMPOvzQdCoO+sys1QUeeW/wCa6lm3vK6R5fAZWDow+KB 72h1CUPJ4z2HC8VYjAuBZO7WUMznpH8XvbV5MmV8h91EggoJV7BNPr2e4 8keSyJDAUNElT1xGOQgiVTodEZJIT0trL/x5LGP/hOzw6v41v2zGafBad FREXx1AWU4YFO7jwBeWzZmQ10oHjXcDzrdBZxJEwPlM0RwJ9Z+ftz/k6v Q==; X-CSE-ConnectionGUID: dHSKYlZKQfuuljVQabkSJg== X-CSE-MsgGUID: zwiMpwrnQqOWQnWMRSTbfw== X-IronPort-AV: E=McAfee;i="6800,10657,11885"; a="88332704" X-IronPort-AV: E=Sophos;i="6.25,242,1779174000"; d="scan'208";a="88332704" 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:37 -0700 X-CSE-ConnectionGUID: 1ehY1jAETt2fA5Z0IoQTtQ== X-CSE-MsgGUID: kVp45FVdSOS/T9/TZnXOGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,242,1779174000"; d="scan'208";a="264660886" Received: from silpixa00401119.ir.intel.com ([10.20.224.206]) by fmviesa008.fm.intel.com with ESMTP; 25 Aug 2026 06:21:36 -0700 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v12 08/20] vdpa/ifc: use container device assignment API Date: Tue, 25 Aug 2026 14:21:05 +0100 Message-ID: <199897165b77c92a45a5cfde3dc5d47e6b23883d.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 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. Since group API is no longer used after these changes, remove its implementation. Signed-off-by: Anatoly Burakov --- drivers/vdpa/ifc/ifcvf_vdpa.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index f319d455ba..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 */ @@ -174,28 +173,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)) @@ -1213,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) { @@ -1474,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, @@ -1605,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, -- 2.52.0