From owner-freebsd-current@FreeBSD.ORG Wed Jan 24 19:13:09 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 618) id D17A016A403; Wed, 24 Jan 2007 19:13:09 +0000 (UTC) In-Reply-To: <20070124190203.E80FB16A403@hub.freebsd.org> from Bill Paul at "Jan 24, 2007 07:02:03 pm" To: wpaul@FreeBSD.ORG (Bill Paul) Date: Wed, 24 Jan 2007 19:13:09 +0000 (GMT) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM82951187:-21975-0_" Content-Transfer-Encoding: 7bit Message-Id: <20070124191309.D17A016A403@hub.freebsd.org> From: wpaul@FreeBSD.ORG (Bill Paul) Cc: pyunyh@gmail.com, freebsd-current@freebsd.org, r.c.ladan@gmail.com Subject: Re: Call for re(4) checksum offload testers. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2007 19:13:09 -0000 --ELM82951187:-21975-0_ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > Based on testing with my sample adapters, I think the right thing to do > is skip the software padding in the TCP case. It appears that even > the older 8169 adapters that botch the small IP fragment case will correctly > handle this small TCP segment case. I'm attaching a patch which should > fix the problem without breaking the workaround for other NICs. If you > verify that this patch also fixes your problem, then this patch should > be checked in instead of the other one. Crap... I just realized as I hit the send button that I was testing for the wrong flag in the rl_flags field. I'm sending the patch again, hopefully correct this time. -Bill -- ============================================================================= -Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu wpaul@windriver.com | Wind River Systems ============================================================================= you're just BEGGING to face the moose ============================================================================= --ELM82951187:-21975-0_ Content-Type: text/plain; charset=US-ASCII Content-Disposition: attachment; filename=re.patch Content-Description: re.patch Content-Transfer-Encoding: 7bit --- if_re.c.orig Wed Jan 24 10:38:14 2007 +++ if_re.c Wed Jan 24 11:06:21 2007 @@ -2075,9 +2075,13 @@ * the mbuf chain has too many fragments so the coalescing code * below can assemble the packet into a single buffer that's * padded out to the mininum frame size. + * + * Note: this appears unnecessary for TCP, and doing it for TCP + * with PCIe adapters seems to result in bad checksums. */ - if (arg.rl_flags && (*m_head)->m_pkthdr.len < RL_MIN_FRAMELEN) + if (arg.rl_flags && !(arg.rl_flags & RL_TDESC_CMD_TCPCSUM) && + (*m_head)->m_pkthdr.len < RL_MIN_FRAMELEN) error = EFBIG; else error = bus_dmamap_load_mbuf(sc->rl_ldata.rl_mtag, map, --ELM82951187:-21975-0_--