aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixl/ixl_txrx.c
diff options
context:
space:
mode:
authorEric Joyner <erj@FreeBSD.org>2017-06-10 18:56:30 +0000
committerEric Joyner <erj@FreeBSD.org>2017-06-10 18:56:30 +0000
commit5b83a512c1d4017a966305bdac1251f7ac2a788e (patch)
tree8180d723d739c4f85e8a89ee4bf94018ac0e19df /sys/dev/ixl/ixl_txrx.c
parent834210fa5d2b519de35a5654894506cfca20375d (diff)
downloadsrc-5b83a512c1d4017a966305bdac1251f7ac2a788e.tar.gz
src-5b83a512c1d4017a966305bdac1251f7ac2a788e.zip
ixl(4)/ixlv(4): Fix some busdma tags and improper map NULL.
Description from Brett: "The busdma tags used to create mappings for the tx and rx rings did not have the device's tag as parents, meaning that they did not respect the device's busdma properties. The other tags used in the driver had their parents set appropriately. Also, the dma maps for each buffer in ixl_txeof() were being NULLed after being unloaded, which is an error because those maps are then reused without being recreated (I believe this also leaked resources since the maps were not destroyed). Simply removing the line that sets the maps to NULL gives the desired behavior. There does not seem to be a similar problem with ixl_rxeof(). Functions to free the tx and rx rings also NULL out the dma maps for each buffer, but this seems okay because the maps are destroyed and not reused in this case. With these fixes, my ixl card seems to be working with the IOMMU enabled." Submitted by: Brett Gutstein <bgutstein@rice.edu> Reviewed by: erj Approved by: Alan Cox <alc@rice.edu> MFC after: 1 week
Notes
Notes: svn path=/head/; revision=319797
Diffstat (limited to 'sys/dev/ixl/ixl_txrx.c')
-rw-r--r--sys/dev/ixl/ixl_txrx.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/ixl/ixl_txrx.c b/sys/dev/ixl/ixl_txrx.c
index 7e168dd511bd..cfa58c75b05c 100644
--- a/sys/dev/ixl/ixl_txrx.c
+++ b/sys/dev/ixl/ixl_txrx.c
@@ -431,7 +431,7 @@ ixl_allocate_tx_data(struct ixl_queue *que)
/*
* Setup DMA descriptor areas.
*/
- if ((error = bus_dma_tag_create(NULL, /* parent */
+ if ((error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
@@ -448,7 +448,7 @@ ixl_allocate_tx_data(struct ixl_queue *que)
}
/* Make a special tag for TSO */
- if ((error = bus_dma_tag_create(NULL, /* parent */
+ if ((error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
@@ -933,7 +933,6 @@ ixl_txeof(struct ixl_queue *que)
buf->map);
m_freem(buf->m_head);
buf->m_head = NULL;
- buf->map = NULL;
}
buf->eop_index = -1;
@@ -1096,7 +1095,7 @@ ixl_allocate_rx_data(struct ixl_queue *que)
return (error);
}
- if ((error = bus_dma_tag_create(NULL, /* parent */
+ if ((error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
@@ -1112,7 +1111,7 @@ ixl_allocate_rx_data(struct ixl_queue *que)
return (error);
}
- if ((error = bus_dma_tag_create(NULL, /* parent */
+ if ((error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */