[PATCH v5 2/5] RDMA/core: Add device method for registering dma-buf base memory region

2020-10-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 v5 1/5] RDMA/umem: Support importing dma-buf as user memory region

2020-10-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 v5 4/5] RDMA/mlx5: Support dma-buf based userspace memory region

2020-10-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 v5 3/5] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-10-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 --- drivers/infiniband/core/uverbs_std_types_mr.c | 112

[PATCH v5 5/5] dma-buf: Clarify that dma-buf sg lists are page aligned

2020-10-15 Thread Jianxin Xiong
The dma-buf API have been used under the assumption that the sg lists returned from dma_buf_map_attachment() are fully page aligned. Lots of stuff can break otherwise all over the place. Clarify this in the documentation and add a check when DMA API debug is enabled. Signed-off-by: Jianxin Xiong

[PATCH v5 0/5] RDMA: Add dma-buf support

2020-10-15 Thread Jianxin Xiong
. Patch 4 adds dma-buf support to the mlx5 driver. Patch 5 adds clarification to the dma-buf API documentation that dma-buf sg lists are page aligned. Related user space RDMA library changes will be provided as a separate patch series. Jianxin Xiong (5): RDMA/umem: Support importing dma-buf as user

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

2020-10-04 Thread Jianxin Xiong
Add uverbs command for registering user memory region associated with a dma-buf file descriptor. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl --- drivers/infiniband/core/uverbs_std_types_mr.c | 115 ++ include/uapi/rdma

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

2020-10-04 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 --- drivers

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

2020-10-04 Thread Jianxin Xiong
a new uverbs command for registering dma-buf based memory region. Related user space RDMA library changes will be provided as a separate patch series. Jianxin Xiong (4): RDMA/umem: Support importing dma-buf as user memory region RDMA: Expand driver memory registration methods to support dma

[RFC PATCH v3 2/4] RDMA: Expand driver memory registration methods to support dma-buf

2020-10-04 Thread Jianxin Xiong
-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl --- drivers/infiniband/core/uverbs_cmd.c| 25 +--- drivers/infiniband/core/verbs.c | 15 ++-- drivers/infiniband/hw/bnxt_re/ib_verbs.c| 23 +-- drivers/infiniband/hw/bnxt_re

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

2020-10-04 Thread Jianxin Xiong
the difference. Signed-off-by: Jianxin Xiong Reviewed-by: Sean Hefty Acked-by: Michael J. Ruhl --- drivers/infiniband/hw/mlx5/mr.c | 50 +--- drivers/infiniband/hw/mlx5/odp.c | 22 -- 2 files changed, 67 insertions(+), 5 deletions(-) diff

[PATCH v4 2/5] RDMA/core: Add device method for registering dma-buf base memory region

2020-10-14 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 --- drivers

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

2020-10-14 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 v4 3/5] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-10-14 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 --- drivers/infiniband/core/uverbs_std_types_mr.c | 112

[PATCH v4 0/5] RDMA: Add dma-buf support

2020-10-14 Thread Jianxin Xiong
that dma-buf sg lists are page aligned. Related user space RDMA library changes will be provided as a separate patch series. Jianxin Xiong (5): RDMA/umem: Support importing dma-buf as user memory region RDMA/core: Add device method for registering dma-buf base memory region RDMA/uverbs: Add

[PATCH v4 5/5] dma-buf: Clarify that dma-buf sg lists are page aligned

2020-10-14 Thread Jianxin Xiong
The dma-buf API have been used under the assumption that the sg lists returned from dma_buf_map_attachment() are fully page aligned. Lots of stuff can break otherwise all over the place. Clarify this in the documentation and add a check when DMA API debug is enabled. Signed-off-by: Jianxin Xiong

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

2020-10-14 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 v6 0/4] RDMA: Add dma-buf support

2020-10-23 Thread Jianxin Xiong
aligned. Related user space RDMA library changes will be 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 base memory region RDMA/uverbs: Add uverbs command for dma-buf based

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

2020-10-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 v6 1/4] RDMA/umem: Support importing dma-buf as user memory region

2020-10-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 v6 3/4] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-10-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 | 112

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

2020-10-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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 v9 0/5] RDMA: Add dma-buf support

2020-11-09 Thread Jianxin Xiong
user space RDMA library changes will be provided as a separate patch series. Jianxin Xiong (5): 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

[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

[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 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 3/5] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-11-09 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 v9 2/5] RDMA/core: Add device method for registering dma-buf based memory region

2020-11-09 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 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 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 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 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 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] dma-buf: Fix static checker warning

2020-11-02 Thread Jianxin Xiong
igned") Reported-by: Dan Carpenter Signed-off-by: Jianxin Xiong --- drivers/dma-buf/dma-buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 556f62e..0eb80c1 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/d

[PATCH v7 0/5] RDMA: Add dma-buf support

2020-11-04 Thread Jianxin Xiong
and reject the request if so. Related user space RDMA library changes will be provided as a separate patch series. Jianxin Xiong (5): 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

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

2020-11-04 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 v7 3/5] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-11-04 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 | 112

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

2020-11-04 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 v7 4/5] RDMA/mlx5: Support dma-buf based userspace memory region

2020-11-04 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 v7 2/5] RDMA/core: Add device method for registering dma-buf based memory region

2020-11-04 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 v8 2/5] RDMA/core: Add device method for registering dma-buf based memory region

2020-11-05 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

  1   2   >