[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C27F8246C663564A84BB7AB34397724218065B9850@IRVEXCHCCR01.corp.ad.broadcom.com>
Date: Mon, 30 Nov 2009 02:26:49 -0800
From: "Michael Chan" <mchan@...adcom.com>
To: "'Alexander Duyck'" <alexander.h.duyck@...el.com>,
"Matthew Carlson" <mcarlson@...adcom.com>,
"sathyap@...verengines.com" <sathyap@...verengines.com>,
"subbus@...verengines.com" <subbus@...verengines.com>,
"davem@...emloft.net" <davem@...emloft.net>
cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [RFC PATCH 07/10] bnx2: remove skb_dma_map/unmap calls from
driver
Alexander Duyck wrote:
> Due to the fact that skb_dma_map/unmap do not work correctly when a HW
> IOMMU is enabled it has been recommended to go about removing
> the calls
> from the network device drivers.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@...el.com>
Thanks Alexander. Sorry for the late response, I just got back
from vacation. It looks ok except in bnx2_free_tx_skbs():
> @@ -5295,18 +5303,30 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
> for (j = 0; j < TX_DESC_CNT; ) {
> struct sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];
> struct sk_buff *skb = tx_buf->skb;
> + int k, last;
>
> if (skb == NULL) {
> j++;
> continue;
> }
>
> - skb_dma_unmap(&bp->pdev->dev, skb,
> DMA_TO_DEVICE);
> + pci_unmap_single(bp->pdev,
> + pci_unmap_addr(tx_buf,
> mapping),
> + skb_headlen(skb),
> + PCI_DMA_TODEVICE);
>
> tx_buf->skb = NULL;
>
> - j += skb_shinfo(skb)->nr_frags + 1;
> + last = skb_shinfo(skb)->nr_frags;
> + for (k = 0; k < last; k++) {
> + tx_buf = &txr->tx_buf_ring[j + k + 1];
j + k + 1 can go beyond the ring when the ring wraps around.
I'll send an updated patch tomorrow.
> + pci_unmap_page(bp->pdev,
> + pci_unmap_addr(tx_buf, mapping),
> + skb_shinfo(skb)->frags[j].size,
> + PCI_DMA_TODEVICE);
> + }
> dev_kfree_skb(skb);
> + j += k + 1;
> }
> }
> }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists