From owner-svn-src-head@freebsd.org Sat Jun 10 18:56:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91A4BBF40D3; Sat, 10 Jun 2017 18:56:31 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5A983574; Sat, 10 Jun 2017 18:56:31 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5AIuU5d024063; Sat, 10 Jun 2017 18:56:30 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5AIuUe1024062; Sat, 10 Jun 2017 18:56:30 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201706101856.v5AIuUe1024062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Sat, 10 Jun 2017 18:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319797 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jun 2017 18:56:31 -0000 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 Reviewed by: erj Approved by: Alan Cox 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 */