linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ilias.apalodimas@linaro.org (Ilias Apalodimas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: mm: define NET_IP_ALIGN to 0
Date: Thu, 8 Nov 2018 14:22:24 +0200	[thread overview]
Message-ID: <20181108122224.GA14244@apalos> (raw)
In-Reply-To: <20181107171038.25281-1-ard.biesheuvel@linaro.org>

Hi, 
> On arm64, there is no need to add 2 bytes of padding to the start of
> each network buffer just to make the IP header appear 32-bit aligned.
> 
> Since this might actually adversely affect DMA performance some
> platforms, let's override NET_IP_ALIGN to 0 to get rid of this
> padding.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  arch/arm64/include/asm/processor.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
> index 3e2091708b8e..6b0d4dff5012 100644
> --- a/arch/arm64/include/asm/processor.h
> +++ b/arch/arm64/include/asm/processor.h
> @@ -24,6 +24,14 @@
>  #define KERNEL_DS	UL(-1)
>  #define USER_DS		(TASK_SIZE_64 - 1)
>  
> +/*
> + * On arm64 systems, unaligned accesses by the CPU are cheap, and so there is
> + * no point in shifting all network buffers by 2 bytes just to make some IP
> + * header fields appear aligned in memory, potentially sacrificing some DMA
> + * performance on some platforms.
> + */
> +#define NET_IP_ALIGN	0
> +
>  #ifndef __ASSEMBLY__
>  #ifdef __KERNEL__
>  
> -- 
> 2.19.1
> 

I saw no impact on network performance testing this on socionext synquasher.
It makes sense to keep DMA aligned knowing unaligned accesses by the CPU are
cheap

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

  parent reply	other threads:[~2018-11-08 12:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 17:10 [PATCH] arm64: mm: define NET_IP_ALIGN to 0 Ard Biesheuvel
2018-11-07 18:10 ` Mark Rutland
2018-11-07 23:18   ` Ard Biesheuvel
2018-11-08 10:06     ` Mark Rutland
2018-11-08 10:34       ` Ard Biesheuvel
2018-11-07 21:14 ` Will Deacon
2018-11-08 12:22 ` Ilias Apalodimas [this message]
2018-11-08 17:51 ` Catalin Marinas
2018-11-28  6:02 ` Kunihiko Hayashi
2018-11-28 11:58   ` Ard Biesheuvel
2018-11-29  1:50     ` Kunihiko Hayashi
2018-11-28 12:04   ` Will Deacon
2018-11-29  1:51     ` Kunihiko Hayashi

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=20181108122224.GA14244@apalos \
    --to=ilias.apalodimas@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).