* Kernel unaligned accesses
@ 2001-12-10 19:45 Tom Dropka
2001-12-10 20:11 ` Jay Estabrook
0 siblings, 1 reply; 5+ messages in thread
From: Tom Dropka @ 2001-12-10 19:45 UTC (permalink / raw)
To: axp-list
I've got an SX164 running 2.4.16 and RH 7.1 with a D-Link 530TX (Via
Rhine II) Ethernet card. I'm seeing lots of kernel unaligned accesses
whenever networking is enabled, but no user unaligned accesses. Before
I start trying different kernels or different Ethernet cards, I'd like
to know if this is "normal" behavior -- i.e., is this a problem at all?
does the TCP/IP stack on Alphas always generate unaligned accesses? is
it a driver problem?
It doesn't seem to be hurting performance, but I guess I assumed that
the Linux kernel and (most) distributions and applications were 64-bit
clean.
Thanks,
Tom
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Kernel unaligned accesses
2001-12-10 19:45 Tom Dropka
@ 2001-12-10 20:11 ` Jay Estabrook
2001-12-10 20:49 ` Tom Dropka
0 siblings, 1 reply; 5+ messages in thread
From: Jay Estabrook @ 2001-12-10 20:11 UTC (permalink / raw)
To: axp-list
On Mon, Dec 10, 2001 at 11:45:13AM -0800, Tom Dropka wrote:
>
> I've got an SX164 running 2.4.16 and RH 7.1 with a D-Link 530TX (Via
> Rhine II) Ethernet card. I'm seeing lots of kernel unaligned accesses
> whenever networking is enabled, but no user unaligned accesses.
Is this a change in behavior noted with the (assumed) new kernel, versus
a 2.2 kernel, with the same card?
> Before I start trying different kernels or different Ethernet cards,
> I'd like to know if this is "normal" behavior -- i.e., is this a
> problem at all? does the TCP/IP stack on Alphas always generate
> unaligned accesses? is it a driver problem?
No, it's not normal behavior, so long as the driver-writer has somehow
handled or planned for those places where unaligned accesses might
take place on certain platforms.
Don Becker's drivers, when "adjusted" for Alpha, force a copy of the
data from the "raw" buffer to another buffer where the data will be
appropriately aligned, thus avoiding any unaligned accesses at the
price of the packet copy.
> It doesn't seem to be hurting performance, but I guess I assumed that
> the Linux kernel and (most) distributions and applications were 64-bit
> clean.
It is affecting performance on a per-packet basis. Whether it is
hurting overall system performance is dependent on the amount of
packets received and how fast the processor can "fixup" the unaligned
accesses (eg EV6 does it faster than EV4 :-).
--Jay++
-----------------------------------------------------------------------------
Jay A Estabrook Alpha Engineering - LINUX Project
Compaq Computer Corp. - MRO1-2/K15 (508) 467-2080
200 Forest Street, Marlboro MA 01752 Jay.Estabrook@compaq.com
-----------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Kernel unaligned accesses
2001-12-10 20:11 ` Jay Estabrook
@ 2001-12-10 20:49 ` Tom Dropka
2001-12-11 11:01 ` Ivan Kokshaysky
0 siblings, 1 reply; 5+ messages in thread
From: Tom Dropka @ 2001-12-10 20:49 UTC (permalink / raw)
To: axp-list; +Cc: jay.estabrook
--- Jay Estabrook <Jay.Estabrook@compaq.com> wrote:
> On Mon, Dec 10, 2001 at 11:45:13AM -0800, Tom Dropka wrote:
> >
> > I've got an SX164 running 2.4.16 and RH 7.1 with a D-Link 530TX
> (Via
> > Rhine II) Ethernet card. I'm seeing lots of kernel unaligned
> accesses
> > whenever networking is enabled, but no user unaligned accesses.
>
> Is this a change in behavior noted with the (assumed) new kernel,
> versus
> a 2.2 kernel, with the same card?
Don't know; I haven't run a 2.2 kernel with this setup yet. I'm
downloading a 2.2 kernel now; there shouldn't be any problem running
a 2.2 kernel in a "2.4-enabled" RH 7.1 system, right? (I know there
were several things to be done to upgrade from 2.2 to 2.4; any
downgrade required?)
BTW, I saw the same unaligned accesses with the stock RH 2.4.3-12
kernel, which is why I tried 2.4.16.
> > Before I start trying different kernels or different Ethernet
> cards,
> > I'd like to know if this is "normal" behavior -- i.e., is this a
> > problem at all? does the TCP/IP stack on Alphas always generate
> > unaligned accesses? is it a driver problem?
>
> No, it's not normal behavior, so long as the driver-writer has
> somehow
> handled or planned for those places where unaligned accesses might
> take place on certain platforms.
>
> Don Becker's drivers, when "adjusted" for Alpha, force a copy of the
> data from the "raw" buffer to another buffer where the data will be
> appropriately aligned, thus avoiding any unaligned accesses at the
> price of the packet copy.
Thanks; now that I know it's a problem, I've got several million
unaligned accesses to clean up. :-) Anybody else out there using the
DFE-530TX on an Alpha system?
> > It doesn't seem to be hurting performance, but I guess I assumed
> that
> > the Linux kernel and (most) distributions and applications were
> 64-bit
> > clean.
>
> It is affecting performance on a per-packet basis. Whether it is
> hurting overall system performance is dependent on the amount of
> packets received and how fast the processor can "fixup" the unaligned
> accesses (eg EV6 does it faster than EV4 :-).
>
> --Jay++
>
>
-----------------------------------------------------------------------------
> Jay A Estabrook Alpha Engineering - LINUX
> Project
> Compaq Computer Corp. - MRO1-2/K15 (508) 467-2080
> 200 Forest Street, Marlboro MA 01752 Jay.Estabrook@compaq.com
>
-----------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Axp-list mailing list
> Axp-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/axp-list
Thanks,
Tom
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Kernel unaligned accesses
2001-12-10 20:49 ` Tom Dropka
@ 2001-12-11 11:01 ` Ivan Kokshaysky
0 siblings, 0 replies; 5+ messages in thread
From: Ivan Kokshaysky @ 2001-12-11 11:01 UTC (permalink / raw)
To: axp-list
On Mon, Dec 10, 2001 at 12:49:49PM -0800, Tom Dropka wrote:
> BTW, I saw the same unaligned accesses with the stock RH 2.4.3-12
> kernel, which is why I tried 2.4.16.
If you have the driver compiled as module (which is probably the
case for stock RH kernel), you can try to fix it even without
recompiling - pass "rx_copybreak=1518" option to the module.
Or try appended patch.
> > Don Becker's drivers, when "adjusted" for Alpha, force a copy of the
> > data from the "raw" buffer to another buffer where the data will be
> > appropriately aligned, thus avoiding any unaligned accesses at the
> > price of the packet copy.
Yes - it's a common problem on alpha and several other platforms
with network cards capable to DMA only on a 32-bit boundary (via-rhine
is one of those). Without copying the packet to another buffer IP header
will be misaligned, and you'll have tons of unaligned traps in the
TCP/IP layer.
Ivan.
--- linux/drivers/net/via-rhine.c.orig Sat Nov 10 00:45:36 2001
+++ linux/drivers/net/via-rhine.c Tue Dec 11 13:11:33 2001
@@ -87,7 +87,12 @@ static int max_interrupt_work = 20;
/* Set the copy breakpoint for the copy-only-tiny-frames scheme.
Setting to > 1518 effectively disables this feature. */
-static int rx_copybreak;
+#if defined(__alpha__) || defined(__sparc__) || defined(__mips__) || \
+ defined(__arm__)
+static int rx_copybreak = 1518;
+#else
+static int rx_copybreak = 200;
+#endif
/* Used to pass the media type, etc.
Both 'options[]' and 'full_duplex[]' should exist for driver
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Kernel unaligned accesses
@ 2001-12-11 13:57 Tom Dropka
0 siblings, 0 replies; 5+ messages in thread
From: Tom Dropka @ 2001-12-11 13:57 UTC (permalink / raw)
To: axp-list
Yep, that did it. Thanks to Ivan and Jay, my unaligned accesses are
now pegged at 0.
Tom
----- Original Message -----
From: "Ivan Kokshaysky" <ink@jurassic.park.msu.ru>
To: <axp-list@redhat.com>
Sent: Tuesday, December 11, 2001 6:01 AM
Subject: Re: Kernel unaligned accesses
> On Mon, Dec 10, 2001 at 12:49:49PM -0800, Tom Dropka wrote:
> > BTW, I saw the same unaligned accesses with the stock RH 2.4.3-12
> > kernel, which is why I tried 2.4.16.
>
> If you have the driver compiled as module (which is probably the
> case for stock RH kernel), you can try to fix it even without
> recompiling - pass "rx_copybreak=1518" option to the module.
> Or try appended patch.
>
> > > Don Becker's drivers, when "adjusted" for Alpha, force a copy of
the
> > > data from the "raw" buffer to another buffer where the data will
be
> > > appropriately aligned, thus avoiding any unaligned accesses at
the
> > > price of the packet copy.
>
> Yes - it's a common problem on alpha and several other platforms
> with network cards capable to DMA only on a 32-bit boundary
(via-rhine
> is one of those). Without copying the packet to another buffer IP
header
> will be misaligned, and you'll have tons of unaligned traps in the
> TCP/IP layer.
>
> Ivan.
>
> --- linux/drivers/net/via-rhine.c.orig Sat Nov 10 00:45:36 2001
> +++ linux/drivers/net/via-rhine.c Tue Dec 11 13:11:33 2001
> @@ -87,7 +87,12 @@ static int max_interrupt_work = 20;
>
> /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
> Setting to > 1518 effectively disables this feature. */
> -static int rx_copybreak;
> +#if defined(__alpha__) || defined(__sparc__) || defined(__mips__) ||
\
> + defined(__arm__)
> +static int rx_copybreak = 1518;
> +#else
> +static int rx_copybreak = 200;
> +#endif
>
> /* Used to pass the media type, etc.
> Both 'options[]' and 'full_duplex[]' should exist for driver
>
>
>
> _______________________________________________
> Axp-list mailing list
> Axp-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/axp-list
__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-12-11 13:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-11 13:57 Kernel unaligned accesses Tom Dropka
-- strict thread matches above, loose matches on Subject: below --
2001-12-10 19:45 Tom Dropka
2001-12-10 20:11 ` Jay Estabrook
2001-12-10 20:49 ` Tom Dropka
2001-12-11 11:01 ` Ivan Kokshaysky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox