All of lore.kernel.org
 help / color / mirror / Atom feed
* 10 more python test cases for rxe
@ 2021-10-13 14:43 Bob Pearson
  2021-10-13 15:00 ` Jason Gunthorpe
  0 siblings, 1 reply; 6+ messages in thread
From: Bob Pearson @ 2021-10-13 14:43 UTC (permalink / raw)
  To: Zhu Yanjun; +Cc: Jason Gunthorpe, Leon Romanovsky, linux-rdma

Zhu,

There are about 10 test cases in the python suite that do not run for rxe because

	... skipped "Device rxe0 doesn't have net interface"

Clearly this is wrong and I don't know how to address the root cause yet but the following
hack where enp0s3 is the actual net device that rxe0 is based on in my case enables these
test cases to run and it appears they all do.

diff --git a/tests/base.py b/tests/base.py

index 3460c546..d6fd29b8 100644

--- a/tests/base.py

+++ b/tests/base.py

@@ -240,10 +240,11 @@ class RDMATestCase(unittest.TestCase):

             if self.gid_type is not None and ctx.query_gid_type(port, idx) != \

                     self.gid_type:

                 continue

-            if not os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):

-                self.args.append([dev, port, idx, None, None])

-                continue

-            net_name = self.get_net_name(dev)

+            #if not os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):

+                #self.args.append([dev, port, idx, None, None])

+                #continue

+            #net_name = self.get_net_name(dev)

+            net_name = "enp0s3"

             try:

                 ip_addr, mac_addr = self.get_ip_mac_address(net_name)

             except (KeyError, IndexError):


Apparently base.py expects there to be a directory /sys/class/infiniband/rxe0/device/net
that contains another directory with the same name as enp0s3. When rdma-core builds the
kobj tree 'device/net' is not added to rxe0. There is a 'parent' plain file in rxe0 with
the contents enp0s3 so there should be an easy work around in base.py but I don't know if
there are other places where the 'device/net' branch is expected.

If you know the best approach to fixing this please let me know. In the mean time this
gives you a way to run the rdmacm test cases.

Bob

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 10 more python test cases for rxe
  2021-10-13 14:43 10 more python test cases for rxe Bob Pearson
@ 2021-10-13 15:00 ` Jason Gunthorpe
  2021-10-14 12:36   ` Zhu Yanjun
  0 siblings, 1 reply; 6+ messages in thread
From: Jason Gunthorpe @ 2021-10-13 15:00 UTC (permalink / raw)
  To: Bob Pearson; +Cc: Zhu Yanjun, Leon Romanovsky, linux-rdma, Edward Srouji

On Wed, Oct 13, 2021 at 09:43:28AM -0500, Bob Pearson wrote:
> Zhu,
> 
> There are about 10 test cases in the python suite that do not run for rxe because
> 
> 	... skipped "Device rxe0 doesn't have net interface"
> 
> Clearly this is wrong and I don't know how to address the root cause yet but the following
> hack where enp0s3 is the actual net device that rxe0 is based on in my case enables these
> test cases to run and it appears they all do.
> 
> diff --git a/tests/base.py b/tests/base.py
> 
> index 3460c546..d6fd29b8 100644
> 
> 
> +++ b/tests/base.py
> 
> @@ -240,10 +240,11 @@ class RDMATestCase(unittest.TestCase):
> 
>              if self.gid_type is not None and ctx.query_gid_type(port, idx) != \
> 
>                      self.gid_type:
> 
>                  continue
> 
> -            if not os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):
>
> -                self.args.append([dev, port, idx, None, None])
> 
> -                continue
> 
> -            net_name = self.get_net_name(dev)
> 
> +            #if not os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):

The pytests code is wrong - it should be querying the netdev through
the verbs APIs, not hacking in sysfs like this.

Jason

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 10 more python test cases for rxe
  2021-10-13 15:00 ` Jason Gunthorpe
@ 2021-10-14 12:36   ` Zhu Yanjun
  2021-10-20 10:27     ` Edward Srouji
  0 siblings, 1 reply; 6+ messages in thread
From: Zhu Yanjun @ 2021-10-14 12:36 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: Bob Pearson, Leon Romanovsky, linux-rdma, Edward Srouji

On Wed, Oct 13, 2021 at 11:00 PM Jason Gunthorpe <jgg@nvidia.com> wrote:
>
> On Wed, Oct 13, 2021 at 09:43:28AM -0500, Bob Pearson wrote:
> > Zhu,
> >
> > There are about 10 test cases in the python suite that do not run for rxe because
> >
> >       ... skipped "Device rxe0 doesn't have net interface"
> >
> > Clearly this is wrong and I don't know how to address the root cause yet but the following
> > hack where enp0s3 is the actual net device that rxe0 is based on in my case enables these
> > test cases to run and it appears they all do.
> >
> > diff --git a/tests/base.py b/tests/base.py
> >
> > index 3460c546..d6fd29b8 100644
> >
> >
> > +++ b/tests/base.py
> >
> > @@ -240,10 +240,11 @@ class RDMATestCase(unittest.TestCase):
> >
> >              if self.gid_type is not None and ctx.query_gid_type(port, idx) != \
> >
> >                      self.gid_type:
> >
> >                  continue
> >
> > -            if not os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):
> >
> > -                self.args.append([dev, port, idx, None, None])
> >
> > -                continue
> >
> > -            net_name = self.get_net_name(dev)
> >
> > +            #if not os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):
>
> The pytests code is wrong - it should be querying the netdev through
> the verbs APIs, not hacking in sysfs like this.

Got it. Thanks

Zhu Yanjun

>
> Jason

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: 10 more python test cases for rxe
  2021-10-14 12:36   ` Zhu Yanjun
@ 2021-10-20 10:27     ` Edward Srouji
  2021-10-20 11:39       ` Jason Gunthorpe
  2021-10-20 12:52       ` Yanjun Zhu
  0 siblings, 2 replies; 6+ messages in thread
From: Edward Srouji @ 2021-10-20 10:27 UTC (permalink / raw)
  To: Zhu Yanjun, Jason Gunthorpe; +Cc: Bob Pearson, Leon Romanovsky, linux-rdma

> On Wed, Oct 13, 2021 at 11:00 PM Jason Gunthorpe <jgg@nvidia.com> wrote:
> >
> > On Wed, Oct 13, 2021 at 09:43:28AM -0500, Bob Pearson wrote:
> > > Zhu,
> > >
> > > There are about 10 test cases in the python suite that do not run
> > > for rxe because
> > >
> > >       ... skipped "Device rxe0 doesn't have net interface"
> > >
> > > Clearly this is wrong and I don't know how to address the root cause
> > > yet but the following hack where enp0s3 is the actual net device
> > > that rxe0 is based on in my case enables these test cases to run and it
> appears they all do.
> > >
> > > diff --git a/tests/base.py b/tests/base.py
> > >
> > > index 3460c546..d6fd29b8 100644
> > >
> > >
> > > +++ b/tests/base.py
> > >
> > > @@ -240,10 +240,11 @@ class RDMATestCase(unittest.TestCase):
> > >
> > >              if self.gid_type is not None and
> > > ctx.query_gid_type(port, idx) != \
> > >
> > >                      self.gid_type:
> > >
> > >                  continue
> > >
> > > -            if not
> os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):
> > >
> > > -                self.args.append([dev, port, idx, None, None])
> > >
> > > -                continue
> > >
> > > -            net_name = self.get_net_name(dev)
> > >
> > > +            #if not
> os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):
> >
> > The pytests code is wrong - it should be querying the netdev through
> > the verbs APIs, not hacking in sysfs like this.
> 
> Got it. Thanks
> 
> Zhu Yanjun
> 
> >
> > Jason

I will modify the base test file to use verbs API instead of accessing the sysfs directly.
I wanted to do that using ibv_query_gid_ex to get the netdev ifindex, but in case of IB (IPoIB) the netdex is just 0 and not updated accordingly.
Not sure if it's a bug or by design (looks like a bug for me).
I'll check that and update accordingly.

Thanks,
Edward.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 10 more python test cases for rxe
  2021-10-20 10:27     ` Edward Srouji
@ 2021-10-20 11:39       ` Jason Gunthorpe
  2021-10-20 12:52       ` Yanjun Zhu
  1 sibling, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2021-10-20 11:39 UTC (permalink / raw)
  To: Edward Srouji; +Cc: Zhu Yanjun, Bob Pearson, Leon Romanovsky, linux-rdma

On Wed, Oct 20, 2021 at 10:27:08AM +0000, Edward Srouji wrote:

> I will modify the base test file to use verbs API instead of accessing the sysfs directly.
> I wanted to do that using ibv_query_gid_ex to get the netdev ifindex, but in case of IB (IPoIB) the netdex is just 0 and not updated accordingly.
> Not sure if it's a bug or by design (looks like a bug for me).
> I'll check that and update accordingly.

IB does not have IP based GIDs, so it is not a bug.

To find the ipoib interface you need to scan all the ipoib devices and
match them to their IB devices, there can be many due to pkeys.

Jason

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 10 more python test cases for rxe
  2021-10-20 10:27     ` Edward Srouji
  2021-10-20 11:39       ` Jason Gunthorpe
@ 2021-10-20 12:52       ` Yanjun Zhu
  1 sibling, 0 replies; 6+ messages in thread
From: Yanjun Zhu @ 2021-10-20 12:52 UTC (permalink / raw)
  To: Edward Srouji, Zhu Yanjun, Jason Gunthorpe
  Cc: Bob Pearson, Leon Romanovsky, linux-rdma

在 2021/10/20 18:27, Edward Srouji 写道:
>> On Wed, Oct 13, 2021 at 11:00 PM Jason Gunthorpe <jgg@nvidia.com> wrote:
>>>
>>> On Wed, Oct 13, 2021 at 09:43:28AM -0500, Bob Pearson wrote:
>>>> Zhu,
>>>>
>>>> There are about 10 test cases in the python suite that do not run
>>>> for rxe because
>>>>
>>>>        ... skipped "Device rxe0 doesn't have net interface"
>>>>
>>>> Clearly this is wrong and I don't know how to address the root cause
>>>> yet but the following hack where enp0s3 is the actual net device
>>>> that rxe0 is based on in my case enables these test cases to run and it
>> appears they all do.
>>>>
>>>> diff --git a/tests/base.py b/tests/base.py
>>>>
>>>> index 3460c546..d6fd29b8 100644
>>>>
>>>>
>>>> +++ b/tests/base.py
>>>>
>>>> @@ -240,10 +240,11 @@ class RDMATestCase(unittest.TestCase):
>>>>
>>>>               if self.gid_type is not None and
>>>> ctx.query_gid_type(port, idx) != \
>>>>
>>>>                       self.gid_type:
>>>>
>>>>                   continue
>>>>
>>>> -            if not
>> os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):
>>>>
>>>> -                self.args.append([dev, port, idx, None, None])
>>>>
>>>> -                continue
>>>>
>>>> -            net_name = self.get_net_name(dev)
>>>>
>>>> +            #if not
>> os.path.exists('/sys/class/infiniband/{}/device/net/'.format(dev)):
>>>
>>> The pytests code is wrong - it should be querying the netdev through
>>> the verbs APIs, not hacking in sysfs like this.
>>
>> Got it. Thanks
>>
>> Zhu Yanjun
>>
>>>
>>> Jason
> 
> I will modify the base test file to use verbs API instead of accessing the sysfs directly.
> I wanted to do that using ibv_query_gid_ex to get the netdev ifindex, but in case of IB (IPoIB) the netdex is just 0 and not updated accordingly.
> Not sure if it's a bug or by design (looks like a bug for me).
> I'll check that and update accordingly.

Hope all the test cases are ready.

Zhu Yanjun

> 
> Thanks,
> Edward.
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-20 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 14:43 10 more python test cases for rxe Bob Pearson
2021-10-13 15:00 ` Jason Gunthorpe
2021-10-14 12:36   ` Zhu Yanjun
2021-10-20 10:27     ` Edward Srouji
2021-10-20 11:39       ` Jason Gunthorpe
2021-10-20 12:52       ` Yanjun Zhu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.