* HSR: Standard breaks alignment. Solution?
@ 2012-01-16 23:10 Arvid Brodin
2012-01-17 8:04 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Arvid Brodin @ 2012-01-16 23:10 UTC (permalink / raw)
To: netdev
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?
Or is this alignment-breaking specification crappy enough to break it and keep
the padding? (I don't really care, I only need this to work between linux
machines.) A "HSR-like" redundancy protocol. :-|
--
Arvid Brodin
Enea Services Stockholm AB
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: HSR: Standard breaks alignment. Solution?
2012-01-16 23:10 HSR: Standard breaks alignment. Solution? Arvid Brodin
@ 2012-01-17 8:04 ` Johannes Berg
2012-01-17 8:32 ` Eric Dumazet
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2012-01-17 8:04 UTC (permalink / raw)
To: Arvid Brodin; +Cc: netdev
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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: HSR: Standard breaks alignment. Solution?
2012-01-17 8:04 ` Johannes Berg
@ 2012-01-17 8:32 ` Eric Dumazet
2012-01-20 15:30 ` Arvid Brodin
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2012-01-17 8:32 UTC (permalink / raw)
To: Johannes Berg; +Cc: Arvid Brodin, netdev
Le mardi 17 janvier 2012 à 09:04 +0100, Johannes Berg a écrit :
> 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.
Or test if NET_IP_ALIGN is 0, it might be more explicit.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: HSR: Standard breaks alignment. Solution?
2012-01-17 8:32 ` Eric Dumazet
@ 2012-01-20 15:30 ` Arvid Brodin
0 siblings, 0 replies; 4+ messages in thread
From: Arvid Brodin @ 2012-01-20 15:30 UTC (permalink / raw)
To: Eric Dumazet, Johannes Berg; +Cc: netdev
Eric Dumazet wrote:
> Le mardi 17 janvier 2012 à 09:04 +0100, Johannes Berg a écrit :
>> 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.
>
> Or test if NET_IP_ALIGN is 0, it might be more explicit.
>
Thanks guys!
--
Arvid Brodin
Enea Services Stockholm AB
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-01-20 15:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-16 23:10 HSR: Standard breaks alignment. Solution? Arvid Brodin
2012-01-17 8:04 ` Johannes Berg
2012-01-17 8:32 ` Eric Dumazet
2012-01-20 15:30 ` Arvid Brodin
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.