Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751809AbdITIC1 (ORCPT ); Wed, 20 Sep 2017 04:02:27 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:43522 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751738AbdITICY (ORCPT ); Wed, 20 Sep 2017 04:02:24 -0400 Date: Wed, 20 Sep 2017 16:01:52 +0800 From: Herbert Xu To: Harsh Jain Cc: dwmw2@infradead.org, joro@8bytes.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, leedom@chelsio.com Subject: Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU Message-ID: <20170920080151.GA3348@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Newsgroups: apana.lists.os.linux.cryptoapi,apana.lists.os.linux.kernel Organization: Core User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 921 Lines: 20 Harsh Jain wrote: > > While debugging DMA mapping error in chelsio crypto driver we observed that when scatter/gather list received by driver has some entry with page->offset > 4096 (PAGE_SIZE). It starts giving DMA error.? Without IOMMU it works fine. This is not a bug. The network stack can and will feed us such SG lists. > 2) It cannot be driver's responsibilty to update received sg entries to adjust offset and page > because we are not the only one who directly uses received sg list. No the driver must deal with this. Having said that, if we can improve our driver helper interface to make this easier then we should do that too. What we certainly shouldn't do is to take a whack-a-mole approach like this patch does. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt