From: "Joakim Tjernlund" <Joakim.Tjernlund@lumentis.se>
To: "Dan Malek" <dan@embeddededge.com>
Cc: "Hans Feldt" <Hans.Feldt@uab.ericsson.se>,
<linuxppc-embedded@lists.linuxppc.org>, <scop@digitel.com.br>,
<thomas@corelatus.com>
Subject: Re: [PATCH] arch/ppc/8xx_io/enet.c, version 2
Date: Wed, 13 Nov 2002 23:54:01 +0100 [thread overview]
Message-ID: <000f01c28b67$8f14e9c0$0200a8c0@telia.com> (raw)
In-Reply-To: 3DD2CE30.6090708@embeddededge.com
> Joakim Tjernlund wrote:
>
> > OK, anyone against? Dan?
>
> I'm currently looking at the patches and I'll be integrating something
> that hopefully works :-)
Please tell me if there is something in that patch you don't like(besides the
moving the invalidate call).
>
> This isn't something new that hasn't been tried before. The problem
> in the past with non-coherent processors, incoming DMA, and skbufs is
> the buffers would share cache lines with other data which would get
> corrupted as the result of the invalidate for the DMA. Typically,
> data that was corrupted were flags and control information for the IP
> stack, and under "normal" use you wouldn't notice this. However,
> forwarding/bridging applications would fail to work properly and you
> would sometimes see packet retransmits that weren't necessary.
>
> The "trick" is to ensure you allocate a larger than necessary sk buffer
> and then align the start and end such that they consume entire cache
> lines. There has been sufficient discussion about this that I hope
> the sk buffer mechanism will allow this alignment now, as it didn't
> work well in the past. This is what I want to check out when I
> apply and test the patches.
Tell me about it, I got severely bitten by a non cache aligned invalidate call
in the i2c-algo-8xx.c driver :-(
I too checked carefully that the buffer returned from __dev_alloc_skb()/dev_alloc_skb()
cache aligned, turns out that it kmalloc's a buffer and reserves 16 bytes in the
beginning so it's safe.
>
> This isn't necessary on the 8260 family due to cache snooping, but it
> is required on the 8xx.
>
> Of course, a packet checksum still needs to be performed, and if it
> is done as part of the data copy (and if the IP stack doesn't do it
> again), it would seem that this implementation rather than DMA would
> be more efficient.
Are referring to eth_copy_and_sum()? That function has never done
a csum, just a plain memcpy(). The IP stack has always done
it's own csum(just as well since it would be doing this in IRQ context),
unless you set ip_summed(I think).
Perhaps a backwards memcpy() would be more efficient? That way
the IP header get copied last and will be in cache longer. I believe memmove()
will do that.
Some drivers also try cache align the IP header. I tried that to but
eth_type_trans() could not handle this.
Finally, why does passing the Ethernet CRC upwards mess-up bridging applications?
Jocke
>
> Thanks.
>
>
> -- Dan
>
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2002-11-13 22:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-24 14:23 [PATCH] arch/ppc/8xx_io/enet.c, version 2 Joakim Tjernlund
2002-10-24 14:59 ` Tom Rini
2002-10-24 15:46 ` Joakim Tjernlund
2002-11-01 11:01 ` Joakim Tjernlund
2003-01-28 11:54 ` [PATCH] arch/ppc/8xx_io/enet.c, version 3 Joakim Tjernlund
2003-02-03 10:21 ` Joakim Tjernlund
2003-02-03 12:28 ` Pantelis Antoniou
2002-10-28 15:17 ` [PATCH] arch/ppc/8xx_io/enet.c, version 2 Stephan Linke
2002-10-28 17:24 ` Joakim Tjernlund
2002-11-13 13:50 ` Hans Feldt
2002-11-13 16:35 ` Joakim Tjernlund
2002-11-13 19:30 ` Hans Feldt
2002-11-13 21:19 ` Joakim Tjernlund
2002-11-13 22:12 ` Dan Malek
2002-11-13 22:54 ` Joakim Tjernlund [this message]
2002-11-15 11:52 ` Hans Feldt
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='000f01c28b67$8f14e9c0$0200a8c0@telia.com' \
--to=joakim.tjernlund@lumentis.se \
--cc=Hans.Feldt@uab.ericsson.se \
--cc=dan@embeddededge.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=scop@digitel.com.br \
--cc=thomas@corelatus.com \
/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).