Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Dan Lüdtke" <mail@danrl.com>
Cc: linux-mips@linux-mips.org, Netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Misalignment, MIPS, and ip_hdr(skb)->version
Date: Sun, 11 Dec 2016 08:15:01 +0100	[thread overview]
Message-ID: <20161211071501.GA32621@kroah.com> (raw)
In-Reply-To: <CE942916-BF45-44CC-A5F5-3838CF9C93BC@danrl.com>

On Sat, Dec 10, 2016 at 11:18:14PM +0100, Dan Lüdtke wrote:
> 
> > On 8 Dec 2016, at 05:34, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:
> > 
> > On Wed 2016-12-07 19:30:34 -0500, Hannes Frederic Sowa wrote:
> >> Your custom protocol should be designed in a way you get an aligned ip
> >> header. Most protocols of the IETF follow this mantra and it is always
> >> possible to e.g. pad options so you end up on aligned boundaries for the
> >> next header.
> > 
> > fwiw, i'm not convinced that "most protocols of the IETF follow this
> > mantra".  we've had multiple discussions in different protocol groups
> > about shaving or bloating by a few bytes here or there in different
> > protocols, and i don't think anyone has brought up memory alignment as
> > an argument in any of the discussions i've followed.
> > 
> 
> If the trade-off is between 1 padding byte and 2 byte alignment versus
> 3 padding bytes and 4 byte alignment I would definitely opt for 3
> padding bytes. I know how that waste feels like to a protocol
> designer, but I think it is worth it. Maybe the padding/reserved will
> be useful some day for an additional feature.

Note, if you do do this (hint, I think it is a good idea), require that
these reserved/pad fields always set to 0 for now, so that no one puts
garbage in them and then if you later want to use them, it will be a
mess.

thanks,

greg k-h

  reply	other threads:[~2016-12-11  7:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 18:35 Jason A. Donenfeld
2016-12-07 18:47 ` Dave Taht
2016-12-07 18:51   ` David Miller
2016-12-07 18:54     ` Jason A. Donenfeld
2016-12-07 19:52       ` David Miller
2016-12-08  0:29         ` Jason A. Donenfeld
2016-12-08  0:37           ` David Miller
2016-12-08 22:20             ` Jason A. Donenfeld
2016-12-08 23:14               ` David Miller
2016-12-11  8:07               ` Willy Tarreau
2016-12-11 10:47                 ` Måns Rullgård
2016-12-10 12:25       ` Felix Fietkau
2016-12-10 13:25         ` Måns Rullgård
2016-12-10 20:09           ` Felix Fietkau
2016-12-10 20:32             ` Måns Rullgård
2016-12-10 20:36               ` Felix Fietkau
2016-12-12 16:19           ` David Laight
2016-12-12 16:31             ` Måns Rullgård
2016-12-08  0:30 ` Hannes Frederic Sowa
2016-12-08  4:34   ` Daniel Kahn Gillmor
2016-12-09 11:26     ` Jiri Benc
2016-12-10 22:18     ` Dan Lüdtke
2016-12-11  7:15       ` Greg KH [this message]
2016-12-11 14:50         ` Jason A. Donenfeld
2016-12-11 15:30           ` Andrew Lunn
2016-12-11 15:37             ` Jason A. Donenfeld
2016-12-11 16:44           ` Willy Tarreau

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=20161211071501.GA32621@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=hannes@stressinduktion.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mail@danrl.com \
    --cc=netdev@vger.kernel.org \
    --cc=wireguard@lists.zx2c4.com \
    /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).