<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/powerpc/include/asm/checksum.h, branch linux-4.16.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-03-04T12:07:17+00:00</updated>
<entry>
<title>powerpc/64: Fix checksum folding in csum_add()</title>
<updated>2017-03-04T12:07:17+00:00</updated>
<author>
<name>Shile Zhang</name>
<email>shile.zhang@nokia.com</email>
</author>
<published>2017-02-04T09:03:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6ad966d7303b70165228dba1ee8da1a05c10eefe'/>
<id>urn:sha1:6ad966d7303b70165228dba1ee8da1a05c10eefe</id>
<content type='text'>
Paul's patch to fix checksum folding, commit b492f7e4e07a ("powerpc/64:
Fix checksum folding in csum_tcpudp_nofold and ip_fast_csum_nofold")
missed a case in csum_add(). Fix it.

Signed-off-by: Shile Zhang &lt;shile.zhang@nokia.com&gt;
Acked-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/64: Use optimized checksum routines on little-endian</title>
<updated>2017-01-25T02:34:18+00:00</updated>
<author>
<name>Paul Mackerras</name>
<email>paulus@ozlabs.org</email>
</author>
<published>2016-11-03T05:15:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d4fde568a34a93897dfb9ae64cfe9dda9d5c908c'/>
<id>urn:sha1:d4fde568a34a93897dfb9ae64cfe9dda9d5c908c</id>
<content type='text'>
Currently we have optimized hand-coded assembly checksum routines for
big-endian 64-bit systems, but for little-endian we use the generic C
routines. This modifies the optimized routines to work for
little-endian. With this, we no longer need to enable
CONFIG_GENERIC_CSUM. This also fixes a couple of comments in
checksum_64.S so they accurately reflect what the associated instruction
does.

Signed-off-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
[mpe: Use the more common __BIG_ENDIAN__]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/64: Fix checksum folding in csum_tcpudp_nofold and ip_fast_csum_nofold</title>
<updated>2017-01-25T02:34:18+00:00</updated>
<author>
<name>Paul Mackerras</name>
<email>paulus@ozlabs.org</email>
</author>
<published>2016-11-03T05:10:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b492f7e4e07a28e706db26cf4943bb0911435426'/>
<id>urn:sha1:b492f7e4e07a28e706db26cf4943bb0911435426</id>
<content type='text'>
These functions compute an IP checksum by computing a 64-bit sum and
folding it to 32 bits (the "nofold" in their names refers to folding
down to 16 bits).  However, doing (u32) (s + (s &gt;&gt; 32)) is not
sufficient to fold a 64-bit sum to 32 bits correctly.  The addition
can produce a carry out from bit 31, which needs to be added in to
the sum to produce the correct result.

To fix this, we copy the from64to32() function from lib/checksum.c
and use that.

Signed-off-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>arch/powerpc: Update parameters for csum_tcpudp_magic &amp; csum_tcpudp_nofold</title>
<updated>2016-10-29T21:06:23+00:00</updated>
<author>
<name>Ivan Vecera</name>
<email>ivecera@redhat.com</email>
</author>
<published>2016-10-27T14:30:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f9d4286b9516b02e795214412d36885f572b57ad'/>
<id>urn:sha1:f9d4286b9516b02e795214412d36885f572b57ad</id>
<content type='text'>
Commit 01cfbad "ipv4: Update parameters for csum_tcpudp_magic to their
original types" changed parameters for csum_tcpudp_magic and
csum_tcpudp_nofold for many platforms but not for PowerPC.

Fixes: 01cfbad "ipv4: Update parameters for csum_tcpudp_magic to their original types"
Cc: Alexander Duyck &lt;aduyck@mirantis.com&gt;
Signed-off-by: Ivan Vecera &lt;ivecera@redhat.com&gt;
Acked-by: Alexander Duyck &lt;alexander.h.duyck@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>powerpc: optimise csum_partial() call when len is constant</title>
<updated>2016-03-09T16:44:18+00:00</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@c-s.fr</email>
</author>
<published>2016-03-07T17:44:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7e393220b6e1ecfa5520d1b2ca31150b7588f458'/>
<id>urn:sha1:7e393220b6e1ecfa5520d1b2ca31150b7588f458</id>
<content type='text'>
csum_partial is often called for small fixed length packets
for which it is suboptimal to use the generic csum_partial()
function.

For instance, in my configuration, I got:
* One place calling it with constant len 4
* Seven places calling it with constant len 8
* Three places calling it with constant len 14
* One place calling it with constant len 20
* One place calling it with constant len 24
* One place calling it with constant len 32

This patch renames csum_partial() to __csum_partial() and
implements csum_partial() as a wrapper inline function which
* uses csum_add() for small 16bits multiple constant length
* uses ip_fast_csum() for other 32bits multiple constant
* uses __csum_partial() in all other cases

Signed-off-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Signed-off-by: Scott Wood &lt;oss@buserror.net&gt;
</content>
</entry>
<entry>
<title>powerpc: simplify csum_add(a, b) in case a or b is constant 0</title>
<updated>2016-03-05T05:04:00+00:00</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@c-s.fr</email>
</author>
<published>2015-09-22T14:34:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5a8847c83ce6072d6fdf0d15d9aa060c0b83537f'/>
<id>urn:sha1:5a8847c83ce6072d6fdf0d15d9aa060c0b83537f</id>
<content type='text'>
Simplify csum_add(a, b) in case a or b is constant 0

Signed-off-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Signed-off-by: Scott Wood &lt;oss@buserror.net&gt;
</content>
</entry>
<entry>
<title>powerpc: inline ip_fast_csum()</title>
<updated>2016-03-05T03:49:49+00:00</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@c-s.fr</email>
</author>
<published>2015-09-22T14:34:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=37e08cad8f177f7bf6226a9b3724234ac3d3c81d'/>
<id>urn:sha1:37e08cad8f177f7bf6226a9b3724234ac3d3c81d</id>
<content type='text'>
In several architectures, ip_fast_csum() is inlined
There are functions like ip_send_check() which do nothing
much more than calling ip_fast_csum().
Inlining ip_fast_csum() allows the compiler to optimise better

Suggested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
[scottwood: whitespace and cast fixes]
Signed-off-by: Scott Wood &lt;oss@buserror.net&gt;
</content>
</entry>
<entry>
<title>powerpc32: checksum_wrappers_64 becomes checksum_wrappers</title>
<updated>2016-03-05T03:47:47+00:00</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@c-s.fr</email>
</author>
<published>2015-09-22T14:34:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=03bc8b0fc87616c75c6dd060a2191e7fc8faacb6'/>
<id>urn:sha1:03bc8b0fc87616c75c6dd060a2191e7fc8faacb6</id>
<content type='text'>
The powerpc64 checksum wrapper functions adds csum_and_copy_to_user()
which otherwise is implemented in include/net/checksum.h by using
csum_partial() then copy_to_user()

Those two wrapper fonctions are also applicable to powerpc32 as it is
based on the use of csum_partial_copy_generic() which also
exists on powerpc32

This patch renames arch/powerpc/lib/checksum_wrappers_64.c to
arch/powerpc/lib/checksum_wrappers.c and
makes it non-conditional to CONFIG_WORD_SIZE

Signed-off-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Signed-off-by: Scott Wood &lt;oss@buserror.net&gt;
</content>
</entry>
<entry>
<title>powerpc: mark xer clobbered in csum_add()</title>
<updated>2016-03-05T03:47:27+00:00</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@c-s.fr</email>
</author>
<published>2015-09-22T14:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=11dfbf588ae697bc5362c24294c2605f09c2d3d4'/>
<id>urn:sha1:11dfbf588ae697bc5362c24294c2605f09c2d3d4</id>
<content type='text'>
addc uses carry so xer is clobbered in csum_add()

Signed-off-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Signed-off-by: Scott Wood &lt;oss@buserror.net&gt;
</content>
</entry>
<entry>
<title>powerpc: add support for csum_add()</title>
<updated>2015-08-08T03:59:19+00:00</updated>
<author>
<name>LEROY Christophe</name>
<email>christophe.leroy@c-s.fr</email>
</author>
<published>2015-05-19T15:18:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=501c8de7b061d2dc0c21a0a79fee3eddf30af8dd'/>
<id>urn:sha1:501c8de7b061d2dc0c21a0a79fee3eddf30af8dd</id>
<content type='text'>
The C version of csum_add() as defined in include/net/checksum.h gives
the following assembly in ppc32:
       0:       7c 04 1a 14     add     r0,r4,r3
       4:       7c 64 00 10     subfc   r3,r4,r0
       8:       7c 63 19 10     subfe   r3,r3,r3
       c:       7c 63 00 50     subf    r3,r3,r0
and the following in ppc64:
   0xc000000000001af8 &lt;+0&gt;:	add     r3,r3,r4
   0xc000000000001afc &lt;+4&gt;:	cmplw   cr7,r3,r4
   0xc000000000001b00 &lt;+8&gt;:	mfcr    r4
   0xc000000000001b04 &lt;+12&gt;:	rlwinm  r4,r4,29,31,31
   0xc000000000001b08 &lt;+16&gt;:	add     r3,r4,r3
   0xc000000000001b0c &lt;+20&gt;:	clrldi  r3,r3,32
   0xc000000000001b10 &lt;+24&gt;:	blr

include/net/checksum.h also offers the possibility to define an arch
specific function.  This patch provides a specific csum_add() inline
function.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Signed-off-by: Scott Wood &lt;scottwood@freescale.com&gt;
</content>
</entry>
</feed>
