svn commit: r280962 - head/sys/dev/ixgbe
Eric Joyner
erj at FreeBSD.org
Wed Apr 1 17:19:57 UTC 2015
Author: erj
Date: Wed Apr 1 17:19:55 2015
New Revision: 280962
URL: https://svnweb.freebsd.org/changeset/base/280962
Log:
Make changes to busdma code in tx/rx path similar to the ones made in r257541.
- bus_dmamap_create() does not take the BUS_DMA_NOWAIT flag
- properly unload maps
- do not assign NULL to dma map pointers
Submitted by: Konstantin Belousov <kostikbel at gmail.com>
Approved by: jfv (mentor)
MFC after: 1 week
Modified:
head/sys/dev/ixgbe/ix_txrx.c
Modified: head/sys/dev/ixgbe/ix_txrx.c
==============================================================================
--- head/sys/dev/ixgbe/ix_txrx.c Wed Apr 1 17:05:45 2015 (r280961)
+++ head/sys/dev/ixgbe/ix_txrx.c Wed Apr 1 17:19:55 2015 (r280962)
@@ -1049,7 +1049,6 @@ ixgbe_txeof(struct tx_ring *txr)
buf->map);
m_freem(buf->m_head);
buf->m_head = NULL;
- buf->map = NULL;
}
buf->eop = NULL;
++txr->tx_avail;
@@ -1075,7 +1074,6 @@ ixgbe_txeof(struct tx_ring *txr)
buf->map);
m_freem(buf->m_head);
buf->m_head = NULL;
- buf->map = NULL;
}
++txr->tx_avail;
buf->eop = NULL;
@@ -1319,6 +1317,7 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr,
*/
if ((rxbuf->flags & IXGBE_RX_COPY) == 0) {
/* Get the memory mapping */
+ bus_dmamap_unload(rxr->ptag, rxbuf->pmap);
error = bus_dmamap_load_mbuf_sg(rxr->ptag,
rxbuf->pmap, mp, seg, &nsegs, BUS_DMA_NOWAIT);
if (error != 0) {
@@ -1395,8 +1394,7 @@ ixgbe_allocate_receive_buffers(struct rx
for (i = 0; i < rxr->num_desc; i++, rxbuf++) {
rxbuf = &rxr->rx_buffers[i];
- error = bus_dmamap_create(rxr->ptag,
- BUS_DMA_NOWAIT, &rxbuf->pmap);
+ error = bus_dmamap_create(rxr->ptag, 0, &rxbuf->pmap);
if (error) {
device_printf(dev, "Unable to create RX dma map\n");
goto fail;
@@ -1715,6 +1713,7 @@ ixgbe_rx_discard(struct rx_ring *rxr, in
m_free(rbuf->buf);
rbuf->buf = NULL;
}
+ bus_dmamap_unload(rxr->ptag, rbuf->pmap);
rbuf->flags = 0;
More information about the svn-src-head
mailing list