Skip to contentSkip to conversation

powerpc32: add support for csum_add()

DISCUSSION Jochen Rollwagen 2 participants 3 messages Oct 12, 2014 – Oct 13, 2014 Networking

lore
Share & tools
lore
#1 lore raw
Quoted 9 lines · Jochen Rollwagen

This patch

https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-September/121144.html

only compiles after putting an #ifndef ARCH_HAS_CSUM_ADD around the definition in include/net/checksum.h

This is missing from the patch

This is already included upstream since May 2014, see patch below

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=07064c6e022ba8dc0c86ce12f7851a1de24e04fc

From 07064c6e022ba8dc0c86ce12f7851a1de24e04fc Mon Sep 17 00:00:00 2001
From: Tom Herbert <[email protected]>
Date: Fri, 2 May 2014 16:28:03 -0700
Subject: net: Allow csum_add to be provided in arch

csum_add is really nothing more then add-with-carry which can be implemented efficiently in some architectures. Allow architecture to define this protected by HAVE_ARCH_CSUM_ADD.

include/net/checksum.h +2 -0
index a28f4e0..87cb190 100644
@@ -57,12 +57,14 @@ static __inline__ __wsum csum_and_copy_to_user
 }
 #endif
 
+#ifndef HAVE_ARCH_CSUM_ADD
 static inline __wsum csum_add(__wsum csum, __wsum addend)
 {
 	u32 res = (__force u32)csum;
 	res += (__force u32)addend;
 	return (__force __wsum)(res + (res < (__force u32)addend));
 }
+#endif
 
 static inline __wsum csum_sub(__wsum csum, __wsum addend)
 {
Signature · 1 line
cgit v0.10.1
#2 lore raw

Am 13.10.2014 um 13:17 schrieb leroy christophe:

Quoted 50 lines · Jochen Rollwagen
Quoted 9 lines

This patch

https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-September/121144.html

only compiles after putting an #ifndef ARCH_HAS_CSUM_ADD around the definition in include/net/checksum.h

This is missing from the patch

This is already included upstream since May 2014, see patch below

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=07064c6e022ba8dc0c86ce12f7851a1de24e04fc

From 07064c6e022ba8dc0c86ce12f7851a1de24e04fc Mon Sep 17 00:00:00 2001
From: Tom Herbert<[email protected]>
Date: Fri, 2 May 2014 16:28:03 -0700
Subject: net: Allow csum_add to be provided in arch

csum_add is really nothing more then add-with-carry which can be implemented efficiently in some architectures. Allow architecture to define this protected by HAVE_ARCH_CSUM_ADD.

include/net/checksum.h +2 -0
index a28f4e0..87cb190 100644
@@ -57,12 +57,14 @@ static __inline__ __wsum csum_and_copy_to_user
  }
  #endif
 
+#ifndef HAVE_ARCH_CSUM_ADD
  static inline __wsum csum_add(__wsum csum, __wsum addend)
  {
  	u32 res = (__force u32)csum;
  	res += (__force u32)addend;
  	return (__force __wsum)(res + (res < (__force u32)addend));
  }
+#endif
 
  static inline __wsum csum_sub(__wsum csum, __wsum addend)
  {
Signature · 1 line
cgit v0.10.1

Ah bon. Obviously this wasn't backported to 3.14, that's what i compiled for. So i backported the 2 Lines of code manually et tout est bon.

Salut

Jochen