-----Original Message----- From: John Hubbard jhubbard@nvidia.com Sent: Sunday, January 31, 2021 12:45 AM To: Xiong, Jianxin jianxin.xiong@intel.com; linux-rdma@vger.kernel.org; dri-devel@lists.freedesktop.org Cc: Doug Ledford dledford@redhat.com; Jason Gunthorpe jgg@ziepe.ca; Leon Romanovsky leon@kernel.org; Sumit Semwal sumit.semwal@linaro.org; Christian Koenig christian.koenig@amd.com; Vetter, Daniel daniel.vetter@intel.com; Edward Srouji edwards@nvidia.com; Yishai Hadas yishaih@nvidia.com Subject: Re: [PATCH rdma-core v7 5/6] tests: Add tests for dma-buf based memory regions
On 1/25/21 11:57 AM, Jianxin Xiong wrote:
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 jianxin.xiong@intel.com
Hi Jianxin,
It's awesome to see a GPU to IB test suite here!
tests/args_parser.py | 4 + tests/test_mr.py | 266 ++++++++++++++++++++++++++++++++++++++++++++++++++- tests/utils.py | 26 +++++ 3 files changed, 295 insertions(+), 1 deletion(-)
diff --git a/tests/args_parser.py b/tests/args_parser.py index 446535a..5bc53b0 100644 --- a/tests/args_parser.py +++ b/tests/args_parser.py @@ -19,6 +19,10 @@ class ArgsParser(object): parser.add_argument('--port', help='Use port <port> of RDMA device', type=int, default=1)
parser.add_argument('--gpu', nargs='?', type=int, const=0, default=0,
help='GPU unit to allocate dmabuf from')
parser.add_argument('--gtt', action='store_true', default=False,
help='Allocate dmabuf from GTT instead of
- VRAM')
Just to be kind to non-GPU people, how about:
s/GTT/GTT (Graphics Translation Table)/
<...>
+def check_dmabuf_support(unit=0):
- """
- Check if dma-buf allocation is supported by the system.
- Skip the test on failure.
- """
- device_num = 128 + unit
- try:
DmaBuf(1, unit=unit)
unit?? This is a GPU, never anything else! Let's s/unit/gpu/ throughout, yes?
Thanks for the feedback. Will integrate the suggestions in upcoming patch.
Jianxin