Page MenuHomeFreeBSD

D28706.id84018.diff
No OneTemporary

D28706.id84018.diff

diff --git a/sys/net/iflib.h b/sys/net/iflib.h
--- a/sys/net/iflib.h
+++ b/sys/net/iflib.h
@@ -236,6 +236,8 @@
int isc_disable_msix;
if_txrx_t isc_txrx;
struct ifmedia *isc_media;
+ bus_size_t isc_dma_width; /* device dma width in bits, 0 means
+ use BUS_SPACE_MAXADDR instead */
} *if_softc_ctx_t;
/*
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -1394,10 +1394,15 @@
{
int err;
device_t dev = ctx->ifc_dev;
+ bus_addr_t lowaddr;
+
+ lowaddr = (1ULL << ctx->ifc_softc_ctx.isc_dma_width) - 1ULL;
+ if (lowaddr == 0)
+ lowaddr = BUS_SPACE_MAXADDR;
err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
align, 0, /* alignment, bounds */
- BUS_SPACE_MAXADDR, /* lowaddr */
+ lowaddr, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
size, /* maxsize */
@@ -1648,6 +1653,7 @@
if_softc_ctx_t scctx = &ctx->ifc_softc_ctx;
device_t dev = ctx->ifc_dev;
bus_size_t tsomaxsize;
+ bus_addr_t lowaddr;
int err, nsegments, ntsosegments;
bool tso;
@@ -1664,12 +1670,16 @@
MPASS(sctx->isc_tso_maxsize >= tsomaxsize);
}
+ lowaddr = (1ULL << scctx->isc_dma_width) - 1ULL;
+ if (lowaddr == 0)
+ lowaddr = BUS_SPACE_MAXADDR;
+
/*
* Set up DMA tags for TX buffers.
*/
if ((err = bus_dma_tag_create(bus_get_dma_tag(dev),
1, 0, /* alignment, bounds */
- BUS_SPACE_MAXADDR, /* lowaddr */
+ lowaddr, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
sctx->isc_tx_maxsize, /* maxsize */
@@ -1687,7 +1697,7 @@
tso = (if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) != 0;
if (tso && (err = bus_dma_tag_create(bus_get_dma_tag(dev),
1, 0, /* alignment, bounds */
- BUS_SPACE_MAXADDR, /* lowaddr */
+ lowaddr, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
tsomaxsize, /* maxsize */
@@ -1889,18 +1899,23 @@
if_softc_ctx_t scctx = &ctx->ifc_softc_ctx;
device_t dev = ctx->ifc_dev;
iflib_fl_t fl;
+ bus_addr_t lowaddr;
int err;
MPASS(scctx->isc_nrxd[0] > 0);
MPASS(scctx->isc_nrxd[rxq->ifr_fl_offset] > 0);
+ lowaddr = (1ULL << scctx->isc_dma_width) - 1ULL;
+ if (lowaddr == 0)
+ lowaddr = BUS_SPACE_MAXADDR;
+
fl = rxq->ifr_fl;
for (int i = 0; i < rxq->ifr_nfl; i++, fl++) {
fl->ifl_size = scctx->isc_nrxd[rxq->ifr_fl_offset]; /* this isn't necessarily the same */
/* Set up DMA tag for RX buffers. */
err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, 0, /* alignment, bounds */
- BUS_SPACE_MAXADDR, /* lowaddr */
+ lowaddr, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
sctx->isc_rx_maxsize, /* maxsize */

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 7:32 PM (2 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14782491
Default Alt Text
D28706.id84018.diff (2 KB)

Event Timeline