Skip to content
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

pyverbs: Introducing parent domain #615

Merged
merged 4 commits into from
Nov 25, 2019
Merged

Conversation

noaos
Copy link
Contributor

@noaos noaos commented Nov 14, 2019

Parent domains extend protection domains with custom allocators
callbacks given by the user and override the provider's allocation.

This series adds support for parent domain in pyverbs, including
a basic test and a documentation.

In order to allow Python users to provide Python allocators, pyverbs
is using the pd_context object and an internal wrapper that makes the
Python functions to be called from the provider.

@rleon
Copy link
Member

rleon commented Nov 14, 2019

Please rebase

@noaos
Copy link
Contributor Author

noaos commented Nov 21, 2019

PR was rebased and fixed according to Jason's comments from the mail thread.

@rleon
Copy link
Member

rleon commented Nov 24, 2019

It doesn't pass CI

CMake Error at tests/cmake_install.cmake:81 (file):
file INSTALL cannot find "/__w/1/s/tests/test_parent_domain".
Call Stack (most recent call first):
cmake_install.cmake:163 (include)

ABI check skipped, no ABI/ directory.
Traceback (most recent call last):
File "/__w/1/s/buildlib/check-build", line 511, in
v(args);
File "/__w/1/s/buildlib/check-build", line 288, in test_installed_headers
subprocess.check_output(["ninja","install"],env=env,cwd=args.BUILD);
File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', 'install']' returned non-zero exit status 1.
##[error]/usr/bin/python3 failed with return code: 1
##[section]Finishing: Check Build Script

Add new mem_alloc module which wraps some C memory allocation functions
such as posix_memalign, malloc and free.
This allows Pyverbs' users to easily allocate and free memory in C
style, i.e when the memory address must be passed to a driver API.

Signed-off-by: Edward Srouji <edwards@mellanox.com>
Reviewed-by: Noa Osherovich <noaos@mellanox.com>
The parent domain object extends the normal PD (protection domain) and
can be used interchangeably with it.
This patch adds ParentDomain class, in order to allow the user to
allocate parent domain in a user-friendly way.

In addition, ParentDomainContext class was added which is used as the
pd_context and it includes PD (protection domain) object, alloc and
free Python functions.
This allows the user to implement allocators in Python that are
callable from the C callbacks wrappers via driver code.

Signed-off-by: Edward Srouji <edwards@mellanox.com>
Reviewed-by: Noa Osherovich <noaos@mellanox.com>
Add a documentation for ParentDomain with a simple code snippet
demonstrating the creation of the object with Python defined allocators.

Signed-off-by: Edward Srouji <edwards@mellanox.com>
Reviewed-by: Noa Osherovich <noaos@mellanox.com>
The test checks parent domain creation without custom allocators, with
custom allocators that return USE_DEFAULT (indicates the driver to use
the default allocator) and custom allocators with local memory
allocation.
In addition, in each case a QP and SRQ are created in order to verify
the usage of the allocators.

Signed-off-by: Edward Srouji <edwards@mellanox.com>
Reviewed-by: Noa Osherovich <noaos@mellanox.com>
@noaos
Copy link
Contributor Author

noaos commented Nov 25, 2019

Issue was fixed, PR was updated and passes all checks.

@rleon rleon merged commit cb88f57 into linux-rdma:master Nov 25, 2019
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.

3 participants