All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: "ira.weiny" <ira.weiny@intel.com>
Cc: "Vishwanathapura,
	Niranjana" <niranjana.vishwanathapura@intel.com>,
	Doug Ledford <dledford@redhat.com>,
	linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	Dennis Dalessandro <dennis.dalessandro@intel.com>
Subject: Re: [RFC 02/10] IB/hfi-vnic: Virtual Network Interface Controller (VNIC) Bus driver
Date: Tue, 22 Nov 2016 17:49:32 -0700	[thread overview]
Message-ID: <20161123004932.GA13598@obsidianresearch.com> (raw)
In-Reply-To: <20161123000502.GA27968@phlsvsds.ph.intel.com>

On Tue, Nov 22, 2016 at 07:05:05PM -0500, ira.weiny wrote:
> On Tue, Nov 22, 2016 at 10:04:07AM -0700, Jason Gunthorpe wrote:
> > On Mon, Nov 21, 2016 at 05:53:04PM -0800, Vishwanathapura, Niranjana wrote:
> > > There are many example drivers in kernel which are using bus_register() in
> > > an initcall.
> > 
> > There really are not, certainly not in major subsystems.
> 
> I see 2 drivers in the Block subsystem which do this:
> 
> 
> 19   5354  /nfs/site/home/iweiny/linux-stable/drivers/block/cciss.c <<cciss_init>>
> 	err = bus_register(&cciss_bus_type);
> 20   6447 /nfs/site/home/iweiny/linux-stable/drivers/block/rbd.c <<rbd_sysfs_init>>
> 	ret = bus_register(&rbd_bus_type);
> 
> 2 drivers in the drm subsystem which do this:
> 
> 
> 29   1155  /nfs/site/home/iweiny/linux-stable/drivers/gpu/drm/drm_mipi_dsi.c <<mipi_dsi_bus_init>>
> 	return bus_register(&mipi_dsi_bus_type);
> 30    242 /nfs/site/home/iweiny/linux-stable/drivers/gpu/host1x/dev.c <<tegra_host1x_init>>
> 	err = bus_register(&host1x_bus_type);

IMHO this is all obscure or legacy stuff (eg ccsiss lost its bus when
it was reworked into hpsa). Who knows about that SOC stuff, maybe
there really is a special on-chip bus under those drivers.

The point is using a bus as a generic interconnect between two driver
modules seems very rare, and is not what we have historically ever
done in drivers/infiniband - all our split drivers use a trivial
register scheme. eg see cxgb4_register_uld/mlx4_register_interface/etc.

Should a multi-function driver use a bus or class to connect its
parts? Who knows. Maybe Greg KH/etc has an opinion. But that is not
what we have been doing, it doesn't seem very simplifying, and
this series doesn't even make module auto-loading work...

Since doing this creates a bunch of uapis (again, from a driver, ugh) it
seems like a bad idea without more support as 'the right way'

.. and yes, it would be nice to have a lightweight mechanism to
replace those register functions that could handle module auto loading
too, and maybe that is a 'multi part driver bus/class' or somesuch
... This is really a topic for the device core maintainers, IMHO.

> > > We could add a custom Interface between HFI1 driver and hfi_vnic drivers
> > > without involving a bus.
> > 
> > hfi is already registering on the infiniband class, just use that.
> 
> I don't understand what you mean here?

Get the struct ib_device for the hfi and then do something to get hfi
specific function calls.

Or work it backwards with a _register function..

> [*] As an aside why does the ib_core not use this methodology?  It dawned on
> me that this may be a better way to fix our module load problems.  However, I
> have not looked into details.

ib_core is a class, which is appropriate. RDMA devices are not busses.

Jason

  reply	other threads:[~2016-11-23  0:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 22:42 [RFC 00/10] HFI Virtual Network Interface Controller (VNIC) Vishwanathapura, Niranjana
2016-11-18 22:42 ` [RFC 05/10] IB/hfi-vnic: VNIC statistics support Vishwanathapura, Niranjana
2016-11-18 22:42 ` [RFC 06/10] IB/hfi-vnic: VNIC MAC table support Vishwanathapura, Niranjana
     [not found] ` <1479508938-63799-1-git-send-email-niranjana.vishwanathapura-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-18 22:42   ` [RFC 01/10] IB/hfi-vnic: Virtual Network Interface Controller (VNIC) documentation Vishwanathapura, Niranjana
2016-11-18 22:42   ` [RFC 02/10] IB/hfi-vnic: Virtual Network Interface Controller (VNIC) Bus driver Vishwanathapura, Niranjana
2016-11-19 19:04     ` Jason Gunthorpe
2016-11-21 21:30       ` Vishwanathapura, Niranjana
2016-11-21 21:39         ` Jason Gunthorpe
2016-11-21 23:26           ` Vishwanathapura, Niranjana
     [not found]             ` <20161121232629.GA67988-wPcXA7LoDC+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-11-21 23:31               ` Jason Gunthorpe
     [not found]                 ` <20161121233118.GA31132-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-22  1:53                   ` Vishwanathapura, Niranjana
2016-11-22 17:04                     ` Jason Gunthorpe
2016-11-22 19:49                       ` Vishwanathapura, Niranjana
     [not found]                         ` <20161122194918.GA69241-wPcXA7LoDC+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-11-22 23:04                           ` Christoph Lameter
2016-11-23  0:53                             ` Vishwanathapura, Niranjana
2016-11-23  0:06                         ` Andrew Lunn
     [not found]                       ` <20161122170407.GE3956-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-23  0:05                         ` ira.weiny
2016-11-23  0:49                           ` Jason Gunthorpe [this message]
     [not found]                             ` <20161123004932.GA13598-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-24  0:08                               ` Vishwanathapura, Niranjana
     [not found]                                 ` <20161124000825.GA73280-wPcXA7LoDC+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-11-24 16:15                                   ` Jason Gunthorpe
     [not found]                                     ` <20161124161545.GA20818-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-25  2:13                                       ` Vishwanathapura, Niranjana
     [not found]                                         ` <20161125021350.GA74946-wPcXA7LoDC+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-11-25 19:05                                           ` Jason Gunthorpe
     [not found]                                             ` <20161125190509.GB16504-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-29  6:31                                               ` Vishwanathapura, Niranjana
     [not found]                                                 ` <20161129063106.GB84990-wPcXA7LoDC+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-11-29 16:19                                                   ` Jason Gunthorpe
     [not found]                                                     ` <20161129161950.GB742-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-29 16:44                                                       ` Hefty, Sean
2016-11-29 16:50                                                         ` Jason Gunthorpe
     [not found]                                                           ` <20161129165009.GA3167-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-12-01  7:39                                                             ` Vishwanathapura, Niranjana
2016-11-29  6:29                                       ` Vishwanathapura, Niranjana
     [not found]                                         ` <20161129062938.GA84990-wPcXA7LoDC+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-11-29 16:21                                           ` Jason Gunthorpe
     [not found]                                             ` <20161129162113.GC742-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-12-01  7:41                                               ` Vishwanathapura, Niranjana
2016-11-18 22:42   ` [RFC 03/10] IB/hfi-vnic: Virtual Network Interface Controller (VNIC) netdev driver Vishwanathapura, Niranjana
2016-11-18 22:42   ` [RFC 04/10] IB/hfi-vnic: VNIC Ethernet Management (EM) structure definitions Vishwanathapura, Niranjana
2016-11-18 22:42   ` [RFC 07/10] IB/hfi-vnic: VNIC Ethernet Management Agent (VEMA) interface Vishwanathapura, Niranjana
2016-11-18 22:42   ` [RFC 08/10] IB/hfi-vnic: VNIC Ethernet Management Agent (VEMA) driver Vishwanathapura, Niranjana
2016-11-18 22:42   ` [RFC 10/10] IB/hfi1: VNIC SDMA support Vishwanathapura, Niranjana
2016-11-18 22:42 ` [RFC 09/10] IB/hfi1: Virtual Network Interface Controller (VNIC) support Vishwanathapura, Niranjana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161123004932.GA13598@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=dennis.dalessandro@intel.com \
    --cc=dledford@redhat.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=niranjana.vishwanathapura@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.