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

Xiong, Jianxin jianxin.xiong at intel.com
Mon Feb 1 17:12:36 UTC 2021


> -----Original Message-----
> From: John Hubbard <jhubbard at nvidia.com>
> Sent: Sunday, January 31, 2021 12:45 AM
> To: Xiong, Jianxin <jianxin.xiong at intel.com>; linux-rdma at vger.kernel.org; dri-devel at lists.freedesktop.org
> Cc: Doug Ledford <dledford at redhat.com>; Jason Gunthorpe <jgg at ziepe.ca>; Leon Romanovsky <leon at kernel.org>; Sumit Semwal
> <sumit.semwal at linaro.org>; Christian Koenig <christian.koenig at amd.com>; Vetter, Daniel <daniel.vetter at intel.com>; Edward Srouji
> <edwards at nvidia.com>; Yishai Hadas <yishaih at 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 at 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


More information about the dri-devel mailing list