public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion•org>
To: Alexander Duyck <alexander.duyck@gmail•com>,
	Sowmini Varadhan <sowmini.varadhan@oracle•com>
Cc: Tom Herbert <tom@herbertland•com>,
	David Miller <davem@davemloft•net>,
	Netdev <netdev@vger•kernel.org>, Kernel Team <kernel-team@fb•com>
Subject: Re: [PATCH net] net: Allow flow dissector to handle non 4-byte aligned headers
Date: Tue, 2 Feb 2016 14:41:23 +0100	[thread overview]
Message-ID: <56B0B203.3060700@stressinduktion.org> (raw)
In-Reply-To: <CAKgT0UfjLEBUeiV3WS2BC=yRkxi9JBF4mqJ=niXOUQnhkiMhvA@mail.gmail.com>

On 02.02.2016 04:56, Alexander Duyck wrote:
>> @@ -394,7 +407,7 @@ ip_proto_again:
>>                                                     data, hlen, &_eth);
>>                          if (!eth)
>>                                  goto out_bad;
>> -                       proto = eth->h_proto;
>> +                       proto = get_unaligned_be16(&eth->h_proto);
>>                          nhoff += sizeof(*eth);
>>                  }
>
> This piece doesn't make any sense to me.  It is already only 2 bytes
> wide.  I'm not sure why we should be seeing this trigger an unaligned
> access.  Are you sure it wasn't something like the keyid causing the
> issue?  I'd be interested in seeing what the compiler did here that it
> is triggering the problem.
>

Correct, and the __packed attribute of struct ethhdr already causes all 
members to have an assumed-alignment of '1', so gcc doesn't create any 
16 bit width accesses anyway.

Bye,
Hannes

  reply	other threads:[~2016-02-02 13:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-31 21:37 [PATCH net] net: Allow flow dissector to handle non 4-byte aligned headers Tom Herbert
2016-01-31 21:47 ` kbuild test robot
2016-01-31 22:06 ` Florian Westphal
2016-02-01  0:24 ` Eric Dumazet
2016-02-01  0:39   ` Florian Fainelli
2016-02-01 15:20     ` Nicolas Dichtel
2016-02-01 16:01       ` Sowmini Varadhan
2016-02-01  0:43   ` Sowmini Varadhan
2016-02-01 12:32 ` Sergei Shtylyov
2016-02-02  0:31 ` Sowmini Varadhan
2016-02-02  0:46   ` Tom Herbert
2016-02-02  3:56   ` Alexander Duyck
2016-02-02 13:41     ` Hannes Frederic Sowa [this message]
2016-02-02 18:35     ` Sowmini Varadhan
2016-02-03 17:07   ` Tom Herbert
2016-02-03 17:31     ` Sowmini Varadhan
2016-02-03 17:51       ` Tom Herbert
2016-02-03 17:59         ` Sowmini Varadhan

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=56B0B203.3060700@stressinduktion.org \
    --to=hannes@stressinduktion$(echo .)org \
    --cc=alexander.duyck@gmail$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=kernel-team@fb$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sowmini.varadhan@oracle$(echo .)com \
    --cc=tom@herbertland$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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