From owner-freebsd-hackers Tue May 29 13:52:26 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from luke.immure.com (luke.immure.com [207.8.42.74]) by hub.freebsd.org (Postfix) with ESMTP id 60E7A37B422 for ; Tue, 29 May 2001 13:52:20 -0700 (PDT) (envelope-from bob@luke.immure.com) Received: (from bob@localhost) by luke.immure.com (8.11.2/8.11.3) id f4TKqCj38032; Tue, 29 May 2001 15:52:12 -0500 (CDT) (envelope-from bob) Date: Tue, 29 May 2001 15:52:12 -0500 From: Bob Willcox To: Jesper Skriver Cc: hackers list Subject: Re: How to disable software TCP checksumming? Message-ID: <20010529155212.M19771@luke.immure.com> Reply-To: Bob Willcox References: <20010529144114.I19771@luke.immure.com> <20010529221107.C49875@skriver.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010529221107.C49875@skriver.dk>; from jesper@skriver.dk on Tue, May 29, 2001 at 10:11:07PM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thanks for the info, but I don't think this will do what I want. I have been looking at the Tigon driver which seems to support hardware assisted CRC checking. I'm could be way off base here, but this snippit of code from if_ti.c: if (ifp->if_hwassist) { m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_DATA_VALID; if ((cur_rx->ti_ip_cksum ^ 0xffff) == 0) m->m_pkthdr.csum_flags |= CSUM_IP_VALID; m->m_pkthdr.csum_data = cur_rx->ti_tcp_udp_cksum; } looks like it might be related to what I want to do, and may prevent the upper layers from checking the CRC on input. I also would like to disable the CRC generation for output but, so far, can't seem to find how that can be done. Note that I'm not above changing the kernel if that's the only way, but would like to find some way in my driver to turn off the checksums if possible. Thanks, Bob On Tue, May 29, 2001 at 10:11:07PM +0200, Jesper Skriver wrote: > On Tue, May 29, 2001 at 02:41:14PM -0500, Bob Willcox wrote: > > Hi, > > > > I am working on a device driver for a GSN adapter that has hardware CRC > > checking and need to know if there is a way to disable the software CRC > > checking for TCP? This is on a FreeBSD 4.2-stable system. > > Not without modifying the source, the below should do it from a > quick look. > > Index: src/sys/netinet/tcp_input.c > =================================================================== > RCS file: /home/ncvs/src/sys/netinet/tcp_input.c,v > retrieving revision 1.130 > diff -u -r1.130 tcp_input.c > --- src/sys/netinet/tcp_input.c 2001/05/29 19:54:45 1.130 > +++ src/sys/netinet/tcp_input.c 2001/05/29 20:07:22 > @@ -401,6 +401,7 @@ > th = (struct tcphdr *)((caddr_t)ip + off0); > tlen = ip->ip_len; > > +#if 0 > if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { > if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) > th->th_sum = m->m_pkthdr.csum_data; > @@ -423,6 +424,7 @@ > tcpstat.tcps_rcvbadsum++; > goto drop; > } > +#endif > #ifdef INET6 > /* Re-initialization for later version check */ > ip->ip_v = IPVERSION; > > /Jesper > > -- > Jesper Skriver, jesper(at)skriver(dot)dk - CCIE #5456 > Work: Network manager @ AS3292 (Tele Danmark DataNetworks) > Private: FreeBSD committer @ AS2109 (A much smaller network ;-) > > One Unix to rule them all, One Resolver to find them, > One IP to bring them all and in the zone to bind them. -- Bob Willcox Egotist, n.: bob@vieo.com A person of low taste, more interested in himself than me. Austin, TX -- Ambrose Bierce, "The Devil's Dictionary" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message