All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: mwdalton@google.com, netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [RFC] Kernel unaligned access at __skb_flow_dissect
Date: Fri, 29 Jan 2016 14:22:18 -0500	[thread overview]
Message-ID: <20160129192218.GB17127@oracle.com> (raw)
In-Reply-To: <1454093642.7627.57.camel@edumazet-glaptop2.roam.corp.google.com>

On (01/29/16 10:54), Eric Dumazet wrote:
> > Why ipv6 stack itself does not trigger the issue ?
> > Maybe the driver itself does not properly align IP headers on sparc ?
> > Make sure NET_IP_ALIGN is 2 on your build.
> > Note that x86 does not care, but a driver should always align Ethernet
> > header to NET_IP_ALIGN, so that IP headers are aligned to 4 bytes
> > boundaries.

Consolidating a few responses:

NET_IP_ALIGN is 2, of course, or else I would have seen errors about unaligned
access in many more places. The issue is being triggered by ipv6
stack (I'm running iperf over ipv6) so I'm not sure I understand the
first question.

I tried out the suggested patch of setting page_offset to NET_IP_ALIGN
in ixgbe_main.c - and yes, it kills the unaligned errors, so that's a
Good Thing. (though I see davem just responded to the patch)

However, the patch itself is not arch specific, and the unaligned 
address issue should have impacted other archs (silently) as well - 
even for ipv4, 

It would also impact other logic in __skb_flow_dissect: 
e.g., the access to iph->saddr for ipv4 frags would be
unaligned in __skb_flow_dissect? (And Ias I mentioned in my original
mail, the comments in __skb_get_poff seem to indicate that others
have tripped up on this before - and yes, casting is not a good thing
but seems like that's what they did to paper over the problem)

> Hmmm.... it seems that flow dissector can "support L2 GRE", leading to
> unaligned accesses since a header is 14 bytes (not multiple of 4)
  :
> IP stacks in linux assume IP headers are always aligned to 4 bytes,
> so it means having a GRE header like this would align trap on some
> arches.

I'm not sure I see how the above commit could have been impacting me,
I dont have any l2 gre invovled (simple p2p Ethernet II + ipv6 + tcp, 
no vlans, gre or other exotic stuff).

--Sowmini

  reply	other threads:[~2016-01-29 19:22 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 18:06 [RFC] Kernel unaligned access at __skb_flow_dissect Sowmini Varadhan
2016-01-29 18:33 ` Eric Dumazet
2016-01-29 18:40   ` Eric Dumazet
2016-01-29 19:08     ` David Miller
2016-01-29 19:39       ` Eric Dumazet
2016-01-29 18:54   ` Eric Dumazet
2016-01-29 19:22     ` Sowmini Varadhan [this message]
2016-01-29 21:00     ` Tom Herbert
2016-01-29 21:09       ` Sowmini Varadhan
2016-01-29 21:33         ` Tom Herbert
2016-01-29 23:00         ` Tom Herbert
2016-01-29 23:04           ` Sowmini Varadhan
2016-01-29 23:31             ` Tom Herbert
2016-01-29 23:58               ` Sowmini Varadhan
2016-01-30  0:47                 ` Tom Herbert
2016-01-30  1:18                   ` David Miller
2016-01-30  2:15                   ` Eric Dumazet
2016-01-31 22:13                     ` Tom Herbert
2016-02-01  0:04                       ` Eric Dumazet
2016-01-29 19:06   ` David Miller
2016-01-29 19:37     ` Eric Dumazet
2016-01-29 19:41       ` David Miller
2016-01-29 19:44       ` Sowmini Varadhan
2016-01-29 20:01         ` Eric Dumazet
2016-01-29 20:06           ` Eric Dumazet
2016-01-29 21:16           ` Alexander Duyck
2016-01-29 21:33             ` Eric Dumazet
2016-01-29 22:08               ` Alexander Duyck
2016-01-29 22:28                 ` Eric Dumazet
2016-01-29 23:00                   ` Alexander Duyck
2016-02-01 16:55                   ` David Laight
2016-02-01 17:25                     ` Eric Dumazet
2016-01-29 19:04 ` David Miller
2016-01-30  2:49 ` [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen Alexander Duyck
2016-01-30  3:23   ` Eric Dumazet
2016-01-30  3:35     ` David Miller
2016-01-30  4:46       ` Alexander Duyck
2016-01-30 16:17     ` Sowmini Varadhan
2016-01-30 17:43       ` Tom Herbert
2016-01-30 19:12         ` Sowmini Varadhan
2016-01-30 18:36       ` Alexander Duyck
2016-01-30 19:26         ` Eric Dumazet
2016-01-31  1:13           ` Alexander Duyck
2016-01-31  3:45             ` David Miller
2016-01-31  9:12               ` Alexander Duyck
2016-01-31 19:17                 ` David Miller
2016-01-31 21:23                   ` Sowmini Varadhan
2016-02-01 16:50               ` David Laight
2016-02-01 18:18                 ` Alexander Duyck
2016-02-02  9:47                   ` David Laight

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=20160129192218.GB17127@oracle.com \
    --to=sowmini.varadhan@oracle.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=mwdalton@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.