netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: alexander.duyck@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH v2] flow-dissector: Fix alignment issue in __skb_flow_get_ports
Date: Fri, 10 Oct 2014 13:55:10 -0400 (EDT)	[thread overview]
Message-ID: <20141010.135510.284932227690786117.davem@davemloft.net> (raw)
In-Reply-To: <1412955376.9362.15.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 10 Oct 2014 08:36:16 -0700

> On Fri, 2014-10-10 at 07:59 -0700, alexander.duyck@gmail.com wrote:
>> From: Alexander Duyck <alexander.h.duyck@redhat.com>
>> 
>> This patch addresses a kernel unaligned access bug seen on a sparc64 system
>> with an igb adapter.  Specifically the __skb_flow_get_ports was returning a
>> be32 pointer which was then having the value directly returned.
>> 
>> In order to keep the handling of the ports consistent with how we were
>> handling the IPv4 and IPv6 addresses I have instead replaced the assignment
>> with a memcpy to the flow key ports value.  This way it should stay a
>> memcpy on systems that cannot handle unaligned access, and will likely be
>> converted to a 32b assignment on the systems that can support it.
>> 
>> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
>> ---
> 
> I believe you also need to take care of calls to ipv6_addr_hash()
> 
> The IPv4 part also needs something in iph_to_flow_copy_addrs(),
> otherwise compiler might assume  &iph->saddr is word aligned.

Right, I still get the unaligned accesses even with this patch:

[487667.804777] Kernel unaligned access at TPC[81de40] __skb_get_poff+0xa0/0x100
[487667.818767] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.17.0+ #3
[487667.830930] Call Trace:
[487667.835954]  [0000000000433288] kernel_unaligned_trap+0x368/0x5c0
[487667.848276]  [000000000042a824] sun4v_do_mna+0x84/0xa0
[487667.858698]  [0000000000406cd0] sun4v_mna+0x5c/0x68
[487667.868592]  [000000000081de40] __skb_get_poff+0xa0/0x100
[487667.879531]  [0000000000843d2c] eth_get_headlen+0x6c/0xa0
[487667.890486]  [000000001003ed54] igb_poll+0x8d4/0xf60 [igb]
[487667.901584]  [0000000000824428] net_rx_action+0xa8/0x1c0
[487667.912348]  [000000000046a1fc] __do_softirq+0xdc/0x2e0
[487667.922932]  [000000000042b96c] do_softirq_own_stack+0x2c/0x40
[487667.934751]  [000000000046a6b8] irq_exit+0x98/0xc0
[487667.944473]  [000000000042b900] handler_irq+0xc0/0x100
[487667.954888]  [00000000004208b4] tl0_irq5+0x14/0x20
[487667.964610]  [000000000042c0d4] arch_cpu_idle+0x74/0xa0
[487667.975201]  [0000000000499cdc] cpu_startup_entry+0x17c/0x2c0
[487667.986843]  [0000000000ab69b8] start_kernel+0x408/0x418
[487667.997603]  [00000000008c3628] tlb_fixup_done+0x98/0xb0

  reply	other threads:[~2014-10-10 17:55 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
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 [this message]
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.135510.284932227690786117.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexander.duyck@gmail.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).