From: David Miller <davem@davemloft.net>
To: pazke@donpac.ru
Cc: thierry.reding@avionic-design.de, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: Add support for the OpenCores 10/100 Mbps Ethernet MAC.
Date: Tue, 24 Mar 2009 16:36:30 -0700 (PDT) [thread overview]
Message-ID: <20090324.163630.226102764.davem@davemloft.net> (raw)
In-Reply-To: <20090324111359.GA6859@ports.donpac.ru>
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. 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.
next prev parent reply other threads:[~2009-03-24 23:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-24 10:18 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 [this message]
2009-03-25 14:52 ` Thierry Reding
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=20090324.163630.226102764.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pazke@donpac.ru \
--cc=thierry.reding@avionic-design.de \
/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
Powered by JetHome