From: David Miller <davem@davemloft.net>
To: alexander.duyck@gmail.com
Cc: alexander.h.duyck@redhat.com, eric.dumazet@gmail.com,
David.Laight@ACULAB.COM, netdev@vger.kernel.org
Subject: Re: [PATCH] flow-dissector: Fix alignment issue in __skb_flow_get_ports
Date: Fri, 10 Oct 2014 14:15:59 -0400 (EDT) [thread overview]
Message-ID: <20141010.141559.2024576018585843684.davem@davemloft.net> (raw)
In-Reply-To: <54381F1C.2030800@gmail.com>
From: Alexander Duyck <alexander.duyck@gmail.com>
Date: Fri, 10 Oct 2014 11:02:04 -0700
> On 10/10/2014 10:58 AM, David Miller wrote:
>> From: Alexander Duyck <alexander.h.duyck@redhat.com>
>> Date: Fri, 10 Oct 2014 09:50:17 -0700
>>
>>> If I just use get_unaligned that is pretty easy in terms of cleanup
>>> for the ports and IPv4 addresses, the IPv6 will still be a significant
>>> hurdle to overcome though.
>> Actually, it's not that simple.
>>
>> When the compiler sees things like "th->doff" it will load the 32-bit
>> word that 4-bit field contains and extract the value using shifts and
>> masking.
>>
>> So we might need to sprinkle a "attribute((packed))" here and there
>> to make it work.
>
> I'll do some digging. I know I had this working in igb/ixgbe before so
> I probably just need to add a few small tweaks to resolve the remaining
> issues for v4 of the patch.
Your original code works because you do things like "byte[12] & 0xf0" to
extract these fields.
next prev parent reply other threads:[~2014-10-10 18:16 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-10 0:12 eth_get_headlen() and unaligned accesses David Miller
2014-10-10 3:10 ` Alexander Duyck
2014-10-10 4:43 ` David Miller
2014-10-10 10:59 ` David Laight
2014-10-10 4:03 ` [PATCH] flow-dissector: Fix alignment issue in __skb_flow_get_ports alexander.duyck
2014-10-10 4:47 ` David Miller
2014-10-10 14:42 ` Alexander Duyck
2014-10-10 14:57 ` David Laight
2014-10-10 15:14 ` Alexander Duyck
2014-10-10 15:29 ` Eric Dumazet
2014-10-10 16:50 ` Alexander Duyck
2014-10-10 17:58 ` David Miller
2014-10-10 18:02 ` Alexander Duyck
2014-10-10 18:14 ` David Miller
2014-10-10 18:15 ` David Miller [this message]
2014-10-10 18:22 ` David Miller
2014-10-10 18:53 ` Alexander Duyck
2014-10-10 19:32 ` David Miller
2014-10-13 8:32 ` David Laight
2014-10-10 15:33 ` Eric Dumazet
2014-10-10 16:30 ` David Laight
2014-10-10 16:41 ` David Miller
2014-10-10 14:59 ` [PATCH v2] " alexander.duyck
2014-10-10 15:36 ` Eric Dumazet
2014-10-10 17:55 ` David Miller
2014-10-10 18:41 ` eth_get_headlen() and unaligned accesses Tom Herbert
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=20141010.141559.2024576018585843684.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=David.Laight@ACULAB.COM \
--cc=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@redhat.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.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).