[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

rtl8139.c too memory hungry for mach.



Hi!

I just found out why my Realtek card would not work in a mach kernel
(Debian version 1.1.92-5 is what I tried):

rtl8139.c by default tries to kmalloc() a 64K ring buffer, while the upper
limit on kmalloc()s in the linux glue layer is 64K minus some overhead.
The comments in linux/dev/glue/kmem.c sound like it's not trivial to
cleanly raise this limit, so the best fix for now is probably to lower the
default buffer size of the realtek driver in the gnumach sources. (On a
quick glance through linux/src/drivers/net/*, rtl8139.c looks like the
only network driver that actually hits the glue layer limit.)

---[snip]---

--- rtl8139.c.orig	Wed Jul 14 19:19:27 1999
+++ rtl8139.c	Wed Jul 14 19:20:27 1999
@@ -38,7 +38,7 @@
 static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 /* Size of the in-memory receive ring. */
-#define RX_BUF_LEN_IDX	3			/* 0==8K, 1==16K, 2==32K, 3==64K */
+#define RX_BUF_LEN_IDX	2			/* 0==8K, 1==16K, 2==32K, 3==64K */
 #define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX)
 /* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
 #define TX_BUF_SIZE	1536
@@ -678,6 +678,7 @@
 	tp->tx_bufs = kmalloc(TX_BUF_SIZE * NUM_TX_DESC, GFP_KERNEL);
 	tp->rx_ring = kmalloc(RX_BUF_LEN + 16, GFP_KERNEL);
 	if (tp->tx_bufs == NULL ||  tp->rx_ring == NULL) {
+		free_irq(dev->irq, dev);
 		if (tp->tx_bufs)
 			kfree(tp->tx_bufs);
 		if (rtl8129_debug > 0)

---[snap]---

Regards,

Daniel.



Reply to: