diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2019-03-01 06:16:00 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2019-03-01 06:16:00 +0000 |
commit | 24eebc13be6b873ec2bb5d6c086966c6384952e2 (patch) | |
tree | 6b913f9dfe691c95b4186bcb8161509f62c5520e /sys/dev/pci/if_ix.c | |
parent | d29a5aa65bfd884803a1eb5820f990d919696aa4 (diff) |
bus_dmamap_sync when we fill the rx ring, not for ever slot on the ring.
Diffstat (limited to 'sys/dev/pci/if_ix.c')
-rw-r--r-- | sys/dev/pci/if_ix.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c index b23dce349cd..c8cef1c6390 100644 --- a/sys/dev/pci/if_ix.c +++ b/sys/dev/pci/if_ix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ix.c,v 1.155 2019/02/26 04:04:30 dlg Exp $ */ +/* $OpenBSD: if_ix.c,v 1.156 2019/03/01 06:15:59 dlg Exp $ */ /****************************************************************************** @@ -2374,7 +2374,6 @@ ixgbe_get_buf(struct rx_ring *rxr, int i) struct mbuf *mp; int error; union ixgbe_adv_rx_desc *rxdesc; - size_t dsize = sizeof(union ixgbe_adv_rx_desc); rxbuf = &rxr->rx_buffers[i]; rxdesc = &rxr->rx_base[i]; @@ -2403,14 +2402,8 @@ ixgbe_get_buf(struct rx_ring *rxr, int i) 0, rxbuf->map->dm_mapsize, BUS_DMASYNC_PREREAD); rxbuf->buf = mp; - bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, - dsize * i, dsize, BUS_DMASYNC_POSTWRITE); - rxdesc->read.pkt_addr = htole64(rxbuf->map->dm_segs[0].ds_addr); - bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, - dsize * i, dsize, BUS_DMASYNC_PREWRITE); - return (0); } @@ -2503,6 +2496,10 @@ ixgbe_rxfill(struct rx_ring *rxr) u_int slots; int i; + bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, + 0, rxr->rxdma.dma_map->dm_mapsize, + BUS_DMASYNC_POSTWRITE); + i = rxr->last_desc_filled; for (slots = if_rxr_get(&rxr->rx_ring, sc->num_rx_desc); slots > 0; slots--) { @@ -2516,6 +2513,10 @@ ixgbe_rxfill(struct rx_ring *rxr) post = 1; } + bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, + 0, rxr->rxdma.dma_map->dm_mapsize, + BUS_DMASYNC_PREWRITE); + if_rxr_put(&rxr->rx_ring, slots); return (post); |