Skip to contentSkip to conversation

x86: Drop CONFIG_MCORE2 check around setting of NET_IP_ALIGN

PATCH Applied Jeff Kirsher 4 participants 4 messages Jul 1, 2010 – Jul 2, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Drop CONFIG_MCORE2 check around setting of NET_IP_ALIGN

From: Alexander Duyck <[email protected]>

This patch removes the CONFIG_MCORE2 check from around NET_IP_ALIGN. It is based on a suggestion from Andi Kleen. The assumption is that there are not any x86 cores where unaligned access is really slow, and this change would allow for a performance improvement to still exist on configurations that are not necessarily optimized for Core 2.

Cc Andi Kleen <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>

---

 arch/x86/include/asm/system.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/include/asm/system.h +0 -2
index b4293fc..1db9bd2 100644
@@ -457,7 +457,6 @@ static inline void rdtsc_barrier(void)
 	alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
 }
 
-#ifdef CONFIG_MCORE2
 /*
  * We handle most unaligned accesses in hardware.  On the other hand
  * unaligned DMA can be quite expensive on some Nehalem processors.
@@ -465,5 +464,4 @@ static inline void rdtsc_barrier(void)
  * Based on this we disable the IP header alignment in network drivers.
  */
 #define NET_IP_ALIGN	0
-#endif
 #endif /* _ASM_X86_SYSTEM_H */
#1 lore raw
Quoted 8 lines · On Thu, 01 Jul 2010 16:28:27 -0700 Jeff Kirsher <[email protected]>…

From: Alexander Duyck <[email protected]>

This patch removes the CONFIG_MCORE2 check from around NET_IP_ALIGN. It is based on a suggestion from Andi Kleen. The assumption is that there are not any x86 cores where unaligned access is really slow, and this change would allow for a performance improvement to still exist on configurations that are not necessarily optimized for Core 2.

Quoted 8 lines
Cc Andi Kleen <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>

---

This is a good idea, but warnig it may end up masking broken hardware. Developers of new drivers will end up never exercising unaligned DMA, resulting in hardware that doesn't work on platforms that have NET_IP_ALIGN set to 2.

reviewer Acked-by on v1 1/1
#2 lore raw
In reply to Jeff Kirsher
Quoted 8 lines · Jeff Kirsher

From: Alexander Duyck <[email protected]>

This patch removes the CONFIG_MCORE2 check from around NET_IP_ALIGN. It is based on a suggestion from Andi Kleen. The assumption is that there are not any x86 cores where unaligned access is really slow, and this change would allow for a performance improvement to still exist on configurations that are not necessarily optimized for Core 2.

Quoted 7 lines
Cc Andi Kleen <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>

-hpa

maintainer Applied
#3 lore raw
In reply to Jeff Kirsher

From: Jeff Kirsher <[email protected]>
Date: Thu, 01 Jul 2010 16:28:27 -0700

Quoted 8 lines

From: Alexander Duyck <[email protected]>

This patch removes the CONFIG_MCORE2 check from around NET_IP_ALIGN. It is based on a suggestion from Andi Kleen. The assumption is that there are not any x86 cores where unaligned access is really slow, and this change would allow for a performance improvement to still exist on configurations that are not necessarily optimized for Core 2.

Quoted 7 lines
Cc Andi Kleen <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>

Applied, with HPA's ack.