[openib-general] Proposed device enumeration & async event APIs

Roland Dreier roland at topspin.com
Mon Sep 13 09:48:42 PDT 2004


    Grant> Can a client talk to multiple devices?  ie is the "data"
    Grant> more closely associated with the ib_device or with the
    Grant> ib_client?  Someplace, there has to be a 1:1 mapping or
    Grant> ib_get_client_data() can't work.

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).  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.

    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?

    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.  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.

Thanks,
  Roland



More information about the general mailing list