[openib-general] Proposed device enumeration & async event APIs
Grant Grundler
iod00d at hp.com
Mon Sep 13 11:46:07 PDT 2004
On Mon, Sep 13, 2004 at 09:48:42AM -0700, Roland Dreier wrote:
> I don't quite follow this question. The data is associated with the
> pair (device, client). One client can talk to multiple devices (eg
> IPoIB using all the HCAs in a system), and multiple clients can talk
> to a single device (eg IPoIB and SDP sharing an HCA).
This sounds no different than say tulip driver which might claim
multiple 100BT cards below different PCI Busses.
I expect each client to have some data structure to track state info
and each "parent" device must know something about it. Ie when
the parent device goes away, each related client instance must
be notified. Or is that not true either?
> If you look at
> the implementation ob ib_get_client_data() that I posted it should be
> pretty clear how things work. I chose to keep a list of client data
> in each device, but that's just an implementation detail.
I did look - but the implementation doesn't tell me about the N:M vs 1:1.
> Grant> This feels like it shouldn't be necessary. PCI has dealt
> Grant> with the 1:N relationship well before a driver gets
> Grant> associated with a device and might call pci_set_drvdata().
>
> I'm not sure what you're referring to here. What is the 1 and what is
> the M in this relationship?
PCI Host bus controller is "1" and PCI devices are "N".
>
> Grant> The 1:N relationship (ib_device:ib_client) needs to be
> Grant> dealt with at a different level or earlier in the
> Grant> initialization sequence. Is that not possible?
>
> It's actually an M:N relationship.
At a higher level it is. But it seems that each client must have it's
own data structure in order to track events/activity.
> I don't see a way to avoid dynamic
> allocation, since both devices and clients can be added and removed at
> any time in any order, and we have no way of knowing in advance what
> the maximum number of devices or clients is going to be.
I agree we can't avoid the dynamic allocation.
But we can choose when it happens.
I'm just questioning if it really needs to happen in get/set private data.
I'm thinking it should happen during some part of the initialization
and removal of specific instances of a client.
thanks,
grant
More information about the general
mailing list