From owner-cvs-all@FreeBSD.ORG Wed Jun 11 19:48:52 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B510106567D; Wed, 11 Jun 2008 19:48:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 631808FC20; Wed, 11 Jun 2008 19:48:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5BJmqoq075040; Wed, 11 Jun 2008 19:48:52 GMT (envelope-from marius@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5BJmqvu075039; Wed, 11 Jun 2008 19:48:52 GMT (envelope-from marius@repoman.freebsd.org) Message-Id: <200806111948.m5BJmqvu075039@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to marius@repoman.freebsd.org using -f From: Marius Strobl Date: Wed, 11 Jun 2008 19:48:35 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_7 Cc: Subject: cvs commit: src/sys/dev/hme if_hme.c if_hme_pci.c if_hme_sbus.c if_hmereg.h if_hmevar.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2008 19:48:52 -0000 marius 2008-06-11 19:48:35 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/dev/hme if_hme.c if_hme_pci.c if_hme_sbus.c if_hmereg.h if_hmevar.h Log: SVN rev 179727 on 2008-06-11 19:48:35Z by marius MFC: r178470 o Disable HMEDEBUG by default. o Add CTASSERTs ensuring that HME_NRXDESC and HME_NTXDESC are set to legal values. o Use appropriate maxsize, nsegments and maxsegsize parameters when creating DMA tags and correct some comments related to them. o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite some time now so collapse calls accordingly. o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in hme_rint() and hme_start_locked(). o Keep state of the link state and use it to enable or disable the MAC in hme_mii_statchg() accordingly as well as to return early from hme_start_locked() in case the link is down. o Introduce a sc_flags and use it to replace individual members like sc_pci. o Add bus_barrier(9) calls to hme_mac_bitflip(), hme_mii_readreg(), hme_mii_writereg() and hme_stop() to ensure the respective bit has been written before we starting polling on it and for the right bits to change. o Rather just returning in case hme_mac_bitflip() fails and leaving us in an undefined state report the problem and move on; chances are the requested configuration will become active shortly after. o Don't call hme_start_locked() in hme_init_locked() unconditionally but only after calls to hme_init_locked() when it's appropriate, i.e. in hme_watchdog(). o Add a KASSERT which asserts nsegs is valid also to hme_load_txmbuf(). o In hme_load_txmbuf(): - use a maximum of the newly introduced HME_NTXSEGS segments instead of the incorrect HME_NTXQ, which reflects the maximum TX queue length, for loading the mbufs and put the DMA segments back onto the stack instead of the softc as 16 should be ok there. - use the common errno(2) return values instead of homegrown ones, - given that hme_load_txmbuf() is allowed to fail resulting in a packet drop for quite some time now implement the functionality of hme_txcksum() by means of m_pullup(9), which de-obfuscates the code and allows to always retrieve the correct length of the IP header, [1] - also add a KASSERT which asserts nsegs is valid, - take advantage of m_collapse(9) instead of m_defrag(9) for performance reasons. o Don't bother to check whether the interface is running or whether its queue is empty before calling hme_start_locked() in hme_tint(), the former will check these anyway. o In hme_intr() call hme_rint() before hme_tint() as gem_tint() may take quite a while to return when it calls hme_start_locked(). o Get rid of sc_debug and just check if_flags for IFF_DEBUG directly. o Add a shadow sc_ifflags so we don't reset the chip when unnecessary. o Handle IFF_ALLMULTI correctly. [2] o Use PCIR_BAR instead of a homegrown macro. o Replace sc_enaddr[6] with sc_enaddr[ETHER_ADDR_LEN]. o Use the maximum of 256 TX descriptors for better performance as using all of them has no additional static cost rather than using just half of them. Reported by: rwatson [2] Suggested by: yongari [1] Reviewed by: yongari Revision Changes Path 1.53.2.1 +214 -183 src/sys/dev/hme/if_hme.c 1.23.2.1 +2 -2 src/sys/dev/hme/if_hme_pci.c 1.18.2.1 +1 -1 src/sys/dev/hme/if_hme_sbus.c 1.7.2.1 +0 -2 src/sys/dev/hme/if_hmereg.h 1.10.2.1 +11 -11 src/sys/dev/hme/if_hmevar.h