[openib-general] Re: [PATCH] Don't require create_ah and modify_port provider methods

Michael S. Tsirkin mst at mellanox.co.il
Wed Mar 15 12:23:51 PST 2006


Quoting r. Sean Hefty <mshefty at ichips.intel.com>:
> Subject: Re: [PATCH] Don't require create_ah and?modify_port provider methods
> 
> Steve Wise wrote:
> >>>Here is a patch that allows me to remove all the stub/ENOSYS methods
> >>>from the chelsio provider.  I tested this on the main trunk by running
> >>>ibv_rc_pingpong and rping over mthca.
> >>
> >>Steve, what's wrong with chelsio driver providing ENOSYS stubs?
> >>
> >>All you are doing is making the code path longer for
> >>drivers that do provide those entry points.
> >>
> >>grant
> >>
> >This patch is in response to a review comment from Roland.  He didn't
> >want providers to have to stub these. 
> 
> I'm not even sure this is possible, but could we create an rdma_nosys() 
> routine that takes a variable arguments and simply returns -ENOSYS, and set 
> all unimplemented functions to reference that routine?  This could be done 
> in the core, and would avoid branches in the code paths.
> 
> - Sean

I think in ANSI C won't let you do this.

But we can have separate static ENOSYS stubs for each field, and fill them in
instead of NULL pointers on device registration.

BTW, would be good for IB devices too, and will let us kill a bunch
of checks spread over the core right now.

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies



More information about the general mailing list