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

Dma-buf related fixes #942

Merged
merged 3 commits into from Feb 9, 2021
Merged

Dma-buf related fixes #942

merged 3 commits into from Feb 9, 2021

Conversation

j-xiong
Copy link
Contributor

@j-xiong j-xiong commented Feb 4, 2021

This series fixes a few issues related to the dma-buf support. It consists
of three patches. The first patch fixes a compilation warning for 32-bit
builds. Patch 2 renames a function parameter and expands an abbreviation.
Patch 3 adds check for DRM headers.

@j-xiong j-xiong force-pushed the dmabuf-fixes branch 2 times, most recently from f18cae6 to ecc7ff2 Compare February 4, 2021 18:00
Commit 6b0a323 ("verbs: Support dma-buf based memory region") caused
a build failure when building for 32b systems with gcc:

$ mkdir build && cd build && CFLAGS="-m32" cmake -GNinja .. \
  -DIOCTL_MODE=both -DNO_PYVERBS=1 -DENABLE_WERROR=1 && ninja
...
../libibverbs/cmd_mr.c: In function 'ibv_cmd_reg_dmabuf_mr':
../libibverbs/cmd_mr.c:152:21: error: cast to pointer from integer of
different size [-Werror=int-to-pointer-cast]
  vmr->ibv_mr.addr = (void *)offset;
...
../libibverbs/verbs.c: In function 'ibv_reg_dmabuf_mr':
../libibverbs/verbs.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 <alialnu@nvidia.com>
Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
@j-xiong j-xiong force-pushed the dmabuf-fixes branch 2 times, most recently from dd53daf to b51580d Compare February 4, 2021 23:11
Rename the parameter 'unit' to 'gpu'. Expand GTT to the full name in the
comments.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
@j-xiong j-xiong force-pushed the dmabuf-fixes branch 2 times, most recently from 0b2477c to 3788aa8 Compare February 5, 2021 22:08
Compilation of pyverbs/dmabuf_alloc.c depends on a few DRM headers
that are installed by either the kernel-header or the libdrm package.
The installation is optional and the location is not unique.

Check the presence and location of the headers and, if the headers
are missing, replace the dmabuf allocation routines wth stubs that
return suitable error to allow the related tests to skip.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
@rleon rleon merged commit b3abcdb into linux-rdma:master Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants