Hi,
Andi Kleen wrote:
It shouldn't make any difference on !SLAB_DEBUG kernels because kmalloc
will pad typical mtus (1.5k, 9k) to 2k or 16k. But at least the
network driver is usable now again with slab debugging enabled.
Very odd. slab debugging doesn't affect the padding. Even with slab
debugging enabled, kmalloc pads allocations to 2k.
1) Ayaz - are there any known problems that might explain the behavior?
The driver allocates 1564+64 bytes memory for each rx buffer, and sets
the FlagLen field to 1564. Is it possible that the nic writes 80 bytes
beyond the end of the rx buffer?
2) Andi - does your system have more than 4 GB memory? As I noticed
yesterday, all pci_map_single() calls from the rx codepath actually
called pci_map_single() with size==0.
--
Manfred
--- 2.6/drivers/net/forcedeth.c 2005-12-19 01:36:54.000000000 +0100
+++ x64/drivers/net/forcedeth.c 2005-12-22 21:31:41.000000000 +0100
@@ -871,8 +871,8 @@
} else {
skb = np->rx_skbuff[nr];
}
- np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data,
skb->len,
- PCI_DMA_FROMDEVICE);
+ np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data,
+ skb->end-skb->data, PCI_DMA_FROMDEVICE);
if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) {
np->rx_ring.orig[nr].PacketBuffer =
cpu_to_le32(np->rx_dma[nr]);
wmb();
@@ -999,7 +999,7 @@
wmb();
if (np->rx_skbuff[i]) {
pci_unmap_single(np->pci_dev, np->rx_dma[i],
- np->rx_skbuff[i]->len,
+
np->rx_skbuff[i]->end-np->rx_skbuff[i]->data,
PCI_DMA_FROMDEVICE);
dev_kfree_skb(np->rx_skbuff[i]);
np->rx_skbuff[i] = NULL;
@@ -1334,7 +1334,7 @@
* the performance.
*/
pci_unmap_single(np->pci_dev, np->rx_dma[i],
- np->rx_skbuff[i]->len,
+ np->rx_skbuff[i]->end-np->rx_skbuff[i]->data,
PCI_DMA_FROMDEVICE);
{