fix tcp/udp checksum test in the M_CSUM_NO_PSEUDOHDR case

(this can never have worked)
now I can use a "bge" gigabit interface with hw checksumming
ttcp-t: 2147483648 bytes in 18.31 real seconds = 114527.11 KB/sec +++
woow!
This commit is contained in:
drochner 2004-03-10 18:50:45 +00:00
parent 529666a2a8
commit 6a4fbf616c
2 changed files with 6 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcp_input.c,v 1.189 2004/02/26 02:34:59 itojun Exp $ */
/* $NetBSD: tcp_input.c,v 1.190 2004/03/10 18:50:45 drochner Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.189 2004/02/26 02:34:59 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.190 2004/03/10 18:50:45 drochner Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@ -1112,8 +1112,7 @@ findpcb:
if (m->m_pkthdr.csum_flags & M_CSUM_NO_PSEUDOHDR) {
hw_csum = in_cksum_phdr(ip->ip_src.s_addr,
ip->ip_dst.s_addr,
htonl(hw_csum + ntohs(ip->ip_len) +
IPPROTO_UDP));
htons(hw_csum + tlen + off + IPPROTO_TCP));
}
if ((hw_csum ^ 0xffff) != 0)
goto badcsum;

View File

@ -1,4 +1,4 @@
/* $NetBSD: udp_usrreq.c,v 1.114 2003/12/04 19:38:24 atatat Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.115 2004/03/10 18:50:45 drochner Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.114 2003/12/04 19:38:24 atatat Exp $");
__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.115 2004/03/10 18:50:45 drochner Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@ -282,8 +282,7 @@ udp_input(m, va_alist)
if (m->m_pkthdr.csum_flags & M_CSUM_NO_PSEUDOHDR)
hw_csum = in_cksum_phdr(ip->ip_src.s_addr,
ip->ip_dst.s_addr,
htonl(hw_csum + ntohs(ip->ip_len) +
IPPROTO_UDP));
htons(hw_csum + len + IPPROTO_UDP));
if ((hw_csum ^ 0xffff) != 0)
goto badcsum;
break;