public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Tom Herbert <tom@herbertland.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Kernel Team <kernel-team@fb.com>,
	tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	x86@kernel.org
Subject: Re: [PATCH v2 net-next] net: Implement fast csum_partial for x86_64
Date: Thu, 7 Jan 2016 03:43:13 +0100	[thread overview]
Message-ID: <568DD0C1.1070100@stressinduktion.org> (raw)
In-Reply-To: <CALx6S375Z1SqnS1DHj4FOsQGrLeeBPTzQx=v_2c5EFiUFWyAtQ@mail.gmail.com>

On 07.01.2016 03:36, Tom Herbert wrote:
> On Wed, Jan 6, 2016 at 5:52 PM, Hannes Frederic Sowa
> <hannes@stressinduktion.org> wrote:
>> Hi Tom,
>>
>> On 05.01.2016 19:41, Tom Herbert wrote:
>>>
>>> --- /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 */

Ups, sorry. I only grepped through the source. Meanwhile my test also 
uses non-zero sums and shows that it is fine.

Bye,
Hannes

      reply	other threads:[~2016-01-07  2:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 18:41 [PATCH v2 net-next] net: Implement fast csum_partial for x86_64 Tom Herbert
2016-01-05 22:18 ` Eric Dumazet
2016-01-06  1:10   ` H. Peter Anvin
2016-01-06  3:02     ` Eric Dumazet
2016-01-06 10:16   ` David Laight
2016-01-06 14:25     ` Eric Dumazet
2016-01-06 14:49       ` David Laight
2016-01-06 15:03         ` Eric Dumazet
2016-01-05 23:35 ` Hannes Frederic Sowa
2016-01-06  3:21   ` Eric Dumazet
2016-01-06 20:05 ` Andi Kleen
2016-01-07  1:52 ` Hannes Frederic Sowa
2016-01-07  2:36   ` Tom Herbert
2016-01-07  2:43     ` Hannes Frederic Sowa [this message]

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=568DD0C1.1070100@stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=davem@davemloft.net \
    --cc=hpa@zytor.com \
    --cc=kernel-team@fb.com \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tom@herbertland.com \
    --cc=x86@kernel.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