lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170315155802.GB29562@obsidianresearch.com>
Date:   Wed, 15 Mar 2017 09:58:02 -0600
From:   Jason Gunthorpe <jgunthorpe@...idianresearch.com>
To:     Leon Romanovsky <leonro@...lanox.com>
Cc:     Erez Shitrit <erezsh@....mellanox.co.il>,
        "Vishwanathapura, Niranjana" <niranjana.vishwanathapura@...el.com>,
        Erez Shitrit <erezsh@...lanox.com>,
        Doug Ledford <dledford@...hat.com>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        netdev@...r.kernel.org, valex@...lanox.com, saedm@...lanox.com
Subject: Re: [RFC v1 for accelerated IPoIB 05/25] IB/ipoib: Support ipoib
 acceleration options callbacks

On Wed, Mar 15, 2017 at 08:47:51AM +0200, Leon Romanovsky wrote:
> On Tue, Mar 14, 2017 at 10:00:21AM -0600, Jason Gunthorpe wrote:
> > On Tue, Mar 14, 2017 at 04:42:55PM +0200, Erez Shitrit wrote:
> > > >> +       if (!hca->alloc_rdma_netdev)
> > > >> +               dev = ipoib_create_netdev_default(hca, name,
> > > >> ipoib_setup_common);
> > > >> +       else
> > > >> +               dev = hca->alloc_rdma_netdev(hca, port, RDMA_NETDEV_IPOIB,
> > > >> +                                            name, NET_NAME_UNKNOWN,
> > > >> +                                            ipoib_setup_common);
> > > >> +       if (!dev) {
> > > >> +               kfree(priv);
> > > >> +               return NULL;
> > > >> +       }
> > > >
> > > >
> > > > This will break ipoib on hfi1 as hfi1 will define alloc_rdma_netdev for
> > > > OPA_VNIC type. We should probably look for a dedicated return type
> > > > (-ENODEV?) to determine of the driver supports specified rdma netdev type.
> > > > Or use a ib device attribute to suggest driver support ipoib rdma netdev.
> > >
> > > sorry, I don't understand that, we are in ipoib driver, so the type is
> > > RDMA_NETDEV_IPOIB, if hfi wants to implement it should use the same
> > > flag, and to use OPA_VNIC for vnic.
> >
> > He means it should look like this:
> >
> >  if (hca->alloc_rdma_netdev)
> >      dev = hca->alloc_rdma_netdev(hca, port, RDMA_NETDEV_IPOIB,
> >                                             name, NET_NAME_UNKNOWN,
> >                                             ipoib_setup_common);
> >
> >  if (IS_ERR(dev) && PTR_ERR(dev) != ENOTSUP)
> >       goto out;
> >
> >  dev = ipoib_create_netdev_default(hca, name, ipoib_setup_common);
> >  if (IS_ERR(dev))
> >       goto out;
> >
> >  WARN_ON(dev == NULL);
> >
> >   [...]
> >
> > out:
> >       return PTR_ERR(dev);
> >
> > And I'm confused why 'ipoib_create_netdev_default' doesn't need the
> > same function signature as hca->alloc_rdma_netdev
> 
> And now, I'm confused.
> In your's proposal, the "dev" will be overwritten, in Erez's proposal,
> "dev" will be one of two: defaults or device specific.

Well, not Erez's version allowed dev to be ERR_PTR too. More like this then

struct rdma_netdev *get_netdev(..)
{
   if (hca-alloc_rdma_netdev) {
       dev = hca-alloc_rdma_netdev(hca, port, RDMA_NETDEV_IPOIB,
                                              name, NET_NAME_UNKNOWN,
                                              ipoib_setup_common);
 
       if (!IS_ERR(dev) || PTR_ERR(dev) != ENOTSUP)
           return dev;
   }
 
   return ipoib_create_netdev_default(hca, name, ipoib_setup_common);
}

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ