Re: [PATCH v2] net: Make skb_segment not to compute checksum if network controller supports checksumming
From: Yadu Kishore <hidden>
Date: 2020-03-13 06:36:49
Yes, given the discussion I have no objections. The change to skb_segment in v2 look fine.
I'm assuming that the changes in patch V2 are ok to be accepted and merged to the kernel. Please let me know if there is anything else that is pending from my side with respect to the patch. Thanks, Yadu Kishore On Fri, Mar 6, 2020 at 10:42 PM David Laight [off-list ref] wrote:
From: Eric Dumazetquoted
Sent: 05 March 2020 17:20 On 3/5/20 9:00 AM, David Laight wrote:quoted
From: Willem de Bruijnquoted
Sent: 05 March 2020 16:07..quoted
It seems do_csum is called because csum_partial_copy executes the two operations independently: __wsum csum_partial_copy(const void *src, void *dst, int len, __wsum sum) { memcpy(dst, src, len); return csum_partial(dst, len, sum); }And do_csum() is superbly horrid. Not the least because it is 32bit on 64bit systems.There are many versions, which one is discussed here ? At least the current one seems to be 64bit optimized. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5777eaed566a1d63e344d3dd 8f2b5e33be20643eI was looking at the generic one in $(SRC)/lib/checksum.c. FWIW I suspect the fastest code on pre sandy bridge 64bit intel cpus (where adc is 2 clocks) is to do a normal 'add', shift the carries into a 64bit register and do a software 'popcnt' every 512 bytes. That may run at 8 bytes/clock + the popcnt. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)