From owner-svn-src-head@FreeBSD.ORG Fri Dec 31 22:18:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3C3C1065670; Fri, 31 Dec 2010 22:18:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B37928FC0C; Fri, 31 Dec 2010 22:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVMIf1e090419; Fri, 31 Dec 2010 22:18:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVMIfTB090417; Fri, 31 Dec 2010 22:18:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012312218.oBVMIfTB090417@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 31 Dec 2010 22:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216860 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 22:18:41 -0000 Author: yongari Date: Fri Dec 31 22:18:41 2010 New Revision: 216860 URL: http://svn.freebsd.org/changeset/base/216860 Log: Fix endianness bug introduced in r205091. After controller updates control word in a RX LE, driver converts it to host byte order. The checksum value in the control word is stored in big endian form by controller. r205091 didn't account for the host byte order conversion such that the checksum value was incorrectly interpreted on big endian architectures which in turn made all TCP/UDP frames dropped. Make RX checksum offload work on any architectures by swapping the checksum value. Reported by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Tested by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Dec 31 21:57:54 2010 (r216859) +++ head/sys/dev/msk/if_msk.c Fri Dec 31 22:18:41 2010 (r216860) @@ -3070,7 +3070,7 @@ msk_rxcsum(struct msk_if_softc *sc_if, u default: return; } - csum = ntohs(sc_if->msk_csum & 0xFFFF); + csum = bswap16(sc_if->msk_csum & 0xFFFF); /* Checksum fixup for IP options. */ len = hlen - sizeof(struct ip); if (len > 0) {