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

mlx5: Extend vfio to support async events and CQ interrupt mode #1146

Merged
merged 5 commits into from
Mar 10, 2022

Conversation

yishaih
Copy link
Member

@yishaih yishaih commented Mar 3, 2022

This series in the mlx5 vfio driver area enables a DEVX based application the below new functionality.

  • Register and get asynchronous events (e.g. port up/down) once occurred.
  • Work with a CQ in an interrupt mode instead of polling, this mode may reduce power usage in the system when it’s needed.

To let that work we introduced the below new DEVX APIs:

  • mlx5dv_devx_alloc_msi_vector / mlx5dv_devx_free_msi_vector - to allocate/free msi vector.
  • mlx5dv_devx_create_eq / mlx5dv_devx_destroy_eq - to create/destroy EQ objects.

Detailed man pages were added to describe the expected usage.

With the above functionally in place, a vfio application which uses the DEVX interface has the ability to achieve the above goals.

A pyverbs test which uses the new APIs was added to demonstrate a use case of capturing a port change event.

Yishai Hadas and others added 5 commits March 10, 2022 10:34
VFIO_TYPE1_IOMMU is obsolete, move to use VFIO_TYPE1v2_IOMMU instead.

No functional effect is expected.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Introduce mlx5dv_devx_alloc_msi_vector() and
mlx5dv_devx_free_msi_vector() to allocate and free msi vectors,
respectively.

The allocated msi_vector object is needed when creating an EQ.

Signed-off-by: Mark Zhang <markzhang@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Introduce mlx5dv_devx_create_eq() and mlx5dv_devx_destroy_eq() to create
and destroy EQ objects, respectively.

Signed-off-by: Mark Zhang <markzhang@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Add support to create a DevX EQ and msi_vectors.

Signed-off-by: Neta Ostrovsky <netao@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Adds a test that creates a DevX EQ and msi_vector. Then changes the port
state and catches the event.

Signed-off-by: Neta Ostrovsky <netao@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
@yishaih yishaih merged commit ae6eb0a into linux-rdma:master Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants