[Lustre-devel] Query to understand the Lustre request/reply message

Nicolas Williams Nicolas.Williams at oracle.com
Wed Oct 13 17:28:45 PDT 2010


On Wed, Oct 13, 2010 at 07:51:37PM -0400, Vilobh Meshram wrote:
> 1) Is it possible that without writing a new RPC in Lustre 1.8.1.1 I can
> append some string such as "Hello" to the exsisting message sent by the
> Client (with the buffer size set at client side by the count,size fields).I
> tried modifying the "size" of the request for one of the RPC in-built in
> Lustre

Yes, it's possible to add buffers to requests.  It's not possible to add
buffers to _replies_ to existing RPCs unless you know the client expects
those additional buffers -- existing clients expect a given maxsize for
each reply, and if your reply is bigger then it will get dropped.

>          __u32 size[2] = { [MSG_PTLRPC_BODY_OFF] = sizeof(struct
> ptlrpc_body),
>                                     [DLM_LOCKREQ_OFF]     = sizeof(struct
> ldlm_request) };
> 
> ---->>
>      __u32 size[3] = { [MSG_PTLRPC_BODY_OFF] = sizeof(struct ptlrpc_body),
>                                   [DLM_LOCKREQ_OFF]     = sizeof(struct
> ldlm_request) ,
>                                   //how to add "char *str=Hello" ofcourse we
> will have sizeof(str) but how to choose the MACRO like DLM_LOCKREQ_OFF bcz
> for a specific kind of RPC there are limited number of such MACROS
>                                             };

Add a buffer.  Don't change the size of an existing buffer.

> The thing I want to know is how can I send a buffer from the client side by
> modifying the static structure "size" mentioned above.What all main places
> do I need to consider to make this work.

Add an element to the size[] array, then set it to the correct size when
you know the length of the string.  Look at the SET_INFO RPCs.

> If the above step i.e appending a buffer in the "size" array is not possible
> then I can move to write a new RPC.

The size[] array is just a convenient place to store the sizes of the
individual buffers while you construct them.

Nico
-- 



More information about the lustre-devel mailing list