powerpc32: add support for csum_add()

leroy christophe christophe.leroy at c-s.fr
Mon Oct 13 22:17:31 AEDT 2014

Le 12/10/2014 18:22, Jochen Rollwagen a écrit :
> 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


 From 07064c6e022ba8dc0c86ce12f7851a1de24e04fc Mon Sep 17 00:00:00 2001
From: Tom Herbert <therbert at google.com>
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.

Signed-off-by: Tom Herbert <therbert at google.com>
Signed-off-by: David S. Miller <davem at davemloft.net>

diff --git a/include/net/checksum.h b/include/net/checksum.h
index a28f4e0..87cb190 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -57,12 +57,14 @@ static __inline__ __wsum csum_and_copy_to_user
  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));
  static inline __wsum csum_sub(__wsum csum, __wsum addend)
cgit v0.10.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20141013/6322cc7c/attachment-0001.html>

More information about the Linuxppc-dev mailing list