Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 223C5C433EF for ; Mon, 13 Dec 2021 18:01:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241694AbhLMSBF (ORCPT ); Mon, 13 Dec 2021 13:01:05 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:59447 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241559AbhLMSBA (ORCPT ); Mon, 13 Dec 2021 13:01:00 -0500 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-33-MkGeTNzxOuqL-NcoU0yNBg-1; Mon, 13 Dec 2021 18:00:57 +0000 X-MC-Unique: MkGeTNzxOuqL-NcoU0yNBg-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Mon, 13 Dec 2021 18:00:56 +0000 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.026; Mon, 13 Dec 2021 18:00:56 +0000 From: David Laight To: 'Noah Goldstein' , 'Eric Dumazet' CC: "'tglx@linutronix.de'" , "'mingo@redhat.com'" , 'Borislav Petkov' , "'dave.hansen@linux.intel.com'" , 'X86 ML' , "'hpa@zytor.com'" , "'peterz@infradead.org'" , "'alexanderduyck@fb.com'" , 'open list' , 'netdev' Subject: [PATCH] lib/x86: Optimise csum_partial of buffers that are not multiples of 8 bytes. Thread-Topic: [PATCH] lib/x86: Optimise csum_partial of buffers that are not multiples of 8 bytes. Thread-Index: AdfwSx7jhGb9mOkwS12sTJ1p5oR1JQ== Date: Mon, 13 Dec 2021 18:00:56 +0000 Message-ID: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DQpBZGQgaW4gdGhlIHRyYWlsaW5nIGJ5dGVzIGZpcnN0IHNvIHRoYXQgdGhlcmUgaXMgbm8gbmVl ZCB0byB3b3JyeQ0KYWJvdXQgdGhlIHN1bSBleGNlZWRpbmcgNjQgYml0cy4NCg0KU2lnbmVkLW9m Zi1ieTogRGF2aWQgTGFpZ2h0IDxkYXZpZC5sYWlnaHRAYWN1bGFiLmNvbT4NCi0tLQ0KDQpUaGlz IG91Z2h0IHRvIGJlIGZhc3RlciAtIGJlY2F1c2Ugb2YgYWxsIHRoZSByZW1vdmVkICdhZGMgJDAn Lg0KR3Vlc3NpbmcgaG93IGZhc3QgeDg2IGNvZGUgd2lsbCBydW4gaXMgaGFyZCENClRoZXJlIGFy ZSBvdGhlciB3YXlzIG9mIGhhbmRpbmcgYnVmZmVycyB0aGF0IGFyZSBzaG9ydGVyIHRoYW4gOCBi eXRlcywNCmJ1dCBJJ2QgcmF0aGVyIGhvcGUgdGhleSBkb24ndCBoYXBwZW4gaW4gYW55IGhvdCBw YXRocy4NCg0KTm90ZSAtIEkndmUgbm90IGV2ZW4gY29tcGlsZSB0ZXN0ZWQgaXQuDQooQnV0IGhh dmUgdGVzdGVkIGFuIGVxdW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