Messages in this thread | | | From | Laurentiu Tudor <> | Subject | Re: [PATCH v2 3/3] dpaa2_eth: use new unmap and sync dma api variants | Date | Wed, 6 Nov 2019 11:17:58 +0000 |
| |
On 28.10.2019 13:38, hch@lst.de wrote: > On Mon, Oct 28, 2019 at 10:55:05AM +0000, Laurentiu Tudor wrote: >>>> @@ -85,9 +75,10 @@ static void free_rx_fd(struct dpaa2_eth_priv *priv, >>>> sgt = vaddr + dpaa2_fd_get_offset(fd); >>>> for (i = 1; i < DPAA2_ETH_MAX_SG_ENTRIES; i++) { >>>> addr = dpaa2_sg_get_addr(&sgt[i]); >>>> - sg_vaddr = dpaa2_iova_to_virt(priv->iommu_domain, addr); >>>> - dma_unmap_page(dev, addr, DPAA2_ETH_RX_BUF_SIZE, >>>> - DMA_BIDIRECTIONAL); >>>> + sg_vaddr = page_to_virt >>>> + (dma_unmap_page_desc(dev, addr, >>>> + DPAA2_ETH_RX_BUF_SIZE, >>>> + DMA_BIDIRECTIONAL)); >>> >>> This is doing virt -> page -> virt. Why not just have the new >>> function return the VA corresponding to the addr, which would >>> match the other functions? >> >> I'd really like that as it would get rid of the page_to_virt() calls but >> it will break the symmetry with the dma_map_page() API. I'll let the >> maintainers decide. > > It would be symmetric with dma_map_single, though. Maybe we need > both variants?
Patch 1/3 also adds an dma_unmap_single_desc(). Would it be legal to just use dma_unmap_single_desc() in the driver even if the driver does it's mappings with dma_map_page()?
--- Best Regards, Laurentiu
| |