Date: Sat, 10 Jun 2017 18:56:30 +0000 (UTC) From: Eric Joyner <erj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319797 - head/sys/dev/ixl Message-ID: <201706101856.v5AIuUe1024062@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: erj Date: Sat Jun 10 18:56:30 2017 New Revision: 319797 URL: https://svnweb.freebsd.org/changeset/base/319797 Log: 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 Modified: head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Sat Jun 10 18:52:13 2017 (r319796) +++ head/sys/dev/ixl/ixl_txrx.c Sat Jun 10 18:56:30 2017 (r319797) @@ -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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706101856.v5AIuUe1024062>