Subject: Re: Ethernet TX buffer crossing 4K boundary?

From: Andrew Lunn <[email-masked]>
Date: Thu, 21 Apr 2022 14:32:35 +0200

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