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
This commit is contained in:
Eric Joyner 2017-06-10 18:56:30 +00:00
parent 834210fa5d
commit 5b83a512c1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319797

View File

@ -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 */