[ofiwg] lifabric provider extensions

Reese Faucette (rfaucett) rfaucett at cisco.com
Fri Oct 31 10:07:37 PDT 2014


I have this idea of how providers might add calls in the rare event its needed, but would like to run it by the list for comments.
Let's say provider xyzzy supportsa new call AV-related call, "fi_av_xyzzy_add_flux()".  The would be a new header "fi_xyzzy.h" and "xyzzy_av.c" as shown below.

Does this seem sane?  I think the "version" passed to fi_getinfo can be used to deal with fi_ops_av growing wrt. Backwards compatability.

Thanks,
-reese

======= fi_xyzzy.h ========

struct fi_ops_av_xyzzy {
       struct fi_ops_av base_ops;
       int (*add_flux)(struct fid_av *av, ssize_t flux_value);
};

static inline int
fi_av_xyzzy_add_flux(struct fid_av *av, ssize_t flux_value)
{
       return ((struct fi_ops_av_xyzzy *)av->ops)->
              add_flux(av, value);
}

====== xyzzy_av.c ==========

struct fi_ops_av_xyzzy xyzzy_av_ops = {
       .base_ops = {
              .size = sizeof(struct fi_ops_av_xyzzy),
              .insert = xyzzy_av_insert,
              ...
       },
       .add_flux = xyzzy_av_add_flux;
};

int xyzzy_av_open(...)
{
       ...
       av->ops = (struct fi_ops_av *)&xyzzy_av_ops;
       ...
       return 0;
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofiwg/attachments/20141031/2633c405/attachment.html>


More information about the ofiwg mailing list