Module Name: src Committed By: thorpej Date: Sun Mar 1 02:28:14 UTC 2020
Modified Files: src/sys/dev/pci: if_age.c if_alc.c if_ale.c Log Message: It doesn't make any sense to pass ETHER_ALIGN as the alignment constraint to bus_dmamem_alloc(). Use PAGE_SIZE instead. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/if_age.c cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/if_alc.c cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/if_ale.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_age.c diff -u src/sys/dev/pci/if_age.c:1.67 src/sys/dev/pci/if_age.c:1.68 --- src/sys/dev/pci/if_age.c:1.67 Tue Feb 4 05:44:14 2020 +++ src/sys/dev/pci/if_age.c Sun Mar 1 02:28:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_age.c,v 1.67 2020/02/04 05:44:14 thorpej Exp $ */ +/* $NetBSD: if_age.c,v 1.68 2020/03/01 02:28:14 thorpej Exp $ */ /* $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $ */ /*- @@ -31,7 +31,7 @@ /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.67 2020/02/04 05:44:14 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.68 2020/03/01 02:28:14 thorpej Exp $"); #include "vlan.h" @@ -698,7 +698,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for TX ring */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_TX_RING_SZ, - ETHER_ALIGN, 0, &sc->age_rdata.age_tx_ring_seg, 1, + PAGE_SIZE, 0, &sc->age_rdata.age_tx_ring_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Tx ring, " @@ -740,7 +740,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for RX ring */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_RX_RING_SZ, - ETHER_ALIGN, 0, &sc->age_rdata.age_rx_ring_seg, 1, + PAGE_SIZE, 0, &sc->age_rdata.age_rx_ring_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Rx ring, " @@ -782,7 +782,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for RX return ring */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_RR_RING_SZ, - ETHER_ALIGN, 0, &sc->age_rdata.age_rr_ring_seg, 1, + PAGE_SIZE, 0, &sc->age_rdata.age_rr_ring_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Rx " @@ -826,7 +826,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for CMB block */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_CMB_BLOCK_SZ, - ETHER_ALIGN, 0, &sc->age_rdata.age_cmb_block_seg, 1, + PAGE_SIZE, 0, &sc->age_rdata.age_cmb_block_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for " @@ -870,7 +870,7 @@ age_dma_alloc(struct age_softc *sc) /* Allocate DMA'able memory for SMB block */ error = bus_dmamem_alloc(sc->sc_dmat, AGE_SMB_BLOCK_SZ, - ETHER_ALIGN, 0, &sc->age_rdata.age_smb_block_seg, 1, + PAGE_SIZE, 0, &sc->age_rdata.age_smb_block_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for " Index: src/sys/dev/pci/if_alc.c diff -u src/sys/dev/pci/if_alc.c:1.49 src/sys/dev/pci/if_alc.c:1.50 --- src/sys/dev/pci/if_alc.c:1.49 Sat Feb 8 07:24:46 2020 +++ src/sys/dev/pci/if_alc.c Sun Mar 1 02:28:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_alc.c,v 1.49 2020/02/08 07:24:46 maxv Exp $ */ +/* $NetBSD: if_alc.c,v 1.50 2020/03/01 02:28:14 thorpej Exp $ */ /* $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $ */ /*- * Copyright (c) 2009, Pyun YongHyeon <yong...@freebsd.org> @@ -1581,7 +1581,7 @@ alc_dma_alloc(struct alc_softc *sc) /* Allocate DMA'able memory for TX ring */ error = bus_dmamem_alloc(sc->sc_dmat, ALC_TX_RING_SZ, - ETHER_ALIGN, 0, &sc->alc_rdata.alc_tx_ring_seg, 1, + PAGE_SIZE, 0, &sc->alc_rdata.alc_tx_ring_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Tx ring.\n", @@ -1619,7 +1619,7 @@ alc_dma_alloc(struct alc_softc *sc) /* Allocate DMA'able memory for RX ring */ error = bus_dmamem_alloc(sc->sc_dmat, ALC_RX_RING_SZ, - ETHER_ALIGN, 0, &sc->alc_rdata.alc_rx_ring_seg, 1, + PAGE_SIZE, 0, &sc->alc_rdata.alc_rx_ring_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Rx ring.\n", @@ -1657,7 +1657,7 @@ alc_dma_alloc(struct alc_softc *sc) /* Allocate DMA'able memory for RX return ring */ error = bus_dmamem_alloc(sc->sc_dmat, ALC_RR_RING_SZ, - ETHER_ALIGN, 0, &sc->alc_rdata.alc_rr_ring_seg, 1, + PAGE_SIZE, 0, &sc->alc_rdata.alc_rr_ring_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for Rx " @@ -1696,7 +1696,7 @@ alc_dma_alloc(struct alc_softc *sc) /* Allocate DMA'able memory for CMB block */ error = bus_dmamem_alloc(sc->sc_dmat, ALC_CMB_SZ, - ETHER_ALIGN, 0, &sc->alc_rdata.alc_cmb_seg, 1, + PAGE_SIZE, 0, &sc->alc_rdata.alc_cmb_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for " @@ -1736,7 +1736,7 @@ alc_dma_alloc(struct alc_softc *sc) /* Allocate DMA'able memory for SMB block */ error = bus_dmamem_alloc(sc->sc_dmat, ALC_SMB_SZ, - ETHER_ALIGN, 0, &sc->alc_rdata.alc_smb_seg, 1, + PAGE_SIZE, 0, &sc->alc_rdata.alc_smb_seg, 1, &nsegs, BUS_DMA_NOWAIT); if (error) { printf("%s: could not allocate DMA'able memory for " Index: src/sys/dev/pci/if_ale.c diff -u src/sys/dev/pci/if_ale.c:1.39 src/sys/dev/pci/if_ale.c:1.40 --- src/sys/dev/pci/if_ale.c:1.39 Tue Feb 4 05:44:14 2020 +++ src/sys/dev/pci/if_ale.c Sun Mar 1 02:28:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ale.c,v 1.39 2020/02/04 05:44:14 thorpej Exp $ */ +/* $NetBSD: if_ale.c,v 1.40 2020/03/01 02:28:14 thorpej Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yong...@freebsd.org> @@ -32,7 +32,7 @@ /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.39 2020/02/04 05:44:14 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.40 2020/03/01 02:28:14 thorpej Exp $"); #include "vlan.h" @@ -658,7 +658,7 @@ ale_dma_alloc(struct ale_softc *sc) /* Allocate DMA'able memory for TX ring */ error = bus_dmamem_alloc(sc->sc_dmat, ALE_TX_RING_SZ, - 0, 0, &sc->ale_cdata.ale_tx_ring_seg, 1, + PAGE_SIZE, 0, &sc->ale_cdata.ale_tx_ring_seg, 1, &nsegs, BUS_DMA_WAITOK); if (error) { printf("%s: could not allocate DMA'able memory for Tx ring, " @@ -701,7 +701,7 @@ ale_dma_alloc(struct ale_softc *sc) /* Allocate DMA'able memory for RX pages */ error = bus_dmamem_alloc(sc->sc_dmat, sc->ale_pagesize, - ETHER_ALIGN, 0, &sc->ale_cdata.ale_rx_page[i].page_seg, + PAGE_SIZE, 0, &sc->ale_cdata.ale_rx_page[i].page_seg, 1, &nsegs, BUS_DMA_WAITOK); if (error) { printf("%s: could not allocate DMA'able memory for " @@ -746,7 +746,7 @@ ale_dma_alloc(struct ale_softc *sc) } /* Allocate DMA'able memory for Tx CMB. */ - error = bus_dmamem_alloc(sc->sc_dmat, ALE_TX_CMB_SZ, ETHER_ALIGN, 0, + error = bus_dmamem_alloc(sc->sc_dmat, ALE_TX_CMB_SZ, PAGE_SIZE, 0, &sc->ale_cdata.ale_tx_cmb_seg, 1, &nsegs, BUS_DMA_WAITOK); if (error) { @@ -791,7 +791,7 @@ ale_dma_alloc(struct ale_softc *sc) /* Allocate DMA'able memory for Rx CMB */ error = bus_dmamem_alloc(sc->sc_dmat, ALE_RX_CMB_SZ, - ETHER_ALIGN, 0, &sc->ale_cdata.ale_rx_page[i].cmb_seg, 1, + PAGE_SIZE, 0, &sc->ale_cdata.ale_rx_page[i].cmb_seg, 1, &nsegs, BUS_DMA_WAITOK); if (error) { printf("%s: could not allocate DMA'able memory for "