+18
−7
Loading
We will meet the followings errors in 64K page kernel:
" vfio_user.c:4454:nvmf_vfio_user_listen: *ERROR*: /tmp/nvme-vfio-user: error to mmap file /tmp/nvme-vfio-user/bar0: Invalid argument."
" vfio_user.c:3088:vfio_user_log: *ERROR*: /tmp/nvme-vfio-user: migration registers cannot be memory mapped"
Fix them by
0.)
0.1) Add a new field @bar0 in nvmf_vfio_user_endpoint{} to store
the mmap result.
0.2) Pass 0 to mmap's offset parameter.
The doorbell offset is fixed at 0x1000 (kernel NVME driver uses it too).
But mmap requires the offset must be a multiple of the page size
as returned by sysconf(_SC_PAGE_SIZE).
In 64K page size kernel will meet the failure.
So set 0 to mmap's offset, and then change to doorbell
offset manually.
1.) convert the hardcode to PAGE_SIZE.
Tested this patch with cloud-hypervisor in :
(64K page size kernel) + (4K page size kernel).
Change-Id: Ibf0a61e4773cff6a3b7887315b50a686f7c237dc
Signed-off-by:
Huang Shijie <shijie@os.amperecomputing.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/18627
Reviewed-by:
John Levon <levon@movementarian.org>
Reviewed-by:
Jim Harris <jim.harris@nvidia.com>
Reviewed-by:
Ben Walker <ben@nvidia.com>
Tested-by:
SPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by:
GangCao <gang.cao@intel.com>