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@gmail.com>
Approved by:	jfv (mentor)
MFC after:	1 week
This commit is contained in:
Eric Joyner 2015-04-01 17:19:55 +00:00
parent 1849df3006
commit 892406d827

View File

@ -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, int limit)
*/
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_ring *rxr)
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, int i)
m_free(rbuf->buf);
rbuf->buf = NULL;
}
bus_dmamap_unload(rxr->ptag, rbuf->pmap);
rbuf->flags = 0;