cvs commit: src/sys/dev/hme if_hme.c if_hme_pci.c if_hme_sbus.c if_hmereg.h if_hmevar.h

Marius Strobl marius at
Wed Jun 11 19:48:52 UTC 2008

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 
  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
  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  +214 -183  src/sys/dev/hme/if_hme.c  +2 -2      src/sys/dev/hme/if_hme_pci.c  +1 -1      src/sys/dev/hme/if_hme_sbus.c   +0 -2      src/sys/dev/hme/if_hmereg.h  +11 -11    src/sys/dev/hme/if_hmevar.h

More information about the cvs-src mailing list