From d0220c83e1969af7d112f2abe23e30789f515571 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Mon, 14 Aug 2006 15:35:43 +0000 Subject: [PATCH] Fix alignment of RX bufs DMA map to be realistic. Maybe it works on i386 (I don't know) but on amd64 at hand here, it paniced early at boot. (I'm pretty sure that PAGE_SIZE here was miscopied from another place during porting, where in OpenBSD bus_dmamem_alloc() is used, but there PAGE_SIZE means completely different thing.) --- sys/dev/nfe/if_nfe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/nfe/if_nfe.c b/sys/dev/nfe/if_nfe.c index b06189fa486..5e2f2fd89c6 100644 --- a/sys/dev/nfe/if_nfe.c +++ b/sys/dev/nfe/if_nfe.c @@ -652,7 +652,7 @@ nfe_alloc_rx_ring(struct nfe_softc *sc, struct nfe_rx_ring *ring) physaddr = jbuf->physaddr; } else { error = bus_dma_tag_create(sc->nfe_parent_tag, - PAGE_SIZE, 0, /* alignment, boundary */ + ETHER_ALIGN, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ @@ -681,7 +681,7 @@ nfe_alloc_rx_ring(struct nfe_softc *sc, struct nfe_rx_ring *ring) error = bus_dmamap_load(data->rx_data_tag, data->rx_data_map, mtod(data->m, void *), MCLBYTES, nfe_dma_map_segs, &data->rx_data_segs, BUS_DMA_NOWAIT); if (error != 0) { - printf("nfe%d: could not load rx buf DMA map", sc->nfe_unit); + printf("nfe%d: could not load rx buf DMA map\n", sc->nfe_unit); goto fail; }