[openib-general] makiing ibverb.h transport neutral -- 2nd draft

Caitlin Bestler caitlinb at siliquent.com
Wed Jul 13 11:52:44 PDT 2005


That's pretty much an inherent problem.

The presumption is that most callers of rdma_poll_cq want
to apply transport neutral logic. This is especially easy
when no specific recovery plans are in place based upon
the specific error (the specific error just gets logged).

The weakness of the extensible sub-type approach is ensuring
that the receiving buffer is large enough -- struct sockaddr
being the classic example of this problem. The type 'struct
rdma_wc_storage' is intended to address this problem by
defining a type that can hold any of the results. The
presumption is that the consumer will note the type, and
if they wish to process tht type shift to a routine that
casts the wc to the required matching struct.

The alternative would be to use extensivel sub-types on
input, and unions for work completions. That works, but
could easily be confusing to developers.

On a lesser scale, the naming convention coulde be flipped
so that 'rdma_wc' represented adequate storage for the
worst case work completion, while 'struct rdma_wc_min'
would represent the minimal common header only.
 

> -----Original Message-----
> From: Sean Hefty [mailto:mshefty at ichips.intel.com] 
> Sent: Wednesday, July 13, 2005 11:24 AM
> To: Caitlin Bestler
> Cc: openib-general; rdma-developers at lists.sourceforge.net
> Subject: Re: [openib-general] makiing ibverb.h transport 
> neutral -- 2nd draft
> 
> Caitlin Bestler wrote:
> > The impact of this on the existing code would be quite 
> wide, but quite 
> > shallow. Many types would be renamed form 'ib_xyz'
> > to 'rdma_xyz', if being used in transport neutral code. Or when 
> > staying infiniband specific fields that now qualified as transport 
> > neutral would require "common." to be inserted before the 
> field name. 
> > Some constants are shifted from IB_XXX to RDMA_XXX.
> 
> Embedding a struct rdma_object inside a struct ib_object 
> essentially removes type checking from the API.  For example, 
> a user calling rdma_poll_cq() must know that they are using 
> IB and reference the correct data structure, such as:
> 
> struct ib_wc wc;
> 
> rdma_poll_cq(cq, 1, &wc.common);
> 
> Similarly for posting RDMA requests through rdma_post_send().
> 
> - Sean
> 



More information about the general mailing list