Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3917306imm; Mon, 17 Sep 2018 05:27:41 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda0s3TP5mEKqowEwJhlIXwS/iOmmljbphUwGEvoFVHEYpIO+DRRTjwgEw/EF37rP1hVyxhv X-Received: by 2002:a62:9349:: with SMTP id b70-v6mr26038088pfe.193.1537187261476; Mon, 17 Sep 2018 05:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537187261; cv=none; d=google.com; s=arc-20160816; b=bIct3JR7oASlA+WNWg8UlDS4QDqcKMsjty1Dsxa9J6tJbmw+jNlSnIDGlqyJ/pIeCC fYhWMkgmR0rgij9hr9NWnN6bxl6V88NQY7NacjZ0xsiP2iXV9JNrl6u0oCpOWi5QErGc sJ+OrpNih83ahBur84NJJvB7nxcdIRbyoFTe/J8B3eQICrIpKUeVY8WJa4bOJlH1Ta9t mIwTi0XFnjxBOAfr00DluLauzy8qlz/DgwywrQ0dLixZnJ0T0lOcY+odnEvlMpDa1s5V LjYg0UTTqEszwQ9vu0AFocJ98J7cTAJCIqHAuqSyeaw7TzKEjprOOtpSq2fBXh+sORcv Be2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=7ZCTp2vKHQNFL3k3YWRzOp9xsyiF2eScKWvv/mHAwGU=; b=ph7+2SYZHYMJugwsXG2QFCJGVRs0mOxNzJfUUuYKXVqd+o7t/HOB4oq2hFImgiBDQG C2Q6vIYcCgWkFLjx0QcVMfJa88uEPnXe2n8dPspatlu4v9xmt37s1vOMJjZ4PrJsr91+ 8oJuWC21y1HpBOcxDC2dee+ze2pzeC4kMHjkGuwQF9isyiai3ER96Gik5EdiPm4td6RQ /3xnA6CX6SEd/XJrDCWAuuaavMT7ijlWXU+Xo8sCIqiWqjQAE4M8gNB69qtSk/gEamg+ Ian2vcaZdqR/FpKrKvwDPNfsqYICvZOaUVYsZ+QZbeK194zeJVijOhARmRKMGbR6bDJ6 vVpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5-v6si15456445pgf.488.2018.09.17.05.27.25; Mon, 17 Sep 2018 05:27:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728513AbeIQRyT (ORCPT + 99 others); Mon, 17 Sep 2018 13:54:19 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:23471 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726826AbeIQRyT (ORCPT ); Mon, 17 Sep 2018 13:54:19 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42DQNk3ndBz9ttCP; Mon, 17 Sep 2018 14:27:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 0MYFMlEue0Tc; Mon, 17 Sep 2018 14:27:02 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42DQNk3HRsz9ttBj; Mon, 17 Sep 2018 14:27:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CE9F88B7A0; Mon, 17 Sep 2018 14:27:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 8TcXA_9GMHyX; Mon, 17 Sep 2018 14:27:11 +0200 (CEST) Received: from PO15451 (po15451.idsi0.si.c-s.fr [172.25.231.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9C90B8B79C; Mon, 17 Sep 2018 14:27:11 +0200 (CEST) Subject: Re: [PATCH] powerpc: fix csum_ipv6_magic() on little endian platforms To: Michael Ellerman Cc: Xin Long , benh@kernel.crashing.org, paulus@samba.org, jishi@redhat.com, LKML , linuxppc-dev@lists.ozlabs.org, stable@vger.kernel.org, "netdev@vger.kernel.org" , David Miller References: <3c4cddf185438cc7200908b4f971a8e6ed7472fd.1536558233.git.christophe.leroy@c-s.fr> From: Christophe LEROY Message-ID: <76289d79-0e7e-7b22-2364-0b5777f42c8b@c-s.fr> Date: Mon, 17 Sep 2018 14:27:11 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michael, Le 10/09/2018 à 16:28, Xin Long a écrit : > On Mon, Sep 10, 2018 at 2:09 PM Christophe Leroy > wrote: >> >> On little endian platforms, csum_ipv6_magic() keeps len and proto in >> CPU byte order. This generates a bad results leading to ICMPv6 packets >> from other hosts being dropped by powerpc64le platforms. >> >> In order to fix this, len and proto should be converted to network >> byte order ie bigendian byte order. However checksumming 0x12345678 >> and 0x56341278 provide the exact same result so it is enough to >> rotate the sum of len and proto by 1 byte. >> >> PPC32 only support bigendian so the fix is needed for PPC64 only >> >> Fixes: e9c4943a107b ("powerpc: Implement csum_ipv6_magic in assembly") >> Reported-by: Jianlin Shi >> Reported-by: Xin Long >> Cc: # 4.18+ >> Signed-off-by: Christophe Leroy >> --- >> arch/powerpc/lib/checksum_64.S | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/arch/powerpc/lib/checksum_64.S b/arch/powerpc/lib/checksum_64.S >> index 886ed94b9c13..2a68c43e13f5 100644 >> --- a/arch/powerpc/lib/checksum_64.S >> +++ b/arch/powerpc/lib/checksum_64.S >> @@ -443,6 +443,9 @@ _GLOBAL(csum_ipv6_magic) >> addc r0, r8, r9 >> ld r10, 0(r4) >> ld r11, 8(r4) >> +#ifndef CONFIG_CPU_BIG_ENDIAN >> + rotldi r5, r5, 8 >> +#endif >> adde r0, r0, r10 >> add r5, r5, r7 >> adde r0, r0, r11 >> -- >> 2.13.3 >> > Tested-by: Xin Long > Could you take this fix for 4.19 ? Unless someone takes it through the netdev tree ? Thanks Christophe