]> git.droids-corp.org - dpdk.git/commit
vdpa/mlx5: workaround VAR offset within page
authorYajun Wu <yajunw@nvidia.com>
Wed, 15 Jun 2022 10:02:27 +0000 (13:02 +0300)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 17 Jun 2022 13:34:25 +0000 (15:34 +0200)
commit95af59b7ad9f6a465de2ead9ef709429678e750d
treec1383c128a94ead4eea3c3f143745a9fecd5f90f
parentfe8477ebbd945cee1a322b348b52f9f276160efc
vdpa/mlx5: workaround VAR offset within page

vDPA driver first uses kernel driver to allocate doorbell (VAR) area for
each device. Then uses var->mmap_off and var->length to mmap uverbs device
file as doorbell userspace virtual address.

Current kernel driver provides var->mmap_off equal to page start of VAR.
It's fine with x86 4K page server, because VAR physical address is only 4K
aligned thus locate in 4K page start.

But with aarch64 64K page server, the actual VAR physical address has
offset within page (not located in 64K page start).
So the vDPA driver needs to add this within page offset
(caps.doorbell_bar_offset) to get the right VAR virtual address.

Fixes: 62c813706e4 ("vdpa/mlx5: map doorbell")
Cc: stable@dpdk.org
Signed-off-by: Yajun Wu <yajunw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/vdpa/mlx5/mlx5_vdpa.c