switch rpc_pipe_open_internal to use NDR marshalling
Stefan (metze) Metzmacher
metze at samba.org
Thu Jul 8 08:26:41 MDT 2010
> 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.
I think this is acceptable, because we gain so much from it:
- server and client are correctly decoupled, and the client can't overwrite
memory that belongs to the server and the server can't free memory the
- it makes my work on the dcerpc_binding_handle infrastructure much easier
as the backends only care about DATA_BLOBs.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 262 bytes
Desc: OpenPGP digital signature
More information about the samba-technical