On 7/13/07, Jörg Anslik <[EMAIL PROTECTED]> wrote:

Hi Sephe,

your fix for the bfe network interface does the trick...almost! :-)

I can now access /dev/bfe0 without causing the machine to freeze, but
unfortunately, there's no way to communicate over the network; the
system displays "bfe0: bfe_encap bus_dmamap_load failed: 36" error
messages when the interface is ifconfig'd UP or dhclient is started.

Anyway, I believe it's true the bfe driver has some serious problems
with machines that have >1GB of RAM -- your fix proves that.

And unless you have a fix for the bus_dmamap_load issue described
above at hand, I'll further investigate.

Please apply the attached patch too.  Looks like bounce pages are not
allocated at all.

Best Regards,
sephe

--
Live Free or Die
--- busdma_machdep.c.orig       2007-07-13 12:07:26.073968370 +0800
+++ busdma_machdep.c    2007-07-13 12:06:18.324898557 +0800
@@ -45,7 +45,7 @@
 
 #include <machine/md_var.h>
 
-#define MAX_BPAGES 128
+#define MAX_BPAGES 1024
 
 struct bus_dma_tag {
        bus_dma_tag_t     parent;
@@ -289,9 +289,12 @@ bus_dmamap_create(bus_dma_tag_t dmat, in
                                panic("bus_dmamap_create: page reallocation "
                                      "not implemented");
                        }
-                       pages = atop(dmat->maxsize);
+
+                       pages = MAX(atop(dmat->maxsize), 1);
                        pages = MIN(maxpages - total_bpages, pages);
-                       error = alloc_bounce_pages(dmat, pages);
+                       pages = MAX(pages, 1);
+                       if (alloc_bounce_pages(dmat, pages) < pages)
+                               error = ENOMEM;
 
                        if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) {
                                if (error == 0)

Reply via email to