From: Thierry Reding <thierry.reding@avionic-design.de>
To: David Miller <davem@davemloft.net>
Cc: pazke@donpac.ru, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: Add support for the OpenCores 10/100 Mbps Ethernet MAC.
Date: Wed, 25 Mar 2009 15:52:43 +0100 [thread overview]
Message-ID: <20090325145243.GB11710@avionic-design.de> (raw)
In-Reply-To: <20090324.163630.226102764.davem@davemloft.net>
* David Miller wrote:
> From: Andrey Panin <pazke@donpac.ru>
> Date: Tue, 24 Mar 2009 14:13:59 +0300
>
> > On 083, 03 24, 2009 at 11:18:43AM +0100, Thierry Reding wrote:
> > > +static void ethoc_copy_to_io(void __iomem *dest, struct sk_buff *src)
> > > +{
> > > + size_t size = (src->len & 0x3) ? (src->len & ~0x3) + 4 : src->len;
> > > + u8 buffer[ETHOC_BUFSIZ];
> >
> > Using 1536 bytes of stack is not very nice.
>
> Agreed, this stuff must be fixed.
>
> You could use skb_copy_and_csum_dev() directly into your buffer, then
> pad out the end of the buffer with a memset() call, if necessary.
>-
> Actually, no you can't...
>
> You should not be using memcpy() to store things into I/O memory.
> That's what memcpy_io() is for.
>
> I think because of all of these special padding cases and the use
> of I/O memory instead of DMA, there is no real gain by using
> skb_copy_and_csum_dev() in this driver.
Actually these special padding cases are only necessary for the FPGA interface
we use and have nothing to do with the OpenCores Ethernet MAC itself. The ARM
memcpy_{to,from}io() functions don't work correctly with my setup because our
VLIO bridge implementation apparently doesn't handle byte-wise accesses very
well.
I can work around that by implementing the memcpy_{to,from}io() functions
differently, though. That may however break anything else using those
functions.
> Just let the network stack checksum the packet, and use memcpy_io() here
> which is the currect interface for copying data into I/O memory.
See follow-up patch in reply to the first patch.
Cheers,
Thierry
next prev parent reply other threads:[~2009-03-25 14:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-24 10:18 [PATCH] net: Add support for the OpenCores 10/100 Mbps Ethernet MAC Thierry Reding
2009-03-24 10:32 ` Florian Fainelli
2009-03-25 14:43 ` Thierry Reding
2009-03-25 21:00 ` Florian Fainelli
2009-03-24 11:13 ` Andrey Panin
2009-03-24 23:36 ` David Miller
2009-03-25 14:52 ` Thierry Reding [this message]
2009-03-24 12:01 ` Andrey Panin
2009-03-25 14:55 ` Thierry Reding
2009-03-25 14:57 ` [PATCH v2] " Thierry Reding
2009-03-26 0:18 ` David Miller
2009-03-26 7:42 ` [PATCH v3] " Thierry Reding
2009-03-26 7:55 ` David Miller
2009-03-26 7:58 ` David Miller
2009-03-26 8:09 ` Thierry Reding
2009-03-26 10:16 ` [PATCH v4] " Thierry Reding
2009-03-27 7:17 ` David Miller
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=20090325145243.GB11710@avionic-design.de \
--to=thierry.reding@avionic-design.de \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pazke@donpac.ru \
/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).