Skip to content

Commit 26a4676

Browse files
Ard Biesheuvelctmarinas
authored andcommitted
arm64: mm: define NET_IP_ALIGN to 0
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. Acked-by: Ilias Apalodimas <[email protected]> Tested-by: Ilias Apalodimas <[email protected]> Acked-by: Mark Rutland <[email protected]> Acked-by: Will Deacon <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent 313a06e commit 26a4676

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/arm64/include/asm/processor.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
#define KERNEL_DS UL(-1)
2525
#define USER_DS (TASK_SIZE_64 - 1)
2626

27+
/*
28+
* On arm64 systems, unaligned accesses by the CPU are cheap, and so there is
29+
* no point in shifting all network buffers by 2 bytes just to make some IP
30+
* header fields appear aligned in memory, potentially sacrificing some DMA
31+
* performance on some platforms.
32+
*/
33+
#define NET_IP_ALIGN 0
34+
2735
#ifndef __ASSEMBLY__
2836
#ifdef __KERNEL__
2937

0 commit comments

Comments
 (0)