[openib-general] Making gen2 transport neutral

Caitlin Bestler caitlinb at siliquent.com
Fri Jul 1 08:59:06 PDT 2005


While waiting to see if any of the champions of the
union form appear, I'd like to ask what the enum
equivalent of the non-union struct strategy would
look like.

I'm guessing it would take something like

	enum rdma_xyz {
		/* common values */
		RDMA_XYZ_A,
		RDMA_XYZ_B,
		RDMA_XYZ_C,

		/* IB specific values */
		IB_XYZ_D,
		IB_XYZ_E,

		/* iWARP specific values */
		IWARP_XYZ_F = RDMA_XYZ_C+1,
		IWARP_XYZ_G
	}

to 

	enum rdma_xyz { /* common values */
		RDMA_XYZ_A,
		RDMA_XYZ_B,
		RDMA_XYZ_C,
		RDMA_XYZ_LIM /* must be last */
	};

	enum ib_xyz { /* extends rdma_xyz */
		IB_XYZ_D = RDMA_XYZ_LIM,
		IB_XYZ_E
	};

	enum iwarp_xzy { /* extends iwarp_xyz */
		IWARP_XYZ_F = RDMA_XYZ_LIM,
		IWARP_XYZ_G;
	};

That way the transport dependent enums could even
be in transport dependent .h files, and only the
common ones would have to be in the main header file.
That would be very friendly for adding a third
transport at some later date (I still don't think
it will happen, but it would make it easier).
		
		 

> -----Original Message-----
> From: Christoph Hellwig [mailto:hch at lst.de] 
> Sent: Thursday, June 30, 2005 9:03 AM
> To: Caitlin Bestler
> Cc: openib-general; rdma-developers at lists.sourceforge.net
> Subject: Re: [openib-general] Making gen2 transport neutral
> 
> On Thu, Jun 30, 2005 at 08:52:54AM -0700, Caitlin Bestler wrote:
> > structs:
> > typically "struct ib_xyz" is transformed as follows:
> > 
> > 	struct ib_xyz {
> > 		/* Only IB specific fields remain */
> > 		/* In some cases fields have been split, because
> >              * iWARP allows two things to vary that IB had
> >              * locked together. SGE limits are the primary
> >              * example of this. iWARP can have different
> > 	 	 * limits on SGE size for each type of message
> > 		 */
> > 	};
> > 
> > 	struct iwarp_xyz {
> > 		/* equivalent iWARP specific fields */
> > 	};
> > 
> > 	struct rdma_xyz {
> > 		/* Transport neutral fields. Typically
> > 		 * a subset of what was in struct ib_xyz before
> > 		 */
> > 		union {
> > 			struct ib_xyz ib;
> > 			struct iwarp_xyz iwarp;
> > 		} xpt;
> > 	};
> 
> wrong way around, but we had that before.  It should be
> 
> struct ib_foo {
> 	struct rdma_foo common;
> 	...
> }
> 
> struct iwarp_foo {
> 	struct rdma_foo common;
> 	...
> }
> 
> see filesystem and network protocol private data for example 
> where why historically did it that union way and it didn't 
> work out at all long-term.
> 
> > I am assuming that returning a "not supported" error for irrelevant 
> > verbs is an acceptable burnden for all providers.
> 
> Even better make the methods implementing them optional and 
> let the upper layer return EOPNOTSUPP when it's not implemeneted.
> 
> 



More information about the general mailing list