Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vdpa/virtio: limit max VFIO group number in container #70

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

Ch3n60x
Copy link
Collaborator

@Ch3n60x Ch3n60x commented Apr 1, 2024

DPDK EAL layer has limited the maximum number of VFIO group in one VFIO container to 64. So error will be returned if we try to add more than 64 VFs in the container. Although VFIO container/group bind API will check this, it will result in 120 times retry in the driver. This commit limit the max VFIO group number before group bind to avoid the retry time.

RM: 3845142

DPDK EAL layer has limited the maximum number of VFIO group in one VFIO
container to 64. So error will be returned if we try to add more than 64
VFs in the container. Although VFIO container/group bind API will check
this, it will result in 120 times retry in the driver. This commit limit
the max VFIO group number before group bind to avoid the retry time.

RM: 3845142

Signed-off-by: Chenbo Xia <chenbox@nvidia.com>
@@ -2106,6 +2106,12 @@ virtio_vdpa_dev_probe(struct rte_pci_driver *pci_drv __rte_unused,
pthread_mutex_init(&iommu_domain->domain_lock, NULL);
}

if (iommu_domain->container_ref_cnt == RTE_MAX_VFIO_GROUPS) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if vm_uuid is NULL, we will never reach this limit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. for VF that has null vm_uuid, it will have its own iommu domain and no other VFs can find the domain and use. So the container_ref_cnt will be 0 or 1.

@kailiangz1 kailiangz1 merged commit 3384407 into Mellanox:main Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants