All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Fugang Duan <fugang.duan@freescale.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Fabio Estevam <Fabio.Estevam@freescale.com>,
	Jim Baxter <jim_baxter@mentor.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH] net: fec_main: dma_map() only the length of the skb
Date: Thu, 28 Nov 2013 12:24:26 +0100	[thread overview]
Message-ID: <529727EA.5010405@linutronix.de> (raw)
In-Reply-To: <9848F2DB572E5649BA045B288BE08FBE0189C105@039-SN2MPN1-023.039d.mgd.msft.net>

On 11/28/2013 02:18 AM, Fugang Duan wrote:
- <frank.li@freescale.net> because MTA complains (now really)

>> On 11/27/2013 02:08 PM, Fugang Duan wrote:
>>> In fact, there have one memory copy for enet as below since enet have 16
>> bytes data buffer alignment request.
>>> if (((unsigned long) bufaddr) & FEC_ALIGNMENT) {
>>>                 memcpy(fep->tx_bounce[index], skb->data, skb->len);
>>>                 bufaddr = fep->tx_bounce[index]; }
>>
>> This memcpy() is only executed if the buffer isn't properly aligned which
>> shouldn't be the rule but an exception. This aligment check is also available
>> in v2.6.31 where the BUG_ON() statement was triggered.
>>
> In fact, the skb->data address is not aligned with FEC_ALIGNMENT, so memcpy() always is called at here.

I am aware of NET_IP_ALIGN. The pointers I mentioned in the log were
from a printk() shortly before that bug triggered. So I am not making
this up :) I am not aware of the load that triggered this.

Anyway, adding this

   WARN_ON(!((unsigned long)skb->data & 0xf));

in my e1000 on v3.12 triggers shortly after boot and according to the
backtrace it comes aoe. So that is at least one user :)
Since that aligment is for IP, I am not sure if non-IP based protocol
are using this. I know however that the workload, that triggered the
problem, is not IP-based.

> 
> Thanks,
> Andy 

Sebastian

  reply	other threads:[~2013-11-28 11:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27 12:44 [PATCH] net: fec_main: dma_map() only the length of the skb Sebastian Andrzej Siewior
2013-11-27 13:08 ` Fugang Duan
2013-11-27 13:38   ` Sebastian Andrzej Siewior
2013-11-28  1:18     ` Fugang Duan
2013-11-28 11:24       ` Sebastian Andrzej Siewior [this message]
2013-12-02  1:25   ` David Miller
2013-12-02  2:04 ` Fugang Duan
2013-12-02  2:14   ` Fugang Duan
2013-12-02  9:52   ` [PATCH v2] " Sebastian Andrzej Siewior
2013-12-02  9:58     ` Fugang Duan
2013-12-02 21:59     ` David Miller
2013-12-03  7:36 ` [PATCH] " Marek Szyprowski
2013-12-03  7:54   ` Sebastian Andrzej Siewior

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=529727EA.5010405@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=Fabio.Estevam@freescale.com \
    --cc=davem@davemloft.net \
    --cc=fugang.duan@freescale.com \
    --cc=jim_baxter@mentor.com \
    --cc=m.szyprowski@samsung.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.