linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: leroy christophe <christophe.leroy@c-s.fr>
To: Jochen Rollwagen <joro-2013@t-online.de>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: powerpc32: add support for csum_add()
Date: Mon, 13 Oct 2014 13:17:31 +0200	[thread overview]
Message-ID: <543BB4CB.6030105@c-s.fr> (raw)
In-Reply-To: <543AAADB.1070304@t-online.de>

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

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

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 <therbert@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@google.com>
Signed-off-by: David S. Miller <davem@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
  }
  #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)
  {
-- 
cgit v0.10.1




[-- Attachment #2: Type: text/html, Size: 3020 bytes --]

  reply	other threads:[~2014-10-13 11:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-12 16:22 powerpc32: add support for csum_add() Jochen Rollwagen
2014-10-13 11:17 ` leroy christophe [this message]
2014-10-13 16:23   ` Jochen Rollwagen

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=543BB4CB.6030105@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=joro-2013@t-online.de \
    --cc=linuxppc-dev@lists.ozlabs.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).