From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3472BC433EF for ; Thu, 21 Apr 2022 12:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384845AbiDUMf1 (ORCPT ); Thu, 21 Apr 2022 08:35:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377192AbiDUMf0 (ORCPT ); Thu, 21 Apr 2022 08:35:26 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84D8920BE3 for ; Thu, 21 Apr 2022 05:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=xLZd+Ool0KW32A7RWiwT2wzFd51nw8K1vo8DP7rrKhU=; b=lDBM1JLpM/jKw5HqoPYFug8FWF +1AzkdMAwANOrIuppZt4E6ldfQocx4UYH6ry7Zm+iDiMQ+7usqMXPiotFEAu+p0Nw2tY3hR9kXN8S gX6MGxUO7kkvPrv51J7jPZ+ififG0SOAxLuLFjCcsSIiQOkL4DdwXI71xm8Yz2gnGV4U=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nhVz9-00Gnfj-R6; Thu, 21 Apr 2022 14:32:35 +0200 Date: Thu, 21 Apr 2022 14:32:35 +0200 From: Andrew Lunn To: Joakim Tjernlund Cc: "netdev@vger.kernel.org" , Eric Gratorp Subject: Re: Ethernet TX buffer crossing 4K boundary? Message-ID: References: <7e3fa36a3e16aca6fd7d00cadeeba8a8d71ceb0d.camel@infinera.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e3fa36a3e16aca6fd7d00cadeeba8a8d71ceb0d.camel@infinera.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Apr 20, 2022 at 09:09:58PM +0000, Joakim Tjernlund wrote: > We have this custom Ethernet controller that cannot DMA a buffer if the buffer crosses 4K boundary. > Any ideas how to deal with that limitation in the driver? Does the DMA support scatter gather? You might be able to tweak the generic scatter gather code to generate two blocks if it crosses the boundary. Otherwise, maybe look at the DMA bounce buffer code. It is normally used when the DMA is limited in its address range, and the buffer needs copying to another address. Maybe you can add a special mode where it looks at if a 4K page is cross and then makes use of a bounce buffer. Andrew