[Pvfs2-developers] protocol encoding
murali.vilayannur at gmail.com
Wed Jan 30 12:39:04 EST 2008
> In src/proto/pvfs2-req-proto.h when you define a new request you create
> a struct and then use a macro to create an encoding function for the
> struct (endecode_fields_X_struct). Sometimes, in the args to those
> macros you insert a skip4,, which I gather is used to align something.
> Can someone explain the rules for when and where you place this?
ia64 and/or x86_64 likes pointers aligned on 8 byte boundaries.
Unaligned access to memory via a pointer can cause one or more of the
following I think
- slower performance
- segmentation faults
skip4 is needed only when pointers are involved as far as I
understand. You don't need those when accessing scalar types.
> There is also some confusion as to the naming of those macros, in that
> some of them seem to count the skip4,, and some don't. In particular,
> if there are 3 scalar arguments, but we need one skip, we use the
> endecode_fields_4_struct macro - so we DO count the skip (3 args + skip
> = 4) but if there is an array, say 3 scalars plus an array, we use the
> endecode_fields_3a_struct macro - so we DO NOT count the skip. Some
> array macros have one, some have two skips. Any words of wisdom, or do
> we just have to look it up in the code?
yeah.. I think that needs to be fixed. If I am not mistaken, the
number in the naming convention must include the skip4 also.
As regards to why some array macros have one and some have two skips
is because the former embeds only 1 pointer while the latter embeds
two sets of arrays along with the count.
Since the count is typically 4 bytes, we insert a skip4 and then drop
the array after that.
> For those who are interested, the first thing we are working on is
> Phil's server-to-server enabled file create. In the first step we are
> migrating the client create syscall functionality to the server, then we
> will work on implementing collective communication. Right now we are
> trying to figure out to what extent we can use the new state machine
> features to simplify that by essentially starting a client state machine
> on the server. Any input on that activity is encouraged.
> Dr. Walter B. Ligon III
> Associate Professor
> ECE Department
> Clemson University
> Pvfs2-developers mailing list
> Pvfs2-developers at beowulf-underground.org
More information about the Pvfs2-developers