Skip to content

[WIP] Add IPC tests (umfIpcTest) to the devdax provider #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ldorau
Copy link
Contributor

@ldorau ldorau commented Oct 24, 2024

Description

Add IPC tests (umfIpcTest) to the devdax provider.

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly

size_t offset; // offset in the file used for memory mapping
utils_mutex_t lock; // lock of ptr and offset
unsigned protection; // combination of OS-specific protection flags
bool ipc_consumer_only_mode; // when path==NULL and size==0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that we do need explicit ipc_consumer_only_mode flag. Alternatively we can allow path to be empty in that case allocations would not be possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But path is not passed to all API ops.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But path is not passed to all API ops.

Wait, it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, do you suggest to always check if (path == NULL) ? I think checking ipc_consumer_only_mode is more clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW. please review #831 instead of this one

@ldorau ldorau force-pushed the Add_IPC_test_for_umfPoolMalloc_after_umfCloseIPCHandle branch 3 times, most recently from 28ca1f4 to d8f5695 Compare October 25, 2024 10:56
@ldorau ldorau changed the title [WIP] Add IPC test for umfPoolMalloc() after umfCloseIPCHandle() [WIP] do NOT review Oct 25, 2024
@ldorau ldorau changed the title [WIP] do NOT review [WIP] just TEST CI - do NOT review Oct 25, 2024
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Add utils_align_ptr_down_size_up() to align
a pointer down and a size up (for mmap()/munmap()).

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
@ldorau ldorau force-pushed the Add_IPC_test_for_umfPoolMalloc_after_umfCloseIPCHandle branch 4 times, most recently from ea33501 to fdb5f29 Compare October 25, 2024 14:58
@ldorau ldorau changed the title [WIP] just TEST CI - do NOT review [WIP] Add IPC tests (umfIpcTest) to the devdax provider Oct 25, 2024
@ldorau ldorau force-pushed the Add_IPC_test_for_umfPoolMalloc_after_umfCloseIPCHandle branch from fdb5f29 to ebd8053 Compare October 25, 2024 15:02
@ldorau ldorau force-pushed the Add_IPC_test_for_umfPoolMalloc_after_umfCloseIPCHandle branch from ebd8053 to 96dea9f Compare October 25, 2024 15:10
devdax_open_ipc_handle() has to use the path of the remote
/dev/dax got from the IPC handle, not the local one.

devdax_open_ipc_handle() has to use also the memory protection
got from the IPC handle, so let's add the memory protection
to the IPC handle.

devdax_open_ipc_handle() should mmap only the required range of memory,
not the whole /dev/dax device, so let's add the length of the allocation
to the IPC handle.

devdax_close_ipc_handle() should unmap only the required range of memory,
not the whole /dev/dax device.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Some memory providers (currently the devdax and the file providers)
do not support the free() operation (free() always returns
the UMF_RESULT_ERROR_NOT_SUPPORTED error).

Add the UMF_TEST_PROVIDER_FREE_NOT_SUPPORTED define
and the get_umf_result_of_free macro() to ipcFixtures.hpp
to enable running umfIpcTest tests when free() is not supported.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
@ldorau ldorau force-pushed the Add_IPC_test_for_umfPoolMalloc_after_umfCloseIPCHandle branch from 96dea9f to 4e0e3aa Compare October 28, 2024 12:16
@ldorau
Copy link
Contributor Author

ldorau commented Oct 28, 2024

Replaced with #845

@ldorau ldorau closed this Oct 28, 2024
@ldorau ldorau deleted the Add_IPC_test_for_umfPoolMalloc_after_umfCloseIPCHandle branch October 28, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants