From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756738AbcCQWRe (ORCPT ); Thu, 17 Mar 2016 18:17:34 -0400 Received: from avasout07.plus.net ([84.93.230.235]:51948 "EHLO avasout07.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756723AbcCQWRZ (ORCPT ); Thu, 17 Mar 2016 18:17:25 -0400 X-Greylist: delayed 458 seconds by postgrey-1.27 at vger.kernel.org; Thu, 17 Mar 2016 18:17:25 EDT X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=QqujpgGd c=1 sm=1 tr=0 a=3gGQn7/NrG7ytc3JQEtMeQ==:117 a=3gGQn7/NrG7ytc3JQEtMeQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=Rkz7MgLz717NwVso3zYA:9 a=QEXdDO2ut3YA:10 Message-ID: <56EB2B1A.8050006@cyconix.com> Date: Thu, 17 Mar 2016 22:09:30 +0000 From: Evan Lavelle User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: LKML Subject: DMA/PCIe driver: pci_map_sg not merging chunks in the scatterlist? Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Everything I've read makes me think that pci_map_sg will merge consecutive physical pages into one scatterlist entry, if possible. However, this isn't happening on a driver I'm currently writing. The returned scatterlist contains one entry per page, with the physical addresses incrementing by 4K per page. Is this expected behaviour, or do I have to do something to enable merging? This wouldn't be a major problem, except that the PCIe card I'm working on only has enough local storage for about 300 scatterlist entries, which means that DMA ops are limited to a little over 1Mbyte at a time, which isn't much use. I'm on x86_64, RHEL6.7, IOMMU not enabled, and I don't need to support anything prior to 2.6.32. The PCIe card has 32-bit addressing. uname shows: 2.6.32-431.el6.x86_64 #1 SMP x86_64 x86_64 x86_64 Thanks.