[PATCH rdma-core v3 0/3] Dma-buf related fixes

2021-02-05 Thread Jianxin Xiong
support. It consists of three patches. The first patch fixes a compilation warning for 32-bit builds. Patch 2 renames a function parameter and adds full name to an acronym. Patch 3 adds check for DRM headers. Pull request at github: https://github.com/linux-rdma/rdma-core/pull/942 Jianxin Xiong (3

[PATCH rdma-core v3 3/3] configure: Add check for DRM headers

2021-02-05 Thread Jianxin Xiong
allocation routines wth stubs that return suitable error to allow the related tests to skip. Signed-off-by: Jianxin Xiong --- CMakeLists.txt | 17 + pyverbs/CMakeLists.txt | 8 +++- pyverbs/dmabuf_alloc.c | 8 pyverbs/dmabuf_alloc_stub.c | 39

[PATCH rdma-core v3 2/3] pyverbs, tests: Cosmetic improvements for dma-buf allocation routines

2021-02-05 Thread Jianxin Xiong
Rename the parameter 'unit' to 'gpu'. Expand GTT to the full name in the comments. Signed-off-by: Jianxin Xiong Reviewed-by: John Hubbard --- pyverbs/dmabuf.pyx | 12 pyverbs/dmabuf_alloc.c | 12 pyverbs/dmabuf_alloc.h | 2 +- pyverbs/mr.pyx | 6 ++-- tests

[PATCH rdma-core v3 1/3] verbs: Fix gcc warnings when building for 32bit systems

2021-02-05 Thread Jianxin Xiong
s.c:387:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] mr->addr = (void *)offset; ... Reported-by: Ali Alnubani Signed-off-by: Jianxin Xiong --- libibverbs/cmd_mr.c | 2 +- libibverbs/verbs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions

[PATCH rdma-core v2 3/3] configure: Add check for the presence of DRM headers

2021-02-04 Thread Jianxin Xiong
libdrm installation. If the headers are missing, the dmabuf allocation routines are replaced by stubs that return suitable error to allow the related tests to skip. Signed-off-by: Jianxin Xiong --- CMakeLists.txt | 15 +++ pyverbs/CMakeLists.txt | 14

[PATCH rdma-core v2 1/3] verbs: Fix gcc warnings when building for 32bit systems

2021-02-04 Thread Jianxin Xiong
s.c:387:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] mr->addr = (void *)offset; ... Reported-by: Ali Alnubani Signed-off-by: Jianxin Xiong --- libibverbs/cmd_mr.c | 2 +- libibverbs/verbs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions

[PATCH rdma-core v2 2/3] pyverbs, tests: Cosmetic improvements for dma-buf allocation routines

2021-02-04 Thread Jianxin Xiong
Rename the parameter 'unit' to 'gpu'. Expand GTT to the full name in the comments. Signed-off-by: Jianxin Xiong Reviewed-by: John Hubbard --- pyverbs/dmabuf.pyx | 12 pyverbs/dmabuf_alloc.c | 12 pyverbs/dmabuf_alloc.h | 2 +- pyverbs/mr.pyx | 6 ++-- tests

[PATCH rdma-core v2 0/3] Dma-buf related fixes

2021-02-04 Thread Jianxin Xiong
/pull/942 Jianxin Xiong (3): verbs: Fix gcc warnings when building for 32bit systems pyverbs,tests: Cosmetic improvements for dma-buf allocation routines configure: Add check for the presence of DRM headers CMakeLists.txt | 15 + libibverbs/cmd_mr.c | 2

[PATCH rdma-core 2/3] pyverbs, tests: Cosmetic improvements for dma-buf allocation routines

2021-02-04 Thread Jianxin Xiong
Rename the parameter 'unit' to 'gpu'. Expand GTT to the full name in the comments. Signed-off-by: Jianxin Xiong --- pyverbs/dmabuf.pyx | 12 pyverbs/dmabuf_alloc.c | 12 pyverbs/dmabuf_alloc.h | 2 +- pyverbs/mr.pyx | 6 ++-- tests/test_mr.py | 78

[PATCH rdma-core 0/3] Dma-buf related fixes

2021-02-04 Thread Jianxin Xiong
://github.com/linux-rdma/rdma-core/pull/942 Jianxin Xiong (3): verbs: Fix gcc warnings when building for 32bit systems pyverbs,tests: Cosmetic improvements for dma-buf allocation routines configure: Add check for the presence of DRM headers CMakeLists.txt | 7 + buildlib/Finddrm.cmake

[PATCH rdma-core 3/3] configure: Add check for the presence of DRM headers

2021-02-04 Thread Jianxin Xiong
, pkg-config is tried to find the include path of custom libdrm installation. The dmabuf allocation routines now return suitable error when the headers are not available. The related tests will recognize this error code and skip. Signed-off-by: Jianxin Xiong --- CMakeLists.txt | 7

[PATCH rdma-core 1/3] verbs: Fix gcc warnings when building for 32bit systems

2021-02-04 Thread Jianxin Xiong
s.c:387:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] mr->addr = (void *)offset; ... Reported-by: Ali Alnubani Signed-off-by: Jianxin Xiong --- libibverbs/cmd_mr.c | 2 +- libibverbs/verbs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions

[PATCH rdma-core v7 0/6] Add user space dma-buf support

2021-01-25 Thread Jianxin Xiong
bug in the utility code of the tests. Pull request at github: https://github.com/linux-rdma/rdma-core/pull/895 Jianxin Xiong (6): Update kernel headers verbs: Support dma-buf based memory region mlx5: Support dma-buf based memory region pyverbs: Add dma-buf based MR support tests: Add

[PATCH rdma-core v7 5/6] tests: Add tests for dma-buf based memory regions

2021-01-25 Thread Jianxin Xiong
Define a set of unit tests similar to regular MR tests and a set of tests for send/recv and rdma traffic using dma-buf MRs. Add a utility function to generate access flags for dma-buf based MRs because the set of supported flags is smaller. Signed-off-by: Jianxin Xiong --- tests/args_parser.py

[PATCH rdma-core v7 3/6] mlx5: Support dma-buf based memory region

2021-01-25 Thread Jianxin Xiong
Implement the new provider method for registering dma-buf based memory regions. Signed-off-by: Jianxin Xiong --- providers/mlx5/mlx5.c | 2 ++ providers/mlx5/mlx5.h | 3 +++ providers/mlx5/verbs.c | 22 ++ 3 files changed, 27 insertions(+) diff --git a/providers/mlx5

[PATCH rdma-core v7 4/6] pyverbs: Add dma-buf based MR support

2021-01-25 Thread Jianxin Xiong
-by: Jianxin Xiong --- buildlib/pyverbs_functions.cmake | 78 +++ pyverbs/CMakeLists.txt | 11 +- pyverbs/dmabuf.pxd | 15 +++ pyverbs/dmabuf.pyx | 73 ++ pyverbs/dmabuf_alloc.c | 278 +++ pyverbs

[PATCH rdma-core v7 1/6] Update kernel headers

2021-01-25 Thread Jianxin Xiong
To commit bfe0cc6eb249 ("RDMA/uverbs: Add uverbs command for dma-buf based MR registration"). Signed-off-by: Jianxin Xiong --- kernel-headers/rdma/ib_user_ioctl_cmds.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/kernel-headers/rdma/ib_user_ioctl_cmds.h b/kern

[PATCH rdma-core v7 6/6] tests: Bug fix for get_access_flags()

2021-01-25 Thread Jianxin Xiong
The filter definition is wrong and causes get_access_flags() always returning empty list. As the result the MR tests using this function are effectively skipped (but report success). Signed-off-by: Jianxin Xiong --- tests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH rdma-core v7 2/6] verbs: Support dma-buf based memory region

2021-01-25 Thread Jianxin Xiong
Add new API function and new provider method for registering dma-buf based memory region. Update the man page and bump the API version. Signed-off-by: Jianxin Xiong --- debian/libibverbs1.symbols | 2 ++ libibverbs/CMakeLists.txt| 2 +- libibverbs/cmd_mr.c | 38

[PATCH rdma-core v6 2/6] verbs: Support dma-buf based memory region

2021-01-20 Thread Jianxin Xiong
Add new API function and new provider method for registering dma-buf based memory region. Update the man page and bump the API version. Signed-off-by: Jianxin Xiong --- CMakeLists.txt | 2 +- debian/control | 2 +- debian/libibverbs1.symbols | 4 +++- libibverbs

[PATCH rdma-core v6 4/6] pyverbs: Add dma-buf based MR support

2021-01-20 Thread Jianxin Xiong
-by: Jianxin Xiong --- buildlib/pyverbs_functions.cmake | 78 +++ pyverbs/CMakeLists.txt | 11 +- pyverbs/dmabuf.pxd | 15 +++ pyverbs/dmabuf.pyx | 73 ++ pyverbs/dmabuf_alloc.c | 278 +++ pyverbs

[PATCH rdma-core v6 3/6] mlx5: Support dma-buf based memory region

2021-01-20 Thread Jianxin Xiong
Implement the new provider method for registering dma-buf based memory regions. Signed-off-by: Jianxin Xiong --- providers/mlx5/mlx5.c | 2 ++ providers/mlx5/mlx5.h | 3 +++ providers/mlx5/verbs.c | 22 ++ 3 files changed, 27 insertions(+) diff --git a/providers/mlx5

[PATCH rdma-core v6 5/6] tests: Add tests for dma-buf based memory regions

2021-01-20 Thread Jianxin Xiong
Define a set of unit tests similar to regular MR tests and a set of tests for send/recv and rdma traffic using dma-buf MRs. Add a utility function to generate access flags for dma-buf based MRs because the set of supported flags is smaller. Signed-off-by: Jianxin Xiong --- tests/args_parser.py

[PATCH rdma-core v6 0/6] Add user space dma-buf support

2021-01-20 Thread Jianxin Xiong
a set of new tests for the new API. Patch 6 fixes bug in the utility code of the tests. Pull request at github: https://github.com/linux-rdma/rdma-core/pull/895 Jianxin Xiong (6): Update kernel headers verbs: Support dma-buf based memory region mlx5: Support dma-buf based memory region

[PATCH rdma-core v6 6/6] tests: Bug fix for get_access_flags()

2021-01-20 Thread Jianxin Xiong
The filter definition is wrong and causes get_access_flags() always returning empty list. As the result the MR tests using this function are effectively skipped (but report success). Signed-off-by: Jianxin Xiong --- tests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH rdma-core v6 1/6] Update kernel headers

2021-01-20 Thread Jianxin Xiong
To commit 2eef437c4669 ("RDMA/uverbs: Add uverbs command for dma-buf based MR registration"). Signed-off-by: Jianxin Xiong --- kernel-headers/rdma/ib_user_ioctl_cmds.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/kernel-headers/rdma/ib_user_ioctl_cmds.h b/kern

[PATCH rdma-core v5 3/6] mlx5: Support dma-buf based memory region

2021-01-14 Thread Jianxin Xiong
Implement the new provider method for registering dma-buf based memory regions. Signed-off-by: Jianxin Xiong --- providers/mlx5/mlx5.c | 2 ++ providers/mlx5/mlx5.h | 3 +++ providers/mlx5/verbs.c | 22 ++ 3 files changed, 27 insertions(+) diff --git a/providers/mlx5

[PATCH rdma-core v5 0/6] Add user space dma-buf support

2021-01-14 Thread Jianxin Xiong
definitions to pyverbs for the new API. Patch 5 adds a set of new tests for the new API. Patch 6 fixes bug in the utility code of the tests. Pull request at github: https://github.com/linux-rdma/rdma-core/pull/895 Jianxin Xiong (6): Update kernel headers verbs: Support dma-buf based memory

[PATCH rdma-core v5 6/6] tests: Bug fix for get_access_flags()

2021-01-14 Thread Jianxin Xiong
The filter definition is wrong and causes get_access_flags() always returning empty list. As the result the MR tests using this function are effectively skipped (but report success). Signed-off-by: Jianxin Xiong --- tests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH rdma-core v5 4/6] pyverbs: Add dma-buf based MR support

2021-01-14 Thread Jianxin Xiong
-by: Jianxin Xiong --- buildlib/pyverbs_functions.cmake | 78 +++ pyverbs/CMakeLists.txt | 11 +- pyverbs/dmabuf.pxd | 15 +++ pyverbs/dmabuf.pyx | 73 ++ pyverbs/dmabuf_alloc.c | 278 +++ pyverbs

[PATCH rdma-core v5 2/6] verbs: Support dma-buf based memory region

2021-01-14 Thread Jianxin Xiong
Add new API function and new provider method for registering dma-buf based memory region. Update the man page and bump the API version. Signed-off-by: Jianxin Xiong --- debian/libibverbs1.symbols | 2 ++ libibverbs/CMakeLists.txt| 2 +- libibverbs/cmd_mr.c | 38

[PATCH rdma-core v5 5/6] tests: Add tests for dma-buf based memory regions

2021-01-14 Thread Jianxin Xiong
Define a set of unit tests similar to regular MR tests and a set of tests for send/recv and rdma traffic using dma-buf MRs. Add a utility function to generate access flags for dma-buf based MRs because the set of supported flags is smaller. Signed-off-by: Jianxin Xiong --- tests/args_parser.py

[PATCH rdma-core v5 1/6] Update kernel headers

2021-01-14 Thread Jianxin Xiong
To commit 2eef437c4669 ("RDMA/uverbs: Add uverbs command for dma-buf based MR registration"). Signed-off-by: Jianxin Xiong --- kernel-headers/rdma/ib_user_ioctl_cmds.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/kernel-headers/rdma/ib_user_ioctl_cmds.h b/kern

[PATCH v16 0/4] RDMA: Add dma-buf support

2020-12-15 Thread Jianxin Xiong
space RDMA library changes are provided as a separate patch series. Jianxin Xiong (4): RDMA/umem: Support importing dma-buf as user memory region RDMA/core: Add device method for registering dma-buf based memory region RDMA/uverbs: Add uverbs command for dma-buf based MR registration RDMA/mlx

[PATCH v16 3/4] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-12-15 Thread Jianxin Xiong
Implement a new uverbs ioctl method for memory registration with file descriptor as an extra parameter. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel Vetter Reviewed-by: Leon Romanovsky --- drivers/infiniband/core

[PATCH v16 4/4] RDMA/mlx5: Support dma-buf based userspace memory region

2020-12-15 Thread Jianxin Xiong
Implement the new driver method 'reg_user_mr_dmabuf'. Utilize the core functions to import dma-buf based memory region and update the mappings. Add code to handle dma-buf related page fault. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian

[PATCH v16 2/4] RDMA/core: Add device method for registering dma-buf based memory region

2020-12-15 Thread Jianxin Xiong
Dma-buf based memory region requires one extra parameter and is processed quite differently. Adding a separate method allows clean separation from regular memory regions. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel

[PATCH v16 1/4] RDMA/umem: Support importing dma-buf as user memory region

2020-12-15 Thread Jianxin Xiong
the buffer is registered as a memory region, the file descriptor is passed to the RDMA driver along with other parameters. Implement the common code for importing dma-buf object and mapping dma-buf pages. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked

[PATCH v15 1/4] RDMA/umem: Support importing dma-buf as user memory region

2020-12-10 Thread Jianxin Xiong
the buffer is registered as a memory region, the file descriptor is passed to the RDMA driver along with other parameters. Implement the common code for importing dma-buf object and mapping dma-buf pages. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked

[PATCH v15 2/4] RDMA/core: Add device method for registering dma-buf based memory region

2020-12-10 Thread Jianxin Xiong
Dma-buf based memory region requires one extra parameter and is processed quite differently. Adding a separate method allows clean separation from regular memory regions. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel

[PATCH v15 3/4] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-12-10 Thread Jianxin Xiong
Implement a new uverbs ioctl method for memory registration with file descriptor as an extra parameter. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel Vetter Reviewed-by: Leon Romanovsky --- drivers/infiniband/core

[PATCH v15 4/4] RDMA/mlx5: Support dma-buf based userspace memory region

2020-12-10 Thread Jianxin Xiong
Implement the new driver method 'reg_user_mr_dmabuf'. Utilize the core functions to import dma-buf based memory region and update the mappings. Add code to handle dma-buf related page fault. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian

[PATCH v15 0/4] RDMA: Add dma-buf support

2020-12-10 Thread Jianxin Xiong
dma-buf based memory region. Patch 4 adds dma-buf support to the mlx5 driver. Related user space RDMA library changes are provided as a separate patch series. Jianxin Xiong (4): RDMA/umem: Support importing dma-buf as user memory region RDMA/core: Add device method for registering dma-buf

[PATCH v14 3/4] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-12-08 Thread Jianxin Xiong
Implement a new uverbs ioctl method for memory registration with file descriptor as an extra parameter. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel Vetter Reviewed-by: Leon Romanovsky --- drivers/infiniband/core

[PATCH v14 4/4] RDMA/mlx5: Support dma-buf based userspace memory region

2020-12-08 Thread Jianxin Xiong
Implement the new driver method 'reg_user_mr_dmabuf'. Utilize the core functions to import dma-buf based memory region and update the mappings. Add code to handle dma-buf related page fault. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian

[PATCH v14 1/4] RDMA/umem: Support importing dma-buf as user memory region

2020-12-08 Thread Jianxin Xiong
the buffer is registered as a memory region, the file descriptor is passed to the RDMA driver along with other parameters. Implement the common code for importing dma-buf object and mapping dma-buf pages. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked

[PATCH v14 0/4] RDMA: Add dma-buf support

2020-12-08 Thread Jianxin Xiong
. Jianxin Xiong (4): RDMA/umem: Support importing dma-buf as user memory region RDMA/core: Add device method for registering dma-buf based memory region RDMA/uverbs: Add uverbs command for dma-buf based MR registration RDMA/mlx5: Support dma-buf based userspace memory region drivers/infiniband

[PATCH v14 2/4] RDMA/core: Add device method for registering dma-buf based memory region

2020-12-08 Thread Jianxin Xiong
Dma-buf based memory region requires one extra parameter and is processed quite differently. Adding a separate method allows clean separation from regular memory regions. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel

[PATCH v13 3/4] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-12-07 Thread Jianxin Xiong
Implement a new uverbs ioctl method for memory registration with file descriptor as an extra parameter. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel Vetter --- drivers/infiniband/core/uverbs_std_types_mr.c | 117

[PATCH v13 0/4] RDMA: Add dma-buf support

2020-12-07 Thread Jianxin Xiong
reg_user_mr_dmabuf(). Patch 3 adds a new uverbs command for registering dma-buf based memory region. Patch 4 adds dma-buf support to the mlx5 driver. Related user space RDMA library changes are provided as a separate patch series. Jianxin Xiong (4): RDMA/umem: Support importing dma-buf as user memory

[PATCH v13 2/4] RDMA/core: Add device method for registering dma-buf based memory region

2020-12-07 Thread Jianxin Xiong
Dma-buf based memory region requires one extra parameter and is processed quite differently. Adding a separate method allows clean separation from regular memory regions. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel

[PATCH v13 1/4] RDMA/umem: Support importing dma-buf as user memory region

2020-12-07 Thread Jianxin Xiong
the buffer is registered as a memory region, the file descriptor is passed to the RDMA driver along with other parameters. Implement the common code for importing dma-buf object and mapping dma-buf pages. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked

[PATCH v13 4/4] RDMA/mlx5: Support dma-buf based userspace memory region

2020-12-07 Thread Jianxin Xiong
Implement the new driver method 'reg_user_mr_dmabuf'. Utilize the core functions to import dma-buf based memory region and update the mappings. Add code to handle dma-buf related page fault. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian

[PATCH rdma-core v4 4/6] pyverbs: Add dma-buf based MR support

2020-12-02 Thread Jianxin Xiong
-by: Jianxin Xiong --- buildlib/pyverbs_functions.cmake | 78 +++ pyverbs/CMakeLists.txt | 11 +- pyverbs/dmabuf.pxd | 15 +++ pyverbs/dmabuf.pyx | 73 ++ pyverbs/dmabuf_alloc.c | 278 +++ pyverbs

[PATCH rdma-core v4 1/6] Update kernel headers

2020-12-02 Thread Jianxin Xiong
To commit 2eef437c4669 ("RDMA/uverbs: Add uverbs command for dma-buf based MR registration"). Signed-off-by: Jianxin Xiong --- kernel-headers/rdma/ib_user_ioctl_cmds.h | 14 ++ kernel-headers/rdma/ib_user_verbs.h | 14 -- 2 files changed, 14 inserti

[PATCH rdma-core v4 5/6] tests: Add tests for dma-buf based memory regions

2020-12-02 Thread Jianxin Xiong
Define a set of unit tests similar to regular MR tests and a set of tests for send/recv and rdma traffic using dma-buf MRs. Add a utility function to generate access flags for dma-buf based MRs because the set of supported flags is smaller. Signed-off-by: Jianxin Xiong --- tests/args_parser.py

[PATCH rdma-core v4 6/6] tests: Bug fix for get_access_flags()

2020-12-02 Thread Jianxin Xiong
The filter definition is wrong and causes get_access_flags() always returning empty list. As the result the MR tests using this function are effectively skipped (but report success). Signed-off-by: Jianxin Xiong --- tests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH rdma-core v4 3/6] mlx5: Support dma-buf based memory region

2020-12-02 Thread Jianxin Xiong
Implement the new provider method for registering dma-buf based memory regions. Signed-off-by: Jianxin Xiong --- providers/mlx5/mlx5.c | 2 ++ providers/mlx5/mlx5.h | 3 +++ providers/mlx5/verbs.c | 22 ++ 3 files changed, 27 insertions(+) diff --git a/providers/mlx5

[PATCH rdma-core v4 0/6] Add user space dma-buf support

2020-12-02 Thread Jianxin Xiong
://github.com/linux-rdma/rdma-core/pull/895 Jianxin Xiong (6): Update kernel headers verbs: Support dma-buf based memory region mlx5: Support dma-buf based memory region pyverbs: Add dma-buf based MR support tests: Add tests for dma-buf based memory regions tests: Bug fix for get_access_flags

[PATCH rdma-core v4 2/6] verbs: Support dma-buf based memory region

2020-12-02 Thread Jianxin Xiong
Add new API function and new provider method for registering dma-buf based memory region. Update the man page and bump the API version. Signed-off-by: Jianxin Xiong --- debian/libibverbs1.symbols | 2 ++ libibverbs/CMakeLists.txt| 2 +- libibverbs/cmd_mr.c | 38

[PATCH rdma-core v3 6/6] tests: Bug fix for get_access_flags()

2020-11-27 Thread Jianxin Xiong
The filter definition is wrong and causes get_access_flags() always returning empty list. As the result the MR tests using this function are effectively skipped (but report success). Signed-off-by: Jianxin Xiong --- tests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH rdma-core v3 5/6] tests: Add tests for dma-buf based memory regions

2020-11-27 Thread Jianxin Xiong
Define a set of unit tests similar to regular MR tests and a set of tests for send/recv and rdma traffic using dma-buf MRs. Add a utility function to generate access flags for dma-buf based MRs because the set of supported flags is smaller. Signed-off-by: Jianxin Xiong --- tests/test_mr.py

[PATCH rdma-core v3 4/6] pyverbs: Add dma-buf based MR support

2020-11-27 Thread Jianxin Xiong
Define a new sub-class of 'MR' that uses dma-buf object for the memory region. Define a new class 'DmaBuf' as a wrapper for dma-buf allocation mechanism implemented in C. Add a method to buildlib for building modules with mixed Cython and C source. Signed-off-by: Jianxin Xiong --- buildlib

[PATCH rdma-core v3 0/6] Add user space dma-buf support

2020-11-27 Thread Jianxin Xiong
-core/pull/895 Jianxin Xiong (6): Update kernel headers verbs: Support dma-buf based memory region mlx5: Support dma-buf based memory region pyverbs: Add dma-buf based MR support tests: Add tests for dma-buf based memory regions tests: Bug fix for get_access_flags() buildlib

[PATCH rdma-core v3 3/6] mlx5: Support dma-buf based memory region

2020-11-27 Thread Jianxin Xiong
Implement the new provider method for registering dma-buf based memory regions. Signed-off-by: Jianxin Xiong --- providers/mlx5/mlx5.c | 2 ++ providers/mlx5/mlx5.h | 3 +++ providers/mlx5/verbs.c | 22 ++ 3 files changed, 27 insertions(+) diff --git a/providers/mlx5

[PATCH rdma-core v3 2/6] verbs: Support dma-buf based memory region

2020-11-27 Thread Jianxin Xiong
Add new API function and new provider method for registering dma-buf based memory region. Update the man page and bump the API version. Signed-off-by: Jianxin Xiong --- debian/libibverbs1.symbols | 2 ++ libibverbs/CMakeLists.txt| 2 +- libibverbs/cmd_mr.c | 38

[PATCH rdma-core v3 1/6] Update kernel headers

2020-11-27 Thread Jianxin Xiong
To commit 2eef437c4669 ("RDMA/uverbs: Add uverbs command for dma-buf based MR registration"). Signed-off-by: Jianxin Xiong --- kernel-headers/rdma/ib_user_ioctl_cmds.h | 14 ++ kernel-headers/rdma/ib_user_verbs.h | 14 -- 2 files changed, 14 inserti

[PATCH rdma-core v2 3/6] mlx5: Support dma-buf based memory region

2020-11-24 Thread Jianxin Xiong
Implement the new provider method for registering dma-buf based memory regions. Signed-off-by: Jianxin Xiong --- providers/mlx5/mlx5.c | 2 ++ providers/mlx5/mlx5.h | 3 +++ providers/mlx5/verbs.c | 22 ++ 3 files changed, 27 insertions(+) diff --git a/providers/mlx5

[PATCH rdma-core v2 4/6] pyverbs: Add dma-buf based MR support

2020-11-24 Thread Jianxin Xiong
Define a new sub-class of 'MR' that uses dma-buf object for the memory region. Define a new class 'DmaBuf' for dma-buf object allocation. Signed-off-by: Jianxin Xiong --- pyverbs/CMakeLists.txt | 2 ++ pyverbs/dmabuf.pxd | 13 pyverbs/dmabuf.pyx | 85

[PATCH rdma-core v2 1/6] Update kernel headers

2020-11-24 Thread Jianxin Xiong
To commit 2eef437c4669 ("RDMA/uverbs: Add uverbs command for dma-buf based MR registration"). Signed-off-by: Jianxin Xiong --- kernel-headers/rdma/ib_user_ioctl_cmds.h | 14 ++ kernel-headers/rdma/ib_user_verbs.h | 14 -- 2 files changed, 14 inserti

[PATCH rdma-core v2 0/6] Add user space dma-buf support

2020-11-24 Thread Jianxin Xiong
for the new API. Patch 4 adds a set of new tests for the new API. Patch 5 fixes bug in the utility code of the tests. Pull request at github: https://github.com/linux-rdma/rdma-core/pull/895 Jianxin Xiong (6): Update kernel headers verbs: Support dma-buf based memory region mlx5: Support dma-buf

[PATCH rdma-core v2 2/6] verbs: Support dma-buf based memory region

2020-11-24 Thread Jianxin Xiong
Add new API function and new provider method for registering dma-buf based memory region. Update the man page and bump the API version. Signed-off-by: Jianxin Xiong --- debian/libibverbs1.symbols | 2 ++ libibverbs/CMakeLists.txt| 2 +- libibverbs/cmd_mr.c | 38

[PATCH rdma-core v2 6/6] tests: Bug fix for get_access_flags()

2020-11-24 Thread Jianxin Xiong
The filter definition is wrong and causes get_access_flags() always returning empty list. As the result the MR tests using this function are effectively skipped (but report success). Signed-off-by: Jianxin Xiong --- tests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH rdma-core v2 5/6] tests: Add tests for dma-buf based memory regions

2020-11-24 Thread Jianxin Xiong
Define a full set of tests similar to regular MR tests. Add a utility function to generate access flags for dma-buf based MRs because the set of supported flags is smaller. Signed-off-by: Jianxin Xiong --- tests/test_mr.py | 130 ++- tests

[PATCH v12 4/4] RDMA/mlx5: Support dma-buf based userspace memory region

2020-11-24 Thread Jianxin Xiong
Implement the new driver method 'reg_user_mr_dmabuf'. Utilize the core functions to import dma-buf based memory region and update the mappings. Add code to handle dma-buf related page fault. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian

[PATCH v12 1/4] RDMA/umem: Support importing dma-buf as user memory region

2020-11-24 Thread Jianxin Xiong
the buffer is registered as a memory region, the file descriptor is passed to the RDMA driver along with other parameters. Implement the common code for importing dma-buf object and mapping dma-buf pages. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked

[PATCH v12 3/4] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-11-24 Thread Jianxin Xiong
Implement a new uverbs ioctl method for memory registration with file descriptor as an extra parameter. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel Vetter --- drivers/infiniband/core/uverbs_std_types_mr.c | 114

[PATCH v12 0/4] RDMA: Add dma-buf support

2020-11-24 Thread Jianxin Xiong
a new uverbs command for registering dma-buf based memory region. Patch 4 adds dma-buf support to the mlx5 driver. Related user space RDMA library changes are provided as a separate patch series. Jianxin Xiong (4): RDMA/umem: Support importing dma-buf as user memory region RDMA/core: Add device

[PATCH v12 2/4] RDMA/core: Add device method for registering dma-buf based memory region

2020-11-24 Thread Jianxin Xiong
Dma-buf based memory region requires one extra parameter and is processed quite differently. Adding a separate method allows clean separation from regular memory regions. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel

[PATCH rdma-core 5/5] tests: Bug fix for get_access_flags()

2020-11-23 Thread Jianxin Xiong
The filter defintion is wrong and causes get_access_flags() always returning empty list. As the result the MR tests using this function are effectively skipped (but report success). Also fix a typo in the comments. Signed-off-by: Jianxin Xiong --- tests/utils.py | 6 +++--- 1 file changed, 3

[PATCH rdma-core 3/5] pyverbs: Add dma-buf based MR support

2020-11-23 Thread Jianxin Xiong
Define a new sub-class of 'MR' that uses dma-buf object for the memory region. Define a new class 'DmaBuf' for dma-buf object allocation. Signed-off-by: Jianxin Xiong --- pyverbs/CMakeLists.txt | 2 ++ pyverbs/dmabuf.pxd | 13 + pyverbs/dmabuf.pyx | 58

[PATCH rdma-core 4/5] tests: Add tests for dma-buf based memory regions

2020-11-23 Thread Jianxin Xiong
Define a full set of tests similar to regular MR tests. Add a utility function to generate access flags for dma-buf based MRs because the set of supported flags is smaller. Signed-off-by: Jianxin Xiong --- tests/test_mr.py | 130 ++- tests

[PATCH rdma-core 2/5] mlx5: Support dma-buf based memory region

2020-11-23 Thread Jianxin Xiong
Implement the new provider method for registering dma-buf based memory regions. Signed-off-by: Jianxin Xiong --- providers/mlx5/mlx5.c | 2 ++ providers/mlx5/mlx5.h | 3 +++ providers/mlx5/verbs.c | 23 +++ 3 files changed, 28 insertions(+) diff --git a/providers/mlx5

[PATCH rdma-core 1/5] verbs: Support dma-buf based memory region

2020-11-23 Thread Jianxin Xiong
Add new API function and new provider method for registering dma-buf based memory region. Update the man page and bump the API version. Signed-off-by: Jianxin Xiong --- kernel-headers/rdma/ib_user_ioctl_cmds.h | 14 libibverbs/cmd_mr.c | 38

[PATCH rdma-core 0/5] Add user space dma-buf support

2020-11-23 Thread Jianxin Xiong
adds the new API function and updates the man pages. Patch 2 implements the new API in the mlx5 provider. Patch 3 adds new class definitions to pyverbs for the new API. Patch 4 adds new tests for the new API. Patch 5 fixes bug in the utility code of the tests. Jianxin Xiong (5): verbs: Support

[PATCH v11 4/4] RDMA/mlx5: Support dma-buf based userspace memory region

2020-11-23 Thread Jianxin Xiong
Implement the new driver method 'reg_user_mr_dmabuf'. Utilize the core functions to import dma-buf based memory region and update the mappings. Add code to handle dma-buf related page fault. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian

[PATCH v11 3/4] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-11-23 Thread Jianxin Xiong
Implement a new uverbs ioctl method for memory registration with file descriptor as an extra parameter. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel Vetter --- drivers/infiniband/core/uverbs_std_types_mr.c | 114

[PATCH v11 1/4] RDMA/umem: Support importing dma-buf as user memory region

2020-11-23 Thread Jianxin Xiong
the buffer is registered as a memory region, the file descriptor is passed to the RDMA driver along with other parameters. Implement the common code for importing dma-buf object and mapping dma-buf pages. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked

[PATCH v11 2/4] RDMA/core: Add device method for registering dma-buf based memory region

2020-11-23 Thread Jianxin Xiong
Dma-buf based memory region requires one extra parameter and is processed quite differently. Adding a separate method allows clean separation from regular memory regions. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel

[PATCH v11 0/4] RDMA: Add dma-buf support

2020-11-23 Thread Jianxin Xiong
series. Jianxin Xiong (4): RDMA/umem: Support importing dma-buf as user memory region RDMA/core: Add device method for registering dma-buf based memory region RDMA/uverbs: Add uverbs command for dma-buf based MR registration RDMA/mlx5: Support dma-buf based userspace memory region

[PATCH v10 4/6] RDMA/mlx5: Support dma-buf based userspace memory region

2020-11-10 Thread Jianxin Xiong
Implement the new driver method 'reg_user_mr_dmabuf'. Utilize the core functions to import dma-buf based memory region and update the mappings. Add code to handle dma-buf related page fault. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian

[PATCH v10 1/6] RDMA/umem: Support importing dma-buf as user memory region

2020-11-10 Thread Jianxin Xiong
the buffer is registered as a memory region, the file descriptor is passed to the RDMA driver along with other parameters. Implement the common code for importing dma-buf object and mapping dma-buf pages. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked

[PATCH v10 5/6] dma-buf: Reject attach request from importers that use dma_virt_ops

2020-11-10 Thread Jianxin Xiong
-by: Jianxin Xiong --- drivers/dma-buf/dma-buf.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 9a054fb5..ba2b877 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -686,6 +686,11 @@ struct dma_buf_attachment

[PATCH v10 0/6] RDMA: Add dma-buf support

2020-11-10 Thread Jianxin Xiong
of the buffer. Related user space RDMA library changes will be provided as a separate patch series. Jianxin Xiong (6): RDMA/umem: Support importing dma-buf as user memory region RDMA/core: Add device method for registering dma-buf based memory region RDMA/uverbs: Add uverbs command for dma-buf

[PATCH v10 6/6] dma-buf: Document that dma-buf size is fixed

2020-11-10 Thread Jianxin Xiong
The fact that the size of dma-buf is invariant over the lifetime of the buffer is mentioned in the comment of 'dma_buf_ops.mmap', but is not documented at where the info is defined. Add the missing documentation. Signed-off-by: Jianxin Xiong --- include/linux/dma-buf.h | 4 ++-- 1 file changed

[PATCH v10 3/6] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-11-10 Thread Jianxin Xiong
Implement a new uverbs ioctl method for memory registration with file descriptor as an extra parameter. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel Vetter --- drivers/infiniband/core/uverbs_std_types_mr.c | 122

[PATCH v10 2/6] RDMA/core: Add device method for registering dma-buf based memory region

2020-11-10 Thread Jianxin Xiong
Dma-buf based memory region requires one extra parameter and is processed quite differently. Adding a separate method allows clean separation from regular memory regions. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian Koenig Acked-by: Daniel

[PATCH v9 4/5] RDMA/mlx5: Support dma-buf based userspace memory region

2020-11-09 Thread Jianxin Xiong
Implement the new driver method 'reg_user_mr_dmabuf'. Utilize the core functions to import dma-buf based memory region and update the mappings. Add code to handle dma-buf related page fault. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked-by: Christian

[PATCH v9 5/5] dma-buf: Reject attach request from importers that use dma_virt_ops

2020-11-09 Thread Jianxin Xiong
-by: Jianxin Xiong --- drivers/dma-buf/dma-buf.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 9a054fb5..ba2b877 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -686,6 +686,11 @@ struct dma_buf_attachment

[PATCH v9 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-11-09 Thread Jianxin Xiong
the buffer is registered as a memory region, the file descriptor is passed to the RDMA driver along with other parameters. Implement the common code for importing dma-buf object and mapping dma-buf pages. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl Acked

  1   2   >