Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci It doesn't make any sense to pass ETHER_ALIGN as...



details:   https://anonhg.NetBSD.org/src/rev/aadb6d4af904
branches:  trunk
changeset: 745379:aadb6d4af904
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Mar 01 02:28:14 2020 +0000

description:
It doesn't make any sense to pass ETHER_ALIGN as the alignment constraint
to bus_dmamem_alloc().  Use PAGE_SIZE instead.

diffstat:

 sys/dev/pci/if_age.c |  14 +++++++-------
 sys/dev/pci/if_alc.c |  12 ++++++------
 sys/dev/pci/if_ale.c |  12 ++++++------
 3 files changed, 19 insertions(+), 19 deletions(-)

diffs (171 lines):

diff -r 4fbde756bdb7 -r aadb6d4af904 sys/dev/pci/if_age.c
--- a/sys/dev/pci/if_age.c      Sun Mar 01 02:26:16 2020 +0000
+++ b/sys/dev/pci/if_age.c      Sun Mar 01 02:28:14 2020 +0000
@@ -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 @@
 
        /* 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 @@
 
        /* 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 @@
 
        /* 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 @@
 
        /* 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 @@
 
        /* 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 "
diff -r 4fbde756bdb7 -r aadb6d4af904 sys/dev/pci/if_alc.c
--- a/sys/dev/pci/if_alc.c      Sun Mar 01 02:26:16 2020 +0000
+++ b/sys/dev/pci/if_alc.c      Sun Mar 01 02:28:14 2020 +0000
@@ -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 <yongari%FreeBSD.org@localhost>
@@ -1581,7 +1581,7 @@
 
        /* 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 @@
 
        /* 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 @@
 
        /* 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 @@
 
        /* 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 @@
 
        /* 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 "
diff -r 4fbde756bdb7 -r aadb6d4af904 sys/dev/pci/if_ale.c
--- a/sys/dev/pci/if_ale.c      Sun Mar 01 02:26:16 2020 +0000
+++ b/sys/dev/pci/if_ale.c      Sun Mar 01 02:28:14 2020 +0000
@@ -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 <yongari%FreeBSD.org@localhost>
@@ -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 @@
 
        /* 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 @@
 
                /* 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 @@
        }
 
        /* 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 @@
 
                /* 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 "



Home | Main Index | Thread Index | Old Index