From owner-svn-src-all@freebsd.org Fri Oct 23 15:46:32 2015 Return-Path: Delivered-To: svn-src-all@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 B3B9FA1D9AA; Fri, 23 Oct 2015 15:46:32 +0000 (UTC) (envelope-from prvs=731ed1d6e=roger.pau@citrix.com) Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "mail.citrix.com", Issuer "Verizon Public SureServer CA G14-SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF9E0AB9; Fri, 23 Oct 2015 15:46:31 +0000 (UTC) (envelope-from prvs=731ed1d6e=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.20,187,1444694400"; d="scan'208";a="312620684" Subject: Re: svn commit: r289834 - head/sys/x86/x86 To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , , , References: <201510231539.t9NFdxPe018130@repo.freebsd.org> From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Message-ID: <562A564D.9080703@citrix.com> Date: Fri, 23 Oct 2015 17:46:21 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201510231539.t9NFdxPe018130@repo.freebsd.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-DLP: MIA1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2015 15:46:32 -0000 El 23/10/15 a les 17.39, Roger Pau Monné ha escrit: > Author: royger > Date: Fri Oct 23 15:39:59 2015 > New Revision: 289834 > URL: https://svnweb.freebsd.org/changeset/base/289834 > > Log: > x86/dma_bounce: rework _bus_dmamap_load_ma implementation > > The implementation of bus_dmamap_load_ma_triv currently calls > _bus_dmamap_load_phys on each page that is part of the passed in buffer. > Since each page is treated as an individual buffer, the resulting behaviour > is different from the behaviour of _bus_dmamap_load_buffer. This breaks > certain drivers, like Xen blkfront. > > If an unmapped buffer of size 4096 that starts at offset 13 into the first > page is passed to the current _bus_dmamap_load_ma implementation (so the ma > array contains two pages), the result is that two segments are created, one > with a size of 4083 and the other with size 13 (because two independant > calls to _bus_dmamap_load_phys are performed, one for each physical page). > If the same is done with a mapped buffer and calling _bus_dmamap_load_buffer > the result is that only one segment is created, with a size of 4096. > > This patch relegates the usage of bus_dmamap_load_ma_triv in x86 bounce > buffer code to drivers requesting BUS_DMA_KEEP_PG_OFFSET and implements > _bus_dmamap_load_ma so that it's behaviour is the same as the mapped version > (_bus_dmamap_load_buffer). This patch only modifies the x86 bounce buffer > code, other arches are left untouched. > > Reviewed by: kib, jah > Differential Revision: https://reviews.freebsd.org/D888 > Sponsored by: Citrix Systems R&D Forgot to add: MFC after: 2 weeks Roger.