Quoting r. Roland Dreier <[EMAIL PROTECTED]>:
> Michael> BTW, opinions on the newer version I sent?
>
> I'm undecided. On the one hand, it seems like a reasonable thing to
> do. On the other hand, I'm not sure whether having two remove entry
> points is just going to confuse people.
OKay ... lets just add a flag to client instead.
struct ib_client {
char *name;
struct ib_client_data *(*add) (struct ib_device *);
void (*remove)(struct ib_device *, struct ib_client_data *);
int have_client_data;
struct list_head list;
};
Better?
> And in any case I don't see
> the real motivation for making the change now.
Type-safety is one. Cleaner memory management is another:
its better for clients to allocate their own memory,
as the two leaks that I sent patches for previously demonstrate.
An additional thinking behind this is: ULPs (e.g. SDP, CM)
need to keep lists of per-device objects and kill them on device
removal.
For example with change Sean proposes SDP will need to keep
a list of per-device cm_ids in each connection.
One idea, then, is in this example to make each cm_id a client,
then this list is managed by device.c
Client list then becomes very long, so its important to get
client data from device without scanning the client list.
--
MST
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general