From owner-svn-src-stable-8@FreeBSD.ORG Mon May 17 17:12:35 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98AEE106566B; Mon, 17 May 2010 17:12:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86AB38FC18; Mon, 17 May 2010 17:12:35 +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 o4HHCZLl086347; Mon, 17 May 2010 17:12:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4HHCZrP086345; Mon, 17 May 2010 17:12:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005171712.o4HHCZrP086345@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 17 May 2010 17:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208203 - stable/8/sys/dev/sge X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2010 17:12:35 -0000 Author: yongari Date: Mon May 17 17:12:35 2010 New Revision: 208203 URL: http://svn.freebsd.org/changeset/base/208203 Log: MFC r207852: SiS190 supports RX 10 bytes padding, CRC stripping as well as VLAN hardware tag insertion/stripping. Remove conditional code that disables these hardware features on SiS190. Also nuke RX fixup code which is no more required on strict-alignment architectures because SiS190 supports RX 10 bytes padding. Now all hardware features except jumbo frame and WOL are supported. Thanks to Masa Murayama who confirmed SiS190 also has the same hardware features of SiS191. I guess the only difference between SiS191 and SiS190 would be jumbo frame support. It will be implemented in near future. Modified: stable/8/sys/dev/sge/if_sge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Mon May 17 17:04:09 2010 (r208202) +++ stable/8/sys/dev/sge/if_sge.c Mon May 17 17:12:35 2010 (r208203) @@ -117,10 +117,6 @@ static void sge_miibus_statchg(device_t) static int sge_newbuf(struct sge_softc *, int); static int sge_encap(struct sge_softc *, struct mbuf **); -#ifndef __NO_STRICT_ALIGNMENT -static __inline void - sge_fixup_rx(struct mbuf *); -#endif static __inline void sge_discard_rxbuf(struct sge_softc *, int); static void sge_rxeof(struct sge_softc *); @@ -644,10 +640,8 @@ sge_attach(device_t dev) ether_ifattach(ifp, eaddr); /* VLAN setup. */ - if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; - ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM | + IFCAP_VLAN_HWTSO | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; /* Tell the upper layer(s) we support long frames. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); @@ -1129,23 +1123,6 @@ sge_newbuf(struct sge_softc *sc, int pro return (0); } -#ifndef __NO_STRICT_ALIGNMENT -static __inline void -sge_fixup_rx(struct mbuf *m) -{ - int i; - uint16_t *src, *dst; - - src = mtod(m, uint16_t *); - dst = src - 3; - - for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++) - *dst++ = *src++; - - m->m_data -= (SGE_RX_BUF_ALIGN - ETHER_ALIGN); -} -#endif - static __inline void sge_discard_rxbuf(struct sge_softc *sc, int index) { @@ -1228,23 +1205,15 @@ sge_rxeof(struct sge_softc *sc) m->m_pkthdr.ether_vtag = rxinfo & RDC_VLAN_MASK; m->m_flags |= M_VLANTAG; } - if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) { - /* - * Account for 10bytes auto padding which is used - * to align IP header on 32bit boundary. Also note, - * CRC bytes is automatically removed by the - * hardware. - */ - m->m_data += SGE_RX_PAD_BYTES; - m->m_pkthdr.len = m->m_len = SGE_RX_BYTES(rxstat) - - SGE_RX_PAD_BYTES; - } else { - m->m_pkthdr.len = m->m_len = SGE_RX_BYTES(rxstat) - - ETHER_CRC_LEN; -#ifndef __NO_STRICT_ALIGNMENT - sge_fixup_rx(m); -#endif - } + /* + * Account for 10bytes auto padding which is used + * to align IP header on 32bit boundary. Also note, + * CRC bytes is automatically removed by the + * hardware. + */ + m->m_data += SGE_RX_PAD_BYTES; + m->m_pkthdr.len = m->m_len = SGE_RX_BYTES(rxstat) - + SGE_RX_PAD_BYTES; m->m_pkthdr.rcvif = ifp; ifp->if_ipackets++; SGE_UNLOCK(sc); @@ -1688,18 +1657,13 @@ sge_init_locked(struct sge_softc *sc) CSR_WRITE_4(sc, RxWakeOnLan, 0); CSR_WRITE_4(sc, RxWakeOnLanData, 0); /* Allow receiving VLAN frames. */ - if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) - CSR_WRITE_2(sc, RxMPSControl, - ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + SGE_RX_PAD_BYTES); - else - CSR_WRITE_2(sc, RxMPSControl, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); + CSR_WRITE_2(sc, RxMPSControl, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + + SGE_RX_PAD_BYTES); for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, RxMacAddr + i, IF_LLADDR(ifp)[i]); /* Configure RX MAC. */ - rxfilt = 0; - if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) - rxfilt |= RXMAC_STRIP_FCS | RXMAC_PAD_ENB; + rxfilt = RXMAC_STRIP_FCS | RXMAC_PAD_ENB; CSR_WRITE_2(sc, RxMacControl, rxfilt); sge_rxfilter(sc); sge_setvlan(sc);