linux/drivers/vdpa
Eli Cohen 710eb8e32d vdpa/mlx5: Fix memory key MTT population
map_direct_mr() assumed that the number of scatter/gather entries
returned by dma_map_sg_attrs() was equal to the number of segments in
the sgl list. This led to wrong population of the mkey object. Fix this
by properly referring to the returned value.

The hardware expects each MTT entry to contain the DMA address of a
contiguous block of memory of size (1 << mr->log_size) bytes.
dma_map_sg_attrs() can coalesce several sg entries into a single
scatter/gather entry of contiguous DMA range so we need to scan the list
and refer to the size of each s/g entry.

In addition, get rid of fill_sg() which effect is overwritten by
populate_mtts().

Fixes: 94abbccdf2 ("vdpa/mlx5: Add shared memory registration code")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20210107071845.GA224876@mtl-vdi-166.wap.labs.mlnx
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
2021-01-20 03:47:04 -05:00
..
ifcvf vdpa: ifcvf: Use dma_set_mask_and_coherent to simplify code 2020-12-18 16:14:28 -05:00
mlx5 vdpa/mlx5: Fix memory key MTT population 2021-01-20 03:47:04 -05:00
vdpa_sim vdpa: split vdpasim to core and net modules 2020-12-18 16:14:30 -05:00
Kconfig vdpa: split vdpasim to core and net modules 2020-12-18 16:14:30 -05:00
Makefile vdpa/mlx5: Add support library for mlx5 VDPA implementation 2020-08-05 19:00:23 -04:00
vdpa.c vdpa: Use simpler version of ida allocation 2020-12-18 16:14:31 -05:00