huge memory leak

From: Andy Fleming
Date: Thu Apr 15 2004 - 13:36:02 EST

I'm working on an ethernet driver for an integrated processor (the MPC8540/8560). The source is currently available in drivers/net/gianfar.c in Linux 2.4. Currently, when I set the number of transmit buffer descriptors to 16 or lower (using ethtool -G eth1 tx 16), and run a sufficiently packet intensive test (ping -f does not suffice, but ftp does), memory starts leaking like crazy (about 1-2 MB per second). If I don't stop the transfer within seconds, all 128 MB of my memory is taken.

I'm having a great deal of trouble tracking this down. It appears that the descriptor ring is filling up, and I am telling the queue to halt by calling netif_stop_queue(). I have scattered printks about, and it does not appear that the driver is having to drop any packets (currently, it detects that the next hard_start_xmit() call would fail, and stops the queue if that is the case). However, the counter I increment when the ring fills up only increments when this memory leak manifests, so I suspect that the ring filling up is connected somehow to the problem. I'm not seeing anywhere in the kernel that could be losing so many packets, and I can't see anywhere in the driver that could, so I'm at a loss. I'm hoping someone on this list might have a better intuition as to what is causing this bug.

Andy Fleming
Software Enablement
Motorola SPS

To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at