summaryrefslogtreecommitdiffstats
path: root/sys/dev/txp
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2009-08-31 22:09:48 +0000
committeryongari <yongari@FreeBSD.org>2009-08-31 22:09:48 +0000
commit163abd382b85a67343f4b21f5e748d95243859ad (patch)
tree7e591f6ef4fed9e3c97d13f1bb33fcaf07bd991e /sys/dev/txp
parentf193f1ad30e91ead346558aaaa5bce2169e5cd67 (diff)
downloadFreeBSD-src-163abd382b85a67343f4b21f5e748d95243859ad.zip
FreeBSD-src-163abd382b85a67343f4b21f5e748d95243859ad.tar.gz
Make sure rx descriptor ring align on 16 bytes. I guess the
alignment requirement could be multiple of 4 bytes but I think using descriptor size would make intention clearer. Previously the size of rx descriptor was not power of 2 so it caused panic in bus_dmamem_alloc(9). Reported by: Jeff Blank (jb000003 <> mr-happy dot com) MFC after: 3 days
Diffstat (limited to 'sys/dev/txp')
-rw-r--r--sys/dev/txp/if_txp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c
index 619b3f7..9396f4d 100644
--- a/sys/dev/txp/if_txp.c
+++ b/sys/dev/txp/if_txp.c
@@ -1389,7 +1389,8 @@ txp_alloc_rings(struct txp_softc *sc)
/* High priority rx ring. */
error = txp_dma_alloc(sc, "hi priority rx ring",
- &sc->sc_cdata.txp_rxhiring_tag, sizeof(struct txp_rx_desc), 0,
+ &sc->sc_cdata.txp_rxhiring_tag,
+ roundup(sizeof(struct txp_rx_desc), 16), 0,
&sc->sc_cdata.txp_rxhiring_map, (void **)&sc->sc_ldata.txp_rxhiring,
sizeof(struct txp_rx_desc) * RX_ENTRIES,
&sc->sc_ldata.txp_rxhiring_paddr);
@@ -1409,7 +1410,8 @@ txp_alloc_rings(struct txp_softc *sc)
/* Low priority rx ring. */
error = txp_dma_alloc(sc, "low priority rx ring",
- &sc->sc_cdata.txp_rxloring_tag, sizeof(struct txp_rx_desc), 0,
+ &sc->sc_cdata.txp_rxloring_tag,
+ roundup(sizeof(struct txp_rx_desc), 16), 0,
&sc->sc_cdata.txp_rxloring_map, (void **)&sc->sc_ldata.txp_rxloring,
sizeof(struct txp_rx_desc) * RX_ENTRIES,
&sc->sc_ldata.txp_rxloring_paddr);
OpenPOWER on IntegriCloud