]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC: r178470
authormarius <marius@FreeBSD.org>
Wed, 11 Jun 2008 19:49:10 +0000 (19:49 +0000)
committermarius <marius@FreeBSD.org>
Wed, 11 Jun 2008 19:49:10 +0000 (19:49 +0000)
commit37e1f78fb706b9b27b41dc65aee200757334afc0
treed40d4c7debe34a0df5f523496f31aef94bd1bc91
parent15b44aa21e04f98ba2bcc7da9235cc9a9d24bbb7
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
sys/dev/hme/if_hme.c
sys/dev/hme/if_hme_pci.c
sys/dev/hme/if_hme_sbus.c
sys/dev/hme/if_hmereg.h
sys/dev/hme/if_hmevar.h