Subject: Re: [EXT] [PATCH net-next 07/16] qlge: Deduplicate rx buffer queue management

From: Benjamin Poirier <[email-masked]>
Date: Tue, 9 Jul 2019 11:10:11 +0900

On 2019/06/27 10:02, Manish Chopra wrote:
> >  	while (curr_idx != clean_idx) {
> > -		lbq_desc = &rx_ring->lbq[curr_idx];
> > +		struct qlge_bq_desc *lbq_desc = &rx_ring-
> > >lbq.queue[curr_idx];
> > 
> >  		if (lbq_desc->p.pg_chunk.offset == last_offset)
> > -			pci_unmap_page(qdev->pdev, lbq_desc-
> > >p.pg_chunk.map,
> > +			pci_unmap_page(qdev->pdev, lbq_desc->dma_addr,
> >  				       ql_lbq_block_size(qdev),
> >  				       PCI_DMA_FROMDEVICE);
> 
> In this patch, lbq_desc->dma_addr points to offset in the page. So unmapping is broken within this patch.
> Would have been nicer to fix this in the same patch although it might have been taken care in next patches probably.
> 

Indeed, thanks. The same applies in ql_get_curr_lchunk().
Replaced with the following for v2:
+			pci_unmap_page(qdev->pdev, lbq_desc->dma_addr -
+				       last_offset, ql_lbq_block_size(qdev),