<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/vdpa/mlx5, branch v6.6.148</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.148</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.148'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-06-04T12:42:05+00:00</updated>
<entry>
<title>vdpa/mlx5: Fix mlx5_vdpa_get_config() endianness on big-endian machines</title>
<updated>2025-06-04T12:42:05+00:00</updated>
<author>
<name>Konstantin Shkolnyy</name>
<email>kshk@linux.ibm.com</email>
</author>
<published>2025-02-04T17:31:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=48fd80f7d7b48c37bb310b0f5beacf7c025206d4'/>
<id>urn:sha1:48fd80f7d7b48c37bb310b0f5beacf7c025206d4</id>
<content type='text'>
[ Upstream commit 439252e167ac45a5d46f573aac1da7d8f3e051ad ]

mlx5_vdpa_dev_add() doesn’t initialize mvdev-&gt;actual_features. It’s
initialized later by mlx5_vdpa_set_driver_features(). However,
mlx5_vdpa_get_config() depends on the VIRTIO_F_VERSION_1 flag in
actual_features, to return data with correct endianness. When it’s called
before mlx5_vdpa_set_driver_features(), the data are incorrectly returned
as big-endian on big-endian machines, while QEMU then interprets them as
little-endian.

The fix is to initialize this VIRTIO_F_VERSION_1 as early as possible,
especially considering that mlx5_vdpa_dev_add() insists on this flag to
always be set anyway.

Signed-off-by: Konstantin Shkolnyy &lt;kshk@linux.ibm.com&gt;
Message-Id: &lt;20250204173127.166673-1-kshk@linux.ibm.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Fix oversized null mkey longer than 32bit</title>
<updated>2025-04-25T08:45:27+00:00</updated>
<author>
<name>Si-Wei Liu</name>
<email>si-wei.liu@oracle.com</email>
</author>
<published>2025-02-20T19:37:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a5434db74bf2598094f6f1b4f5787c347f9da069'/>
<id>urn:sha1:a5434db74bf2598094f6f1b4f5787c347f9da069</id>
<content type='text'>
commit a6097e0a54a5c24f8d577ffecbc35289ae281c2e upstream.

create_user_mr() has correct code to count the number of null keys
used to fill in a hole for the memory map. However, fill_indir()
does not follow the same to cap the range up to the 1GB limit
correspondingly. Fill in more null keys for the gaps in between,
so that null keys are correctly populated.

Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code")
Cc: stable@vger.kernel.org
Reported-by: Cong Meng &lt;cong.meng@oracle.com&gt;
Signed-off-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Message-Id: &lt;20250220193732.521462-2-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Fix suboptimal range on iotlb iteration</title>
<updated>2024-12-09T09:32:30+00:00</updated>
<author>
<name>Si-Wei Liu</name>
<email>si-wei.liu@oracle.com</email>
</author>
<published>2024-10-21T13:40:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6c5ddc2b68f2500e957e77af87db96cd2667e247'/>
<id>urn:sha1:6c5ddc2b68f2500e957e77af87db96cd2667e247</id>
<content type='text'>
[ Upstream commit 35025963326e44d8bced3eecd42d2f040f4f0024 ]

The starting iova address to iterate iotlb map entry within a range
was set to an irrelevant value when passing to the itree_next()
iterator, although luckily it doesn't affect the outcome of finding
out the granule of the smallest iotlb map size. Fix the code to make
it consistent with the following for-loop.

Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code")
Signed-off-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Message-Id: &lt;20241021134040.975221-3-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Fix PA offset with unaligned starting iotlb map</title>
<updated>2024-11-22T14:38:33+00:00</updated>
<author>
<name>Si-Wei Liu</name>
<email>si-wei.liu@oracle.com</email>
</author>
<published>2024-10-21T13:40:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=15c49f91cfc80f54b975e7bc69a57dd54e9d4257'/>
<id>urn:sha1:15c49f91cfc80f54b975e7bc69a57dd54e9d4257</id>
<content type='text'>
commit 29ce8b8a4fa74e841342c8b8f8941848a3c6f29f upstream.

When calculating the physical address range based on the iotlb and mr
[start,end) ranges, the offset of mr-&gt;start relative to map-&gt;start
is not taken into account. This leads to some incorrect and duplicate
mappings.

For the case when mr-&gt;start &lt; map-&gt;start the code is already correct:
the range in [mr-&gt;start, map-&gt;start) was handled by a different
iteration.

Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code")
Cc: stable@vger.kernel.org
Signed-off-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Message-Id: &lt;20241021134040.975221-2-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Allow CVQ size changes</title>
<updated>2024-03-26T22:20:10+00:00</updated>
<author>
<name>Jonah Palmer</name>
<email>jonah.palmer@oracle.com</email>
</author>
<published>2024-02-16T14:25:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bf6f4d5d8c6f65be018462006df9a8779a34b9c5'/>
<id>urn:sha1:bf6f4d5d8c6f65be018462006df9a8779a34b9c5</id>
<content type='text'>
[ Upstream commit 749a4016839270163efc36ecddddd01de491a16b ]

The MLX driver was not updating its control virtqueue size at set_vq_num
and instead always initialized to MLX5_CVQ_MAX_ENT (16) at
setup_cvq_vring.

Qemu would try to set the size to 64 by default, however, because the
CVQ size always was initialized to 16, an error would be thrown when
sending &gt;16 control messages (as used-ring entry 17 is initialized to 0).
For example, starting a guest with x-svq=on and then executing the
following command would produce the error below:

 # for i in {1..20}; do ifconfig eth0 hw ether XX:xx:XX:xx:XX:XX; done

 qemu-system-x86_64: Insufficient written data (0)
 [  435.331223] virtio_net virtio0: Failed to set mac address by vq command.
 SIOCSIFHWADDR: Invalid argument

Acked-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Signed-off-by: Jonah Palmer &lt;jonah.palmer@oracle.com&gt;
Message-Id: &lt;20240216142502.78095-1-jonah.palmer@oracle.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: preserve CVQ vringh index</title>
<updated>2023-12-13T17:44:55+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=dd3438abfb85f6071ffafacd05d713a7ee020955'/>
<id>urn:sha1:dd3438abfb85f6071ffafacd05d713a7ee020955</id>
<content type='text'>
[ Upstream commit 480b3e73720f6b5d76bef2387b1f9d19ed67573b ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Fix firmware error on creation of 1k VQs</title>
<updated>2023-10-18T15:29:41+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-08-31T15:50:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=abb0dcf9938c93f765abf8cb45567cadef0af6b2'/>
<id>urn:sha1:abb0dcf9938c93f765abf8cb45567cadef0af6b2</id>
<content type='text'>
A firmware error is triggered when configuring a 9k MTU on the PF after
switching to switchdev mode and then using a vdpa device with larger
(1k) rings:
mlx5_cmd_out_err: CREATE_GENERAL_OBJECT(0xa00) op_mod(0xd) failed, status bad resource(0x5), syndrome (0xf6db90), err(-22)

This is due to the fact that the hw VQ size parameters are computed
based on the umem_1/2/3_buffer_param_a/b capabilities and all
device capabilities are read only when the driver is moved to switchdev mode.

The problematic configuration flow looks like this:
1) Create VF
2) Unbind VF
3) Switch PF to switchdev mode.
4) Bind VF
5) Set PF MTU to 9k
6) create vDPA device
7) Start VM with vDPA device and 1K queue size

Note that setting the MTU before step 3) doesn't trigger this issue.

This patch reads the forementioned umem parameters at the latest point
possible before the VQs of the device are created.

v2:
- Allocate output with kmalloc to reduce stack frame size.
- Removed stable from cc.

Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices")
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Message-Id: &lt;20230831155702.1080754-1-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Fix double release of debugfs entry</title>
<updated>2023-10-18T15:29:29+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-08-29T17:40:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f8a3db47d944a33eac1f37358db560e5aabbfbca'/>
<id>urn:sha1:f8a3db47d944a33eac1f37358db560e5aabbfbca</id>
<content type='text'>
The error path in setup_driver deletes the debugfs entry but doesn't
clear the pointer. During .dev_del the invalid pointer will be released
again causing a crash.

This patch fixes the issue by always clearing the debugfs entry in
mlx5_vdpa_remove_debugfs. Also, stop removing the debugfs entry in
.dev_del op: the debugfs entry is already handled within the
setup_driver/teardown_driver scope.

Cc: stable@vger.kernel.org
Fixes: f0417e72add5 ("vdpa/mlx5: Add and remove debugfs in setup/teardown driver")
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Reviewed-by: Gal Pressman &lt;gal@nvidia.com&gt;
Message-Id: &lt;20230829174014.928189-2-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost</title>
<updated>2023-09-04T17:43:44+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-09-04T17:43:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e4f1b8202fb59c56a3de7642d50326923670513f'/>
<id>urn:sha1:e4f1b8202fb59c56a3de7642d50326923670513f</id>
<content type='text'>
Pull virtio updates from Michael Tsirkin:
 "A small pull request this time around, mostly because the vduse
  network got postponed to next relase so we can be sure we got the
  security store right"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio_ring: fix avail_wrap_counter in virtqueue_add_packed
  virtio_vdpa: build affinity masks conditionally
  virtio_net: merge dma operations when filling mergeable buffers
  virtio_ring: introduce dma sync api for virtqueue
  virtio_ring: introduce dma map api for virtqueue
  virtio_ring: introduce virtqueue_reset()
  virtio_ring: separate the logic of reset/enable from virtqueue_resize
  virtio_ring: correct the expression of the description of virtqueue_resize()
  virtio_ring: skip unmap for premapped
  virtio_ring: introduce virtqueue_dma_dev()
  virtio_ring: support add premapped buf
  virtio_ring: introduce virtqueue_set_dma_premapped()
  virtio_ring: put mapping error check in vring_map_one_sg
  virtio_ring: check use_dma_api before unmap desc for indirect
  vdpa_sim: offer VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK
  vdpa: add get_backend_features vdpa operation
  vdpa: accept VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK backend feature
  vdpa: add VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK flag
  vdpa/mlx5: Remove unused function declarations
</content>
</entry>
<entry>
<title>vdpa/mlx5: Remove unused function declarations</title>
<updated>2023-09-03T22:10:22+00:00</updated>
<author>
<name>Yue Haibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2023-08-03T14:30:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c1081002bfeeba54204d37000a8c43b2015b6eda'/>
<id>urn:sha1:c1081002bfeeba54204d37000a8c43b2015b6eda</id>
<content type='text'>
Commit 29064bfdabd5 ("vdpa/mlx5: Add support library for mlx5 VDPA implementation")
declared but never implemented these.

Signed-off-by: Yue Haibing &lt;yuehaibing@huawei.com&gt;
Message-Id: &lt;20230803143041.23388-1-yuehaibing@huawei.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
</feed>
