env_dpdk/memory: implement contiguity check for vtophys map
We'll be now able to check contiguity for more than 2MB regions. Change-Id: I738ff451d534075c944972918d08e5e0cadea4f5 Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466073 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
cf078e71fe
commit
43f4e3932a
@ -1086,6 +1086,17 @@ spdk_vtophys_notify(void *cb_ctx, struct spdk_mem_map *map,
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
vtophys_check_contiguous_entries(uint64_t paddr1, uint64_t paddr2)
|
||||
{
|
||||
/* This function is always called with paddrs for two subsequent
|
||||
* 2MB chunks in virtual address space, so those chunks will be only
|
||||
* physically contiguous if the physical addresses are 2MB apart
|
||||
* from each other as well.
|
||||
*/
|
||||
return (paddr2 - paddr1 == VALUE_2MB);
|
||||
}
|
||||
|
||||
#if SPDK_VFIO_ENABLED
|
||||
|
||||
static bool
|
||||
@ -1274,7 +1285,7 @@ spdk_vtophys_init(void)
|
||||
{
|
||||
const struct spdk_mem_map_ops vtophys_map_ops = {
|
||||
.notify_cb = spdk_vtophys_notify,
|
||||
.are_contiguous = NULL
|
||||
.are_contiguous = vtophys_check_contiguous_entries,
|
||||
};
|
||||
|
||||
#if SPDK_VFIO_ENABLED
|
||||
|
Loading…
Reference in New Issue
Block a user