public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: See to it that sent data is aligned to the ethernet controllers wishes
Date: Wed, 19 Aug 2009 09:55:46 -0700	[thread overview]
Message-ID: <4A8C2E92.50403@gmail.com> (raw)
In-Reply-To: <20090819101719.1e92b340@marrow.netinsight.se>

Simon Kagstrom wrote:
> On Wed, 19 Aug 2009 16:06:12 +0800
> "Liu Dave-R63238" <DaveLiu@freescale.com> wrote:
>
>   
>>> Well, that's what the other patch I sent does (the link above), but
>>> there were wishes then to handle this above the driver layer, hence
>>> this patch :-)
>>>
>>> I'm fine with either way, but if there are other drivers with 
>>> alignment requirements, I'd prefer this variant.
>>>       
>> I believe some Freescale's CPM/QE controllers need care the
>> alignement requirement.
>>
>> If you don't care the performance, you can malloc memory to
>> get the aligned buffer pool in the initiaize phase,
>> then use the buffer pool to resolve your alignment issue, of course
>> It needs a copy, but it avoids to malloc/free buffer in run-time.
>>     
>
> The malloc is only done once - the first time a non-aligned send is
> done. After that it's just reused until the alignment requirement
> exceeds the current allocation (if another interface is set
> as current).
>
> So I think the performance impact is very small.
>
> // Simon
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>   
My preference is for the drivers to handle alignment.  I like Dave's 
idea of creating a buffer (or multiple buffers) in initialization(), 
then memcpy'ing to to it in the send() routine.  You could make it smart 
to only memcpy if the frame is not aligned as needed.

Your original patch created a buffer of size 9000, which I commented was 
probably bigger than necessary.  I didn't see a response to that (which 
doesn't mean you didn't send one, but I get a lot of e-mail :)

regards,
Ben

  reply	other threads:[~2009-08-19 16:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19  7:26 [U-Boot] [PATCH] net: See to it that sent data is aligned to the ethernet controllers wishes Simon Kagstrom
2009-08-19  7:36 ` Liu Dave-R63238
2009-08-19  7:51   ` Simon Kagstrom
2009-08-19  8:06     ` Liu Dave-R63238
2009-08-19  8:17       ` Simon Kagstrom
2009-08-19 16:55         ` Ben Warren [this message]
2009-08-20  6:25           ` Simon Kagstrom

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=4A8C2E92.50403@gmail.com \
    --to=biggerbadderben@gmail.com \
    --cc=u-boot@lists.denx.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