netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Thomas Graf <tgraf-G/eBtMaohhA@public.gmane.org>
Cc: "dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org"
	<dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org>,
	"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Stephen Hemminger
	<stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>,
	"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Subject: Re: [PATCH 2/6] vxlan: Group Policy extension
Date: Wed, 7 Jan 2015 09:32:52 -0800	[thread overview]
Message-ID: <CAADnVQJErdNJrXOOSqEqkbC8524VCH2E9vYL-WdTb_6SGsTwvw@mail.gmail.com> (raw)

On Wed, Jan 7, 2015 at 3:10 AM, Thomas Graf <tgraf@suug.ch> wrote:
> On 01/06/15 at 07:37pm, Alexei Starovoitov wrote:
>> Even it works ok, I think this struct layout is ugly.
>> imo would be much easier to read if you replace
>> the whole vxlanhdr with vxlanhdr_gbp
>> or split vxlanhdr into two 32-bit structs.
>> then __packed hacks won't be needed.
>
> The main reason why I merged it into vxlanhdr is for documentation
> purposes and to avoid duplicating the generic VXLAN header for every
> extension. The RCO and GPE extensions would need to duplicate this
> over and over. It gets messy in particular when multiple extensions
> can be used in combination (such as GBP and RCO) which then each
> have their own conflicting header definitions. This way, it is clear
> which extensions are compatible by just looking at the definition
> of the structure.

I'm afraid 'union' style with first u8 flags working as selector
won't work for the case you're describing, but since
                      md.gbp = ntohs(vxh->gbp.policy_id);
    2652:       41 0f b7 55 0a          movzwl 0xa(%r13),%edx
then at least from performance side it's ok at least on x86.
So this _packed stuff is fine, though not pretty.
It's internal header, so we can improve it later.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

             reply	other threads:[~2015-01-07 17:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-07 17:32 Alexei Starovoitov [this message]
     [not found] ` <CAADnVQJErdNJrXOOSqEqkbC8524VCH2E9vYL-WdTb_6SGsTwvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-07 23:27   ` [PATCH 2/6] vxlan: Group Policy extension Thomas Graf
2015-01-07 23:39     ` Alexei Starovoitov
  -- strict thread matches above, loose matches on Subject: below --
2015-01-12 12:26 [PATCH 0/6 net-next v3] VXLAN Group Policy Extension Thomas Graf
2015-01-12 12:26 ` [PATCH 2/6] vxlan: Group Policy extension Thomas Graf
2015-01-12 19:23   ` Jesse Gross
     [not found]     ` <CAEP_g=8TqGnftZa_scKODa2ra7gsV6ov_5J+Lbfq+4bFDZjiBw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-12 22:47       ` Thomas Graf
2015-01-12 22:50         ` Jesse Gross
2015-01-12 22:59           ` Thomas Graf
2015-01-12 23:19             ` Jesse Gross
2015-01-08 22:47 [PATCH 0/6 net-next v2] VXLAN Group Policy Extension Thomas Graf
2015-01-08 22:47 ` [PATCH 2/6] vxlan: Group Policy extension Thomas Graf
2015-01-09 17:37   ` Alexei Starovoitov
2015-01-09 22:10     ` Thomas Graf
2015-01-12 17:37   ` Nicolas Dichtel
2015-01-12 17:59     ` David Miller
2015-01-13  8:29       ` Nicolas Dichtel
2015-01-13  1:04     ` Thomas Graf
2015-01-12 18:14   ` Tom Herbert
2015-01-13  1:03     ` Thomas Graf
2015-01-13  2:28       ` Tom Herbert
2015-01-13 11:32         ` Thomas Graf
2015-01-13 16:16           ` Tom Herbert
2015-01-07  3:37 Alexei Starovoitov
2015-01-07 10:03 ` David Laight
2015-01-07 11:01   ` Thomas Graf
2015-01-07 11:10 ` Thomas Graf
2015-01-07  2:05 [PATCH 0/6 net-next] VXLAN Group Policy Extension Thomas Graf
2015-01-07  2:05 ` [PATCH 2/6] vxlan: Group Policy extension Thomas Graf
2015-01-07 16:05   ` Tom Herbert
     [not found]     ` <CA+mtBx_Jj-tUM1nbHd2fHb0-=QpK3tcQgA=smWmg=cB-fupdGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-07 16:21       ` Thomas Graf
2015-01-07 16:56         ` Tom Herbert
     [not found]           ` <CA+mtBx_A_M3+irq7w4nNCyPZBgM7ja+wfJT4w4Q0Yo6GMGYVgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-07 17:21             ` Thomas Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAADnVQJErdNJrXOOSqEqkbC8524VCH2E9vYL-WdTb_6SGsTwvw@mail.gmail.com \
    --to=alexei.starovoitov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org \
    --cc=tgraf-G/eBtMaohhA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).