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.)
This commit is contained in:
Ruslan Ermilov 2006-08-14 15:35:43 +00:00
parent 8b3ae668b1
commit d0220c83e1

View file

@ -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;
}