From owner-freebsd-audit Fri Aug 10 16:40: 8 2001 Delivered-To: freebsd-audit@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 618) id CCEA637B405; Fri, 10 Aug 2001 16:40:02 -0700 (PDT) Subject: Re: Need reviewers for busdma changes to ethernet driver In-Reply-To: from Matthew Jacob at "Aug 10, 2001 03:44:33 pm" To: mjacob@feral.com Date: Fri, 10 Aug 2001 16:40:02 -0700 (PDT) Cc: audit@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20010810234002.CCEA637B405@hub.freebsd.org> From: wpaul@FreeBSD.ORG (Bill Paul) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > Seems mostly good. > > > 1. Nit: > > /* > * Obtain the physical addresses of the RX and TX > * rings which we'll need later in the init routine. > */ > > > More formally, it's not a 'physical address'- it's a "Bus Address", or > "Address appropriate for a device on this bus to use to access the > memory so mapped". Under sparc64, for example, it would be an iommu > mapping address. > > 2. All callback functions for dma- you should be checking error. Ok... > 3. You might want to recycle rather than create/destroy mbuf tags. I'm not creating/destroying tags, I'm creating/destroying dma maps (bus_dmamap_t). My understanding is that I need a dmamap for every buffer that I need to send to the NIC, and in the transmit case, I might have several buffers per packet (i.e. an mbuf list with all the packet fragments). But I can't know ahead of time how many fragments will be in the chain, so I can't really say "allocate this many dma maps for packet transmit." > You should note that FreeBSD's bus_dma is hardly as strict or as formal as > NetBSD's, so there's room for a lot of slop here. The key thing to test it on > is an alpha that has both direct-mapped and sgmap hardware to see that it > works. Hopefully I will be able to do this on Monday. In the meantime, I have also converted the RealTek driver: http://www.freebsd.org/~wpaul/RealTek/busdma This was somewhat easier because there's just one giant DMA buffer for receive and no descriptor structures. -Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message