[ovs-dev] [PATCH 1/2] datapath: Rearrange struct sw_flow_key to put optional information last.

Jesse Gross jesse at nicira.com
Thu Apr 28 20:46:14 UTC 2011

On Tue, Apr 26, 2011 at 4:53 PM, Andrew Evans <aevans at nicira.com> wrote:
> Ok. I'm inclined to put all the neighbor-discovery-related stuff into a
> struct, i.e.:
> ...
> struct {
>        struct in6_addr target; /* ND target address. */
>        u8 sll[ETH_ALEN]; /* ND source hardware address. */
>        u8 tll[ETH_ALEN]; /* ND target hardware address. */
> } nd;
> ...
> Does that seem like a good idea to you?

I was thinking about that before as well.  One issue that I was trying
to figure out is what our consistent policy on this is, since I think
you could have a similar argument about the dl_* types.  Right now
it's pretty simple: things are in structs only if they need to be for
union membership.  One other option is to group fields that are
assigned together so that when calculating the length we can just use
the whole group instead of remembering the last member.  I'm not sure
what the best choice is but it should be consistent.

More information about the dev mailing list