<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/vdpa/mlx5, branch v6.7</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.7</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-12-01T14:52:03+00:00</updated>
<entry>
<title>vdpa/mlx5: preserve CVQ vringh index</title>
<updated>2023-12-01T14:52:03+00:00</updated>
<author>
<name>Steve Sistare</name>
<email>steven.sistare@oracle.com</email>
</author>
<published>2023-11-03T12:26:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=480b3e73720f6b5d76bef2387b1f9d19ed67573b'/>
<id>urn:sha1:480b3e73720f6b5d76bef2387b1f9d19ed67573b</id>
<content type='text'>
mlx5_vdpa does not preserve userland's view of vring base for the control
queue in the following sequence:

ioctl VHOST_SET_VRING_BASE
ioctl VHOST_VDPA_SET_STATUS VIRTIO_CONFIG_S_DRIVER_OK
  mlx5_vdpa_set_status()
    setup_cvq_vring()
      vringh_init_iotlb()
        vringh_init_kern()
          vrh-&gt;last_avail_idx = 0;
ioctl VHOST_GET_VRING_BASE

To fix, restore the value of cvq-&gt;vring.last_avail_idx after calling
vringh_init_iotlb.

Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting")

Signed-off-by: Steve Sistare &lt;steven.sistare@oracle.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Message-Id: &lt;1699014387-194368-1-git-send-email-steven.sistare@oracle.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: implement .reset_map driver op</title>
<updated>2023-11-01T13:20:00+00:00</updated>
<author>
<name>Si-Wei Liu</name>
<email>si-wei.liu@oracle.com</email>
</author>
<published>2023-10-21T09:25:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2eacf4b5e3ebe771f0fca0c8913c5a10a1953b72'/>
<id>urn:sha1:2eacf4b5e3ebe771f0fca0c8913c5a10a1953b72</id>
<content type='text'>
Since commit 6f5312f80183 ("vdpa/mlx5: Add support for running with
virtio_vdpa"), mlx5_vdpa starts with preallocate 1:1 DMA MR at device
creation time. This 1:1 DMA MR will be implicitly destroyed while the
first .set_map call is invoked, in which case callers like vhost-vdpa
will start to set up custom mappings. When the .reset callback is
invoked, the custom mappings will be cleared and the 1:1 DMA MR will be
re-created.

In order to reduce excessive memory mapping cost in live migration, it
is desirable to decouple the vhost-vdpa IOTLB abstraction from the
virtio device life cycle, i.e. mappings can be kept around intact across
virtio device reset. Leverage the .reset_map callback, which is meant to
destroy the regular MR (including cvq mapping) on the given ASID and
recreate the initial DMA mapping. That way, the device .reset op runs
free from having to maintain and clean up memory mappings by itself.

Additionally, implement .compat_reset to cater for older userspace,
which may wish to see mapping to be cleared during reset.

Co-developed-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Signed-off-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Message-Id: &lt;1697880319-4937-7-git-send-email-si-wei.liu@oracle.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
</content>
</entry>
<entry>
<title>mlx5_vdpa: offer VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK</title>
<updated>2023-11-01T13:19:58+00:00</updated>
<author>
<name>Eugenio Pérez</name>
<email>eperezma@redhat.com</email>
</author>
<published>2023-07-03T14:25:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c695964474f3a80e1b7503e7cb15dd7d7f7245a1'/>
<id>urn:sha1:c695964474f3a80e1b7503e7cb15dd7d7f7245a1</id>
<content type='text'>
Offer this backend feature as mlx5 is compatible with it. It allows it
to do live migration with CVQ, dynamically switching between passthrough
and shadow virtqueue.

Signed-off-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Message-Id: &lt;20230703142514.363256-1-eperezma@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Update cvq iotlb mapping on ASID change</title>
<updated>2023-11-01T13:19:57+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-10-18T17:14:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5dc31bd245a4fd7fe2d1fd79b7a2a81c96d6d33c'/>
<id>urn:sha1:5dc31bd245a4fd7fe2d1fd79b7a2a81c96d6d33c</id>
<content type='text'>
For the following sequence:
- cvq group is in ASID 0
- .set_map(1, cvq_iotlb)
- .set_group_asid(cvq_group, 1)

... the cvq mapping from ASID 0 will be used. This is not always correct
behaviour.

This patch adds support for the above mentioned flow by saving the iotlb
on each .set_map and updating the cvq iotlb with it on a cvq group change.

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Message-Id: &lt;20231018171456.1624030-18-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Make iotlb helper functions more generic</title>
<updated>2023-11-01T13:19:57+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-10-18T17:14:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cf6e024cf7683551ae218ce9af56b82e68a0ef06'/>
<id>urn:sha1:cf6e024cf7683551ae218ce9af56b82e68a0ef06</id>
<content type='text'>
They will be used in a follow-up patch.

For dup_iotlb, avoid the src == dst case. This is an error.

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Message-Id: &lt;20231018171456.1624030-17-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Enable hw support for vq descriptor mapping</title>
<updated>2023-11-01T13:19:57+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-10-18T17:14:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=03dd63c8fae4599439a30e0dde91061789260dbe'/>
<id>urn:sha1:03dd63c8fae4599439a30e0dde91061789260dbe</id>
<content type='text'>
Vq descriptor mappings are supported in hardware by filling in an
additional mkey which contains the descriptor mappings to the hw vq.

A previous patch in this series added support for hw mkey (mr) creation
for ASID 1.

This patch fills in both the vq data and vq descriptor mkeys based on
group ASID mapping.

The feature is signaled to the vdpa core through the presence of the
.get_vq_desc_group op.

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Message-Id: &lt;20231018171456.1624030-16-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Introduce mr for vq descriptor</title>
<updated>2023-11-01T13:19:57+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-10-18T17:14:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=55229eab8cd767a5811a4fb112b3ca9db6eaa9d2'/>
<id>urn:sha1:55229eab8cd767a5811a4fb112b3ca9db6eaa9d2</id>
<content type='text'>
Introduce the vq descriptor group and mr per ASID. Until now
.set_map on ASID 1 was only updating the cvq iotlb. From now on it also
creates a mkey for it. The current patch doesn't use it but follow-up
patches will add hardware support for mapping the vq descriptors.

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Message-Id: &lt;20231018171456.1624030-15-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Improve mr update flow</title>
<updated>2023-11-01T13:19:57+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-10-18T17:14:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=625e4b59a923d2bb30759b88ecca34d12735fa7e'/>
<id>urn:sha1:625e4b59a923d2bb30759b88ecca34d12735fa7e</id>
<content type='text'>
The current flow for updating an mr works directly on mvdev-&gt;mr which
makes it cumbersome to handle multiple new mr structs.

This patch makes the flow more straightforward by having
mlx5_vdpa_create_mr return a new mr which will update the old mr (if
any). The old mr will be deleted and unlinked from mvdev. For the case
when the iotlb is empty (not NULL), the old mr will be cleared.

This change paves the way for adding mrs for different ASIDs.

The initialized bool is no longer needed as mr is now a pointer in the
mlx5_vdpa_dev struct which will be NULL when not initialized.

Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Message-Id: &lt;20231018171456.1624030-14-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Move mr mutex out of mr struct</title>
<updated>2023-11-01T13:19:56+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-10-18T17:14:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=186e25387ed6f1403a1b464e31f5381ba4424681'/>
<id>urn:sha1:186e25387ed6f1403a1b464e31f5381ba4424681</id>
<content type='text'>
The mutex is named like it is supposed to protect only the mkey but in
reality it is a global lock for all mr resources.

Shift the mutex to it's rightful location (struct mlx5_vdpa_dev) and
give it a more appropriate name.

Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Message-Id: &lt;20231018171456.1624030-13-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Allow creation/deletion of any given mr struct</title>
<updated>2023-11-01T13:19:56+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-10-18T17:14:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1b3ce9576f169ce2122ab98b39bf2357d377ee5b'/>
<id>urn:sha1:1b3ce9576f169ce2122ab98b39bf2357d377ee5b</id>
<content type='text'>
This patch adapts the mr creation/deletion code to be able to work with
any given mr struct pointer. All the APIs are adapted to take an extra
parameter for the mr.

mlx5_vdpa_create/delete_mr doesn't need a ASID parameter anymore. The
check is done in the caller instead (mlx5_set_map).

This change is needed for a followup patch which will introduce an
additional mr for the vq descriptor data.

Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Message-Id: &lt;20231018171456.1624030-12-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
</content>
</entry>
</feed>
