netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: bigeasy@linutronix.de
Cc: fugang.duan@freescale.com, netdev@vger.kernel.org,
	Fabio.Estevam@freescale.com, frank.li@freescale.net,
	jim_baxter@mentor.com, m.szyprowski@samsung.com
Subject: Re: [PATCH v2] net: fec_main: dma_map() only the length of the skb
Date: Mon, 02 Dec 2013 16:59:44 -0500 (EST)	[thread overview]
Message-ID: <20131202.165944.24925233570384450.davem@davemloft.net> (raw)
In-Reply-To: <20131202095255.GA13247@linutronix.de>

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Mon, 2 Dec 2013 10:52:55 +0100

> On tx submit the driver always dma_map_single() FEC_ENET_TX_FRSIZE (=2048)
> bytes. This works because we don't overwrite any memory after the data buffer,
> we remove it from cache if it was there. So we hurt performace in case the
> mapping of a smaller area makes a difference.
> There is also a bug: If the data area starts shortly before the end of
> RAM say 0xc7fffa10 and the RAM ends at 0xc8000000 then we have enough
> space to fit the data area (according to skb->len) but we would map beyond
> end of ram if we are using 2048. In v2.6.31 (against which kernel this patch
> made) there is the following check in dma_cache_maint():
> 
> |BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(start + size - 1));
> 
> Since the area starting at 0xc8000000 is no longer virt_addr_valid() we
> BUG() during dma_map_single(). The BUG() statement was removed in v3.5-rc1 as
> per 2dc6a016 ("ARM: dma-mapping: use asm-generic/dma-mapping-common.h").
> 
> This patch was tested on v2.6.31 and then forward-ported and compile
> tested only against the net tree. I think it is still worth fixing
> mainline even after the BUG() statement is gone.
> 
> Tested-by: Fugang Duan <B38611@freescale.com>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Applied, thanks.

  parent reply	other threads:[~2013-12-02 21:59 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
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 [this message]
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=20131202.165944.24925233570384450.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Fabio.Estevam@freescale.com \
    --cc=bigeasy@linutronix.de \
    --cc=frank.li@freescale.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 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).