All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: David Laight <David.Laight@ACULAB.COM>,
	David Miller <davem@davemloft.net>,
	Russell King <linux@arm.linux.org.uk>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"B38611@freescale.com" <B38611@freescale.com>,
	"fabio.estevam@freescale.com" <fabio.estevam@freescale.com>
Subject: Re: [PATCH v2] net: mv643xx_eth: Fix highmem support in non-TSO egress path
Date: Thu, 22 Jan 2015 10:26:56 -0300	[thread overview]
Message-ID: <54C0FAA0.9040002@free-electrons.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CAD0E4F@AcuExch.aculab.com>

On 01/22/2015 09:40 AM, David Laight wrote:
> From: Ezequiel Garcia
>> Commit 69ad0dd7af22b61d9e0e68e56b6290121618b0fb
>> Author: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
>> Date:   Mon May 19 13:59:59 2014 -0300
>>
>>     net: mv643xx_eth: Use dma_map_single() to map the skb fragments
>>
>> caused a nasty regression by removing the support for highmem skb
>> fragments. By using page_address() to get the address of a fragment's
>> page, we are assuming a lowmem page. However, such assumption is incorrect,
>> as fragments can be in highmem pages, resulting in very nasty issues.
>>
>> This commit fixes this by using the skb_frag_dma_map() helper,
>> which takes care of mapping the skb fragment properly. Additionally,
>> the type of mapping is now tracked, so it can be unmapped using
>> dma_unmap_page or dma_unmap_single when appropriate.
>>
>> Fixes: 69ad0dd7af22 ("net: mv643xx_eth: Use dma_map_single() to map the skb fragments")
>> Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
>> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ...
>> @@ -2048,6 +2068,11 @@ static int txq_init(struct mv643xx_eth_private *mp, int index)
>>  					nexti * sizeof(struct tx_desc);
>>  	}
>>
>> +	txq->tx_desc_mapping = kcalloc(txq->tx_ring_size, sizeof(char),
>> +				       GFP_KERNEL);
>> +	if (!txq->tx_desc_mapping)
>> +		return -ENOMEM;
>> +
>>  	/* Allocate DMA buffers for TSO MAC/IP/TCP headers */
>>  	txq->tso_hdrs = dma_alloc_coherent(mp->dev->dev.parent,
>>  					   txq->tx_ring_size * TSO_HEADER_SIZE,
> 
> I'm guessing there is an error path for dma_alloc_coherent() failing.
> You've not modified it to free tx_desc_mapping.
> 

Yeah, you guess right.
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

  reply	other threads:[~2015-01-22 13:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 12:14 [PATCH v2] net: mv643xx_eth: Fix highmem support in non-TSO egress path Ezequiel Garcia
2015-01-22 12:40 ` David Laight
2015-01-22 13:26   ` Ezequiel Garcia [this message]
2015-01-22 14:33 ` [PATCH v3] " Ezequiel Garcia
2015-01-24 13:45   ` Ezequiel Garcia
2015-01-26 23:11     ` Russell King - ARM Linux
2015-01-27  0:15   ` 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=54C0FAA0.9040002@free-electrons.com \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=B38611@freescale.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=fabio.estevam@freescale.com \
    --cc=linux@arm.linux.org.uk \
    --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.