From: Johannes Berg <johannes@sipsolutions.net>
To: Arvid Brodin <arvid.brodin@enea.com>
Cc: netdev@vger.kernel.org
Subject: Re: HSR: Standard breaks alignment. Solution?
Date: Tue, 17 Jan 2012 09:04:41 +0100 [thread overview]
Message-ID: <1326787481.3342.2.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <4F14AE66.7060301@enea.com>
On Tue, 2012-01-17 at 00:10 +0100, Arvid Brodin wrote:
> As I've written before here, I'm trying to add support for the HSR protocol
> ("High-availability Seamless Redundancy") to the linux kernel. The protocol is
> specified in IEC-62439-3, and involves adding a protocol tag after the ethhdr
> on outgoing frames, and stripping it again on reception, much like VLAN.
>
> This HSR tag is 6 bytes long, which breaks 32-bit header alignment and causes
> an Oops and a kernel panic in icmp_echo on the receiving side of pings (here,
> exactly: http://lxr.linux.no/#linux+v2.6.37/net/ipv4/icmp.c#L838 )
>
> If I add two bytes of padding to the HSR tag everything works beautifully. But
> of course that breaks any pretense of standard compliance.
>
> Is there some way to fix this without having to memmove the whole frame payload
> 2 bytes on reception?
I don't think there's any other choice, but you can use
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to see whether you actually need
to do it.
johannes
next prev parent reply other threads:[~2012-01-17 8:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-16 23:10 HSR: Standard breaks alignment. Solution? Arvid Brodin
2012-01-17 8:04 ` Johannes Berg [this message]
2012-01-17 8:32 ` Eric Dumazet
2012-01-20 15:30 ` Arvid Brodin
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=1326787481.3342.2.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=arvid.brodin@enea.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