netdev
[Top] [All Lists]

Re: [PATCH] b44 1GB DMA workaround (was: b44: add 47xx support)

To: Pekka Pietikainen <pp@xxxxxxxxxx>
Subject: Re: [PATCH] b44 1GB DMA workaround (was: b44: add 47xx support)
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Tue, 3 Aug 2004 18:39:19 -0700
Cc: jgarzik@xxxxxxxxx, jolt@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20040804003108.GA10445@xxxxxxxxxx>
References: <200407232335.37809.jolt@xxxxxxxxxx> <20040726141128.GA5435@xxxxxxxxxx> <20040804003108.GA10445@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Wed, 4 Aug 2004 03:31:08 +0300
Pekka Pietikainen <pp@xxxxxxxxxx> wrote:

> +     if(mapping+len > B44_DMA_MASK) {
> +             /* Chip can't handle DMA to/from >1GB, use bounce buffer */
> +             pci_unmap_single(bp->pdev, mapping, len,PCI_DMA_TODEVICE);
> +             memcpy(bp->tx_bufs+entry*TX_PKT_BUF_SZ,skb->data,skb->len);
> +             skb->data=bp->tx_bufs+entry*TX_PKT_BUF_SZ;
> +             mapping = pci_map_single(bp->pdev, skb->data, len, 
> PCI_DMA_TODEVICE);
> +     }

Changing skb->data is not legal.  Please implement this in
such a way that skb->data does not get modified.  By modifying
skb->data you will break things such as packet sniffers and
netfilter, and that's just the tip of the iceberg. :-)

I would suggest merely freeing up this TX skb, and marking the
entry in the b44 software state with some dummy skb pointer
such as (void *) 0x1UL or something like that to indicate
this case.

<Prev in Thread] Current Thread [Next in Thread>