cvs commit: src/sys/dev/em if_em.c if_em.h

Pyun YongHyeon yongari at FreeBSD.org
Mon Aug 14 01:50:55 UTC 2006


yongari     2006-08-14 01:50:54 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/em           if_em.c if_em.h 
  Log:
  Overhaul Rx path to recover from mbuf cluster allocation failure.
   o Create one more spare DMA map for Rx handler to recover from
     bus_dmamap_load_mbuf_sg(9) failure.
   o Make sure to update status bit in Rx descriptors even if we failed
     to allocate a new buffer. Previously it resulted in stuck condition
     and em_handle_rxtx task took up all available CPU cycles.
   o Don't blindly unload DMA map. Reuse loaded DMA map if received
     packet has errors. This would speed up Rx processing a bit under
     heavy load as it does not need to reload DMA map in case of error.
     (bus_dmamap_load_mbuf_sg(9) is the most expensive call in driver
      context.)
   o Update if_iqdrops counter if it can't allocate a mbuf cluster.
     With this change it's now possible to see queue dropped packets
     with netstat(1).
   o Update mbuf_cluster_failed counter if fixup code failed to
     allocate mbuf header.
   o Return ENOBUFS instead of ENOMEM in case of Rx fixup failure.
   o Make adapter->lmp NULL in case of Rx fixup failure. Strictly
     specking it's not necessary for correct operation but it makes
     the intention clear.
   o Remove now unused dropped_pkts member in softc.
  
  With these changes em(4) should survive mbuf cluster allocation
  failure on Rx path.
  
  Reviewed by:    pdeuskar, glebius (with improvements)
  
  Revision  Changes    Path
  1.129     +68 -47    src/sys/dev/em/if_em.c
  1.48      +1 -1      src/sys/dev/em/if_em.h


More information about the cvs-src mailing list