Thread (14 messages) flat view 14 messages, 6 authors, 2016-01-07

Re: [PATCH v2 net-next] net: Implement fast csum_partial for x86_64

From: Tom Herbert <hidden>
Date: 2016-01-07 02:36:55

On Wed, Jan 6, 2016 at 5:52 PM, Hannes Frederic Sowa
[off-list ref] wrote:
Hi Tom,

On 05.01.2016 19:41, Tom Herbert wrote:
quoted
--- /dev/null
+++ b/arch/x86/lib/csum-partial_64.S
@@ -0,0 +1,147 @@
+/* Copyright 2016 Tom Herbert <tom@herbertland.com>
+ *
+ * Checksum partial calculation
+ *
+ * __wsum csum_partial(const void *buff, int len, __wsum sum)
+ *
+ * Computes the checksum of a memory block at buff, length len,
+ * and adds in "sum" (32-bit)
+ *
+ * Returns a 32-bit number suitable for feeding into itself
+ * or csum_tcpudp_magic
+ *
+ * Register usage:
+ *   %rdi: argument 1, buff
+ *   %rsi: argument 2, length
+ *   %rdx: argument 3, add in value

I think you forgot to carry-add-in the %rdx register.

The assembly code replaces do_csum but not csum_partial.
First instruction is: movl    %edx, %eax      /* Initialize with
initial sum argument */

Tom
Bye,
Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help