[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87k1ngjjtd.fsf@bootlin.com>
Date: Thu, 20 Sep 2018 16:59:58 +0200
From: Gregory CLEMENT <gregory.clement@...tlin.com>
To: Antoine Tenart <antoine.tenart@...tlin.com>
Cc: Yelena Krivosheev <yelena@...vell.com>,
"davem\@davemloft.net" <davem@...emloft.net>,
"netdev\@vger.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
"thomas.petazzoni\@bootlin.com" <thomas.petazzoni@...tlin.com>,
"maxime.chevallier\@bootlin.com" <maxime.chevallier@...tlin.com>,
"miquel.raynal\@bootlin.com" <miquel.raynal@...tlin.com>,
Nadav Haklai <nadavh@...vell.com>,
Stefan Chulski <stefanc@...vell.com>,
Yan Markman <ymarkman@...vell.com>,
"mw\@semihalf.com" <mw@...ihalf.com>
Subject: Re: [EXT] [PATCH net] net: mvneta: fix the Rx desc buffer DMA unmapping
Hi Antoine,
On jeu., sept. 20 2018, Antoine Tenart <antoine.tenart@...tlin.com> wrote:
> Hi Yelena,
>
> On Thu, Sep 20, 2018 at 10:14:56AM +0000, Yelena Krivosheev wrote:
>>
>> Please, check and fix all cases of dma_unmap_single() usage.
>> See mvneta_rxq_drop_pkts()
>> ...
>> if (!data || !(rx_desc->buf_phys_addr))
>> continue;
>> dma_unmap_single(pp->dev->dev.parent, rx_desc->buf_phys_addr,
>> MVNETA_RX_BUF_SIZE(pp->pkt_size), DMA_FROM_DEVICE);
>> __free_page(data);
>> ...
>
> I had a look at the one reported by CONFIG_DMA_API_DEBUG, and at DMA
> unmapping calls using PAGE_SIZE. As you pointed out there might be
> others parts, thanks!
Actually Jisheng had submitted a similar patch few weeks ago and as I
pointed at this time, the dma_unmap in mvneta_rxq_drop_pkts can be
called when the allocation is done in with HWBM in this case which use a
dma_map_single.
I though that in this case using dma_map_single is the things to do even
if in the SWBM case it is less optimal.
Gregory
>
> Antoine
>
> --
> Antoine Ténart, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
Powered by blists - more mailing lists