From owner-freebsd-hackers@FreeBSD.ORG Sun May 9 22:16:25 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2CEBF106564A; Sun, 9 May 2010 22:16:25 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from smtp.lamaiziere.net (net.lamaiziere.net [91.121.44.19]) by mx1.freebsd.org (Postfix) with ESMTP id E67DE8FC0C; Sun, 9 May 2010 22:16:24 +0000 (UTC) Received: from baby-jane.lamaiziere.net (unknown [192.168.1.10]) by smtp.lamaiziere.net (Postfix) with ESMTP id 591D263307D; Mon, 10 May 2010 00:16:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by baby-jane.lamaiziere.net (Postfix) with ESMTP id 97A352CEC17; Mon, 10 May 2010 00:16:38 +0200 (CEST) Date: Mon, 10 May 2010 00:16:37 +0200 From: Patrick Lamaiziere To: Oleksandr Tymoshenko Message-ID: <20100510001637.2a564cd5@davenulle.org> In-Reply-To: <4BE46650.7010008@bluezbox.com> References: <4BE46650.7010008@bluezbox.com> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@freebsd.org, Sam Leffler Subject: Re: hifn(4) DMA fix for review X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2010 22:16:25 -0000 Le Fri, 07 May 2010 12:13:20 -0700, Oleksandr Tymoshenko a écrit : Hi, > Proposed patch addresses hifn(4) problems on FreeBSD/mips. > Current implementation keeps some of the state information (indexes in > buffers, etc) in DMA-mapped memory and bus_dma code invalidates them > during sync operations. This fix moves data that doesn't belong to DMA > ring to softc structure. I do not have any comment but I will try on my Soekris (the next weekend) if it can help. I noticed several things in hifn, if you want to look: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/130286 IMHO some locks are missing in the use of sc->sc_sessions (the array containing the sessions) : in hifn_newsession(), if there is no space left in sc->sc_sessions, a new array is allocated and the sessions are copied to it. Unfortunaly, sc->sc_sessions is used in hifn_process without any lock and we use some pointers on the array (my patch should addresses this if I remember...). Regards.