netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: paul.burton@imgtec.com
Cc: matt.redfearn@imgtec.com, netdev@vger.kernel.org,
	alexandre.torgue@st.com, peppe.cavallaro@st.com,
	linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
	james.hogan@imgtec.com
Subject: Re: [PATCH] net: stmmac: Meet alignment requirements for DMA
Date: Tue, 26 Sep 2017 21:53:21 -0700 (PDT)	[thread overview]
Message-ID: <20170926.215321.424825014223425519.davem@davemloft.net> (raw)
In-Reply-To: <2520219.WSsBr6LeCR@np-p-burton>

From: Paul Burton <paul.burton@imgtec.com>
Date: Tue, 26 Sep 2017 21:30:56 -0700

> Nobody said that you are required to do anything, I suggested that
> it would be beneficial if you were to suggest a change to the
> documented DMA API such that it allows your usage where it currently
> does not.

Documentation is often wrong and it is here.  What 200+ drivers
actually do and depend upon trumps a simple text document.

The requirement is that the memory remains quiescent on the cpu side
while the device messes with it.  And that this quiescence requirement
may or may not be on a cache line basis.

There is absolutely no requirement that the buffers themselves are
cache line aligned.

In fact, receive buffers for networking are intentionally 2-byte
aligned in order for the ipv4 headers to be naturally 32-bit aligned.

Cache line aligning receive buffers will actually make some
architectures trap because of the bad alignment.

So see, this cache line alignment requirement is pure madness from
just about any perspective whatsoever.

  reply	other threads:[~2017-09-27  4:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 11:13 [PATCH] net: stmmac: Meet alignment requirements for DMA Matt Redfearn
2017-09-23  1:26 ` David Miller
2017-09-26 13:57   ` Matt Redfearn
2017-09-26 14:23     ` David Laight
2017-09-26 17:34     ` David Miller
2017-09-26 18:48       ` Paul Burton
2017-09-26 20:33         ` David Miller
2017-09-26 21:30           ` Paul Burton
2017-09-27  2:52             ` David Miller
2017-09-27  4:30               ` Paul Burton
2017-09-27  4:53                 ` David Miller [this message]
2017-09-27  5:23                   ` Paul Burton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170926.215321.424825014223425519.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexandre.torgue@st.com \
    --cc=james.hogan@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=matt.redfearn@imgtec.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.burton@imgtec.com \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).