public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Bohac <jbohac@suse.cz>
To: Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	kenneth.w.chen@intel.com
Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org
Subject: [RFC][PATCH] ia64: fix csum_ipv6_magic()
Date: Thu, 27 Aug 2009 23:11:13 +0200	[thread overview]
Message-ID: <20090827211113.GA22793@midget.suse.cz> (raw)

Hi,

I was seeing "nf_ct_icmpv6: ICMPv6 checksum failed" errors on
every ICMPv6 packet received. The packets did not pass the
netfilter checksum verification but they did pass the standard
verification later and got processed. This happenns with hardware
checksumming turned off or with adapters that do not checksum
ICMP packets (e.g. tg3). I tracked the problem down to the ia64
version of csum_ipv6_magic() introduced by 007d77d0c5.  For some
arguments, it gives differrent results than the generic version.

The following patch fixes the problem for me. IA64 experts, can
you please have a look?

Thanks!


[IA64] fix csum_ipv6_magic()

The 32-bit parameters (len and csum) of csum_ipv6_magic() are passed in 64-bit
registers in3 and in4. The high order 32 bits of the registers were never
cleared, and garbage was sometimes calculated into the checksum.

Fix this by clearing the high order 32 bits of the registers.

Signed-off-by: Jiri Bohac <jbohac@suse.cz>

diff --git a/arch/ia64/lib/ip_fast_csum.S b/arch/ia64/lib/ip_fast_csum.S
index 1f86aeb..9a8d23f 100644
--- a/arch/ia64/lib/ip_fast_csum.S
+++ b/arch/ia64/lib/ip_fast_csum.S
@@ -96,20 +96,22 @@ END(ip_fast_csum)
 GLOBAL_ENTRY(csum_ipv6_magic)
 	ld4	r20=[in0],4
 	ld4	r21=[in1],4
-	dep	r15=in3,in2,32,16
+	zxt4	in3=in3
 	;;
 	ld4	r22=[in0],4
 	ld4	r23=[in1],4
-	mux1	r15=r15,@rev
+	dep	r15=in3,in2,32,16
 	;;
 	ld4	r24=[in0],4
 	ld4	r25=[in1],4
-	shr.u	r15=r15,16
+	mux1	r15=r15,@rev
 	add	r16=r20,r21
 	add	r17=r22,r23
+	zxt4	in4=in4
 	;;
 	ld4	r26=[in0],4
 	ld4	r27=[in1],4
+	shr.u	r15=r15,16
 	add	r18=r24,r25
 	add	r8=r16,r17
 	;;
-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ


             reply	other threads:[~2009-08-27 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27 21:11 Jiri Bohac [this message]
2009-08-28 21:19 ` [RFC][PATCH] ia64: fix csum_ipv6_magic() Yu, Fenghua
2009-09-01 11:35   ` Jiri Bohac
2009-09-01 23:20   ` Luck, Tony
2009-09-02  9:00     ` Jiri Bohac

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=20090827211113.GA22793@midget.suse.cz \
    --to=jbohac@suse.cz \
    --cc=fenghua.yu@intel.com \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /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