[openib-general] userspace CM API for per device handling

Roland Dreier rolandd at cisco.com
Wed Sep 14 12:39:49 PDT 2005


> ibv_get_async_event(int fd, struct ibv_async_event *event);
> ibv_get_cq_event(int fd, struct ibv_cq **cq, void **cq_context);

This seems like mostly pain with little gain to me.  A consumer doing
a poll or something with multiple file descriptors still needs some
mapping to some per-fd context so that it knows which fds are CQ event
fds, which ones are async event fds, and which ones are neither.  So
it's pretty easy to go back to a verbs context.

The advantage of going through the verbs context when reading events
is that it makes it harder to pass a bogus fd into the functions.  If
an app passes an inappropriate fd into an API like the one above, then
some funky bugs could be introduced.

I'm not dead-set here, but making this change seems like a net loss to me.

If we wanted to be more symmetrical, we could have a CM API like

    struct ib_cm_context *ib_cm_get_context(struct ibv_context *dev_context);
    int ib_cm_get_event(struct ib_cm_context *context, struct ib_cm_event **event);

 - R.



More information about the general mailing list