switch rpc_pipe_open_internal to use NDR marshalling
jra at samba.org
Thu Jul 8 13:21:12 MDT 2010
On Thu, Jul 08, 2010 at 02:26:44PM +0200, Guenther Deschner wrote:
> currently, the way we handle internal rpc pipes (in RAP to RPC, RPC to RPC
> and winbind to RPC scenarios) is highly effective (given the generated
> dispatch table) but rather problematic for two reasons:
> * Various fields of the IDL structs (all [value(X) elements) are only set
> during NDR push operations and thus remain unset in rpc_pipe_open_internal()
> * Memory allocation (in particular in,out pointers)
> Therefor I'd like to push this patch
> which would do change the handling of internal pipes to this model:
> Current model:
> CLI -> rpccli_INTERFACE_X -> _INTERFACE_X
> Proposed model:
> CLI -> rpccli_INTERFACE_X -> NDR_PUSH -> api_INTERFACE_X -> NDR_PULL
> Client opens pipe using rpc_pipe_open_internal(), no need to provide a
> dispatch anymore. The internal dispatch function first does ndr_push the
> r->in, calls the generated api_X function like the RPC server does when
> accessed from external and finally the dispatch function ndr_pulls out the
> result. This means there will be an additional NDR_PUSH(NDR_IN), NDR_PULL(NDR_IN),
> NDR_PUSH(NDR_OUT), NDR_PULL(NDR_OUT) for each rpccli_X function using the
> internal pipe.
> To give some numbers of some raw rpc testing (inside vfstest):
> * 100.000 rpccli_samr_GetDomPwInfo requests
> with NDR: 5 sec.
> w/o NDR: 3 sec.
> * 400.000 rpccli_lsa_lookupsids(S-1-5-32-544) requests:
> with NDR: 12 sec.
> w/o NDR: 4 sec.
> I think the performance loss is acceptable given that we would gain much
> more correctnes and a cleaner API this way.
> Ok, to push ?
I know you already pushed it, but I just wanted to record
my +1 vote. Nice work !
More information about the samba-technical